Updating unit quadfield position?

Updating unit quadfield position?

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Updating unit quadfield position?

Post by KDR_11k »

When I teleport buildings around shots go through them, I believe that's caused by their quadfield position not being updated. Is there an official way to update that already or do I need to patch the engine?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Updating unit quadfield position?

Post by Tobi »

AFAICS LUA calls to change a unit's position call CUnit::ForcedMove, which calls CQuadField::UnitMoved already.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Updating unit quadfield position?

Post by KDR_11k »

Ah, okay. Then I don't have an explanation why teleported buildings can't be hit.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Updating unit quadfield position?

Post by Kloot »

They probably don't re-register themselves on the blocking map.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Updating unit quadfield position?

Post by KDR_11k »

I force them to with SetUnitBlocking.
Post Reply

Return to “Lua Scripts”