Created attachment 2741[details]
use a more up-to-date origin in G_RoomForClassChange()
this will be of use later by AMP. this fix is courtesy of ==Troy==.
Please explain why ps would be "more up-to-date" and how this would affect things. As it is, much more of the game code uses s.origin than ps.origin, and ps.origin is primarily where you copy things for the sake of sending them to clients.
(In reply to comment #1)
> Please explain why ps would be "more up-to-date" and how this would affect
> things. As it is, much more of the game code uses s.origin than ps.origin, and
> ps.origin is primarily where you copy things for the sake of sending them to
> clients.
wrong. the pmove code primarily uses ps.origin to execute player movement, and other code (for example, BG_PlayerStateToEntityState()) updates s.pos.trBase to match ps.origin "from time to time". in fact i have no idea why s.origin would be used for players, other than due to misconcepted programming. all 3 origins are sent to clients (ps.origin to the player's controller and all spec-followers of the player, s.origin and s.pos.trBase to other clients who see the player) btw.
for example, TeleportPlayer() does not update s.origin, and therefore teleporters and client commands like setviewpos also don't. in corner case situations, right after teleporting, there is a possibility of equipping a battlesuit in inappropriate ways.
this change does not seem to have caused anything bad so far on the Amsterdam Unlimited servers.
Created attachment 2741 [details] use a more up-to-date origin in G_RoomForClassChange() this will be of use later by AMP. this fix is courtesy of ==Troy==.