Bug 5004 - use a more up-to-date origin in G_RoomForClassChange()
Status: RESOLVED FIXED
Alias: None
Product: Tremulous
Classification: Unclassified
Component: Misc
Version: SVN HEAD
Hardware: All All
: P3 normal
Assignee: Tim Angus
QA Contact: Tremulous Bugs
URL:
Depends on:
Blocks: 5158
 
Reported: 2011-05-23 21:22 EDT by /dev/humancontroller
Modified: 2011-09-25 17:27:47 EDT
2 users (show)

See Also:


Attachments
use a more up-to-date origin in G_RoomForClassChange() (711 bytes, patch)
2011-05-23 21:22 EDT, /dev/humancontroller

Description /dev/humancontroller 2011-05-23 21:22:13 EDT
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==.
Comment 1 Chris "Lakitu7" Schwarz 2011-06-13 14:25:47 EDT
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.
Comment 2 /dev/humancontroller 2011-06-14 07:43:08 EDT
(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.
Comment 3 M. Kristall 2011-09-25 17:27:47 EDT
Thanks, applied in revision 2255.