ZDoom / gzdoom

GZDoom is a feature centric port for all Doom engine games, based on ZDoom, adding an OpenGL renderer and powerful scripting capabilities
http://zdoom.org
GNU General Public License v3.0
2.33k stars 528 forks source link

Fixed ViewPos not properly backing up when predicting #2543

Closed Boondorl closed 2 months ago

Boondorl commented 2 months ago

Pawns will now also force create the ViewPos object so that any calls to SetViewPos() while predicting won't spam create objects if it didn't exist during a real tick. In the future, please do not use DObjects to store playsim data. Structs will be automatically backed up which makes them much easier to work with (alongside not needing a GC'd object anymore). ViewPos will likely need a structural rework in the future because of these problems.

MajorCooke commented 2 months ago

I was encountering crashes when trying to do it with structs, so I gave up and made it with DObjects instead. That's the only reason it's this way now.