TF2-DMB / CBaseNPC

Provides a friendly interface for plugins to use in order to create custom NPCs on the game Team Fortress 2
37 stars 6 forks source link

Fix gamedata based entity factory #37

Closed Kenzzer closed 1 year ago

Kenzzer commented 1 year ago

Due to the nature of member function ptrs on linux, the extension would auto offset the class object ptr allocated by the game. Leading to misaligned memory.

On the topic of misaligned memory, we weren't really guarding against it. So just in the event the engine changes how memory is allocated, or that plugin provides an object size that doesn't allow for 4 bytes aligned memory, we fix that before allocating anything.