Phobos-developers / Phobos

Ares-compatible C&C Red Alert 2: Yuri's Revenge engine extension
GNU Lesser General Public License v3.0
300 stars 95 forks source link

Spawn returning optimization #1333

Open TaranDahl opened 3 months ago

TaranDahl commented 3 months ago

Buildings with foundation bigger than 1x1 can now recycle spawned correctly. A new flag Spawner.RecycleRange allow the spawner can recycle spawns in long-range. A new flag Spawner.RecycleAnim allow playing an anim when the spawned is recycled.

TaranDahl commented 3 months ago

the doc is incomplete. Should add description for Spawner.RecycleOnTurret and Spawner.FLH (should be Spawner.RecycleFLH probably?)

It's not the doc, it's the code. I once planned the recycle flh to be impl recently, but it seems that it is not as simple as I thought. gamemd will act the following codes if the spawnee is not close enough to the spawner. The spawnee will target the spawner rather than the spawner's coords. I don't know how to apply flh on this. I will make the unfinished flags comment. I may impl them when I have an idea.

pSpawnee->SetDestination(pSpawnee, this->Owner, 1);
pSpawnee->SetTarget(pSpawnee, 0);
pSpawnee->QueueMission(pSpawnee, Mission_Move, 0);