screeps / engine

ISC License
133 stars 66 forks source link

Destroying structure by invoking `Structure#destroy` is not logged by `Room#getEventLog` #139

Open astro-angelfish opened 1 year ago

astro-angelfish commented 1 year ago

The API showed that EVENT_OBJECT_DESTROYED can return the any object in rooms is destroyed. But in engine code the structure destroy can only be logged when it is destroyed by creep or nuke attack (in https://github.com/screeps/engine/blob/78631905d975700d02786d9b666b9f97b1f6f8f9/src/processor/intents/_damage.js#L51). I wonder if i need to spend a lot CPU to check if structure is changed or overwrite the prototype of Structure? Or it is just missing in the structure destroy code?