unit:CanMoveOrAttackInto() works?

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
So I have my warrior adjacent to a barb unit at 15, 20.

> unit = UI.GetHeadSelectedUnit()
> targetPlot = Map.GetPlot(15, 20)

> unit:CanMoveOrAttackInto(targetPlot, 0, 0)
false

> unit:PushMission(MissionTypes.MISSION_MOVE_TO, 15, 20)
--warrior attacks barb unit

unit:CanMoveOrAttackInto returns false regardless of the 2nd and 3rd args, or for that matter the target plot. The corresponding method is used throughout the DLL. Did they just break the Lua implementation for this?
 
It's bugged

Code:
bool [B][COLOR="Red"]bResult [/COLOR][/B]= false;
if (pkPlot) {
    pkUnit->canMoveOrAttackInto(*pkPlot, bMoveFlags);
}
lua_pushboolean(L, [B][COLOR="Red"]bResult[/COLOR][/B]);

should be

Code:
    [B][COLOR="Red"]bResult[/COLOR][/B] = pkUnit->canMoveOrAttackInto(*pkPlot, bMoveFlags);
 
Back
Top Bottom