Skip to content

Commit

Permalink
Fix assignment of IsOwnedByPlayer in standalone.
Browse files Browse the repository at this point in the history
Fixes a number of standalone MP bugs where code assumes IsOwnedByPlayer only refers to the local machine player.
  • Loading branch information
OmniBlade committed Jun 20, 2024
1 parent 2bfee4f commit f4a3cff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions redalert/techno.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,11 +683,15 @@ TechnoClass::TechnoClass(RTTIType rtti, int id, HousesType house)
// IsOwnedByPlayer = (PlayerPtr == House);
// Added for multiplayer changes. ST - 4/24/2019 10:40AM
IsDiscoveredByPlayerMask = 0;
#ifdef REMASTER_BUILD
if (Session.Type == GAME_NORMAL) {
IsOwnedByPlayer = (PlayerPtr == House);
} else {
IsOwnedByPlayer = House->IsHuman;
}
#else
IsOwnedByPlayer = (PlayerPtr == House);
#endif
}

/***********************************************************************************************
Expand Down
4 changes: 4 additions & 0 deletions tiberiandawn/techno.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,11 +916,15 @@ TechnoClass::TechnoClass(HousesType house)

// Added for multiplayer changes. ST - 4/24/2019 10:40AM
IsDiscoveredByPlayerMask = 0;
#ifdef REMASTER_BUILD
if (GameToPlay == GAME_NORMAL) {
IsOwnedByPlayer = (house == PlayerPtr->Class->House);
} else {
IsOwnedByPlayer = House->IsHuman;
}
#else
IsOwnedByPlayer = (PlayerPtr == House);
#endif

/*
** There is a chance that a vehicle will be a "lemon".
Expand Down

0 comments on commit f4a3cff

Please sign in to comment.