* Updated to ZDoom r3450:

- Fix signed/unsigned mismatch warned by GCC.
- Moved "Go away!" text into language.enu.
- In conjunction with all the below changes, attempt to fix A_CheckSightOrRange and A_CheckSight for multiplayer: They now always check through the eyes of every player. For players whose cameras are not players, they also check through the eyes of those cameras.
- Using spynext/spyprev to switch from a non-player to a player now writes a command to the network stream and lets Net_DoCommand() take care of it later. The logic here is that if a player is viewing from something that isn't another player, then every player needs to know about it for sync purposes. Consequently, when they stop viewing from a non-player and switch to a player, everybody needs to know about that too. But if they are viewing from a player, it doesn't matter which player it is, so they can spynext/spyprev all they want without letting the other players know about it (and without potentially breaking demos--due to the above-mentioned two codepointers--while doing it during demo playback).
- Replaced the instances of checking players[consoleplayer].camera for a valid pointer to ones that do it for every player.
- Fixed: Upon changing levels, all players but the consoleplayer would have their cameras NULLed.
- Fixed: player_t::FixPointers() needs to bypass the read barriers, or it won't be able to do substitutions of old objects that are pending deletion.
- Revised the fix from r3442: Make the line a nonrepeatable Door_Open instead of completely clearing the line's special.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1315 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2012-03-17 18:48:17 +00:00
parent 908f2cd8c7
commit c67c51614b
13 changed files with 124 additions and 64 deletions

View file

@ -326,21 +326,25 @@ size_t player_t::FixPointers (const DObject *old, DObject *rep)
{
APlayerPawn *replacement = static_cast<APlayerPawn *>(rep);
size_t changed = 0;
if (mo == old) mo = replacement, changed++;
if (poisoner == old) poisoner = replacement, changed++;
if (attacker == old) attacker = replacement, changed++;
if (camera == old) camera = replacement, changed++;
if (dest == old) dest = replacement, changed++;
if (prev == old) prev = replacement, changed++;
if (enemy == old) enemy = replacement, changed++;
if (missile == old) missile = replacement, changed++;
if (mate == old) mate = replacement, changed++;
if (last_mate == old) last_mate = replacement, changed++;
if (ReadyWeapon == old) ReadyWeapon = static_cast<AWeapon *>(rep), changed++;
if (PendingWeapon == old) PendingWeapon = static_cast<AWeapon *>(rep), changed++;
if (PremorphWeapon == old) PremorphWeapon = static_cast<AWeapon *>(rep), changed++;
if (ConversationNPC == old) ConversationNPC = replacement, changed++;
if (ConversationPC == old) ConversationPC = replacement, changed++;
// The construct *& is used in several of these to avoid the read barriers
// that would turn the pointer we want to check to NULL if the old object
// is pending deletion.
if (mo == old) mo = replacement, changed++;
if (*&poisoner == old) poisoner = replacement, changed++;
if (*&attacker == old) attacker = replacement, changed++;
if (*&camera == old) camera = replacement, changed++;
if (*&dest == old) dest = replacement, changed++;
if (*&prev == old) prev = replacement, changed++;
if (*&enemy == old) enemy = replacement, changed++;
if (*&missile == old) missile = replacement, changed++;
if (*&mate == old) mate = replacement, changed++;
if (*&last_mate == old) last_mate = replacement, changed++;
if (ReadyWeapon == old) ReadyWeapon = static_cast<AWeapon *>(rep), changed++;
if (PendingWeapon == old) PendingWeapon = static_cast<AWeapon *>(rep), changed++;
if (*&PremorphWeapon == old) PremorphWeapon = static_cast<AWeapon *>(rep), changed++;
if (*&ConversationNPC == old) ConversationNPC = replacement, changed++;
if (*&ConversationPC == old) ConversationPC = replacement, changed++;
return changed;
}