EvEmu-Project / evemu_Crucible

Emulator for EvE Online's Crucible expansion
https://evemu.dev
168 stars 65 forks source link

Fixed asteroids being missing from bubble on reentry #287

Closed beelitzs closed 2 months ago

beelitzs commented 2 months ago

Fix for issues #92 & #251

This was caused by m_dynamicEntities not having the asteroids populated on the second entry into the SystemBubble. SystemBubble::ProcessWander was removing them because AsteroidSE objects are not a DynamicSystemEntity causing it to be erased from the map. However, the BeltMgr and SystemManager will both refuse to re-add the roids to the bubble as they already exist.

I'm unsure if there is a better way to fix this or not but the simplest solution I found was just to explicitly check for roids and not erase them from the m_dynamicEntities map during the ProcessWander checks.

jdhirst commented 2 months ago

@beelitzs Thanks for the contribution!!! 🎉 I think your solution makes sense, since we don't want to regen the belt every time you re-enter, they should be persisted until the system is unloaded itself.

Since asteroids are ObjectSystemEntities instead of Dynamic and the definition is this: https://github.com/EvEmu-Project/evemu_Crucible/blob/7d5e20611d53ca4ded6875e7bd390f36878d4654/src/eve-server/system/SystemEntity.h#L514

Maybe we should instead of checking specifically for Asteroids, we could check for all ObjectSystemEntity types and handle them instead since they would all not want to be unloaded on warp out. What do you think?

beelitzs commented 2 months ago

@jdhirst Adjusted and tested. The issue isn't able to be replicated in this version for asteroids or jetcans.

jdhirst commented 2 months ago

@beelitzs Excellent, looks good to me!