hey
i found some more bugs concerning setUnitPosition.
i'm trying to use it as a escape skill for a hero.
the hero summons a dummy size-zero unit to trigger an unitCreatedOfType event.
the content of that reads as follows:
if unitFaction(lastCreatedUnit()) == 0 then
setUnitPosition(variable_hero_1,{(startLocation(unitFaction(lastCreatedUnit()))[1] + 3), (startLocation(unitFaction(lastCreatedUnit()))[2] + 3)})
end
destroyUnit(lastCreatedUnit())
so nothing special so far.
now the wierd stuff starts:
- the units which surrounded my hero before he escaped using the summon skill stay visible, although being in the fog of war
- they all turned around in the new direction of my hero, attacking the air in front of them
- after some time like 10-30 second, i'm not sure yet what has to happen, the game crashes
[2012-10-11 13:36:51] *ERROR* In [game.cpp::update Line: 1762] Error [trying to move into occupied cell and field]
EDIT: actually, the error given above happens because the teleported unit gets killed by the units hitting the air.
they don't do any damage after the teleport as long as the teleported unit doesn't get any new commands. as soon as it gets one (also when it spots an enemy for example), it's recieving damage again.