- replaced the assignment operator in player_t with a named function.

This didn't behave like an assignment operator so it shouldn't be one, especially since the two places where it got called need different functionality.
This commit is contained in:
Christoph Oelckers 2019-03-03 12:12:17 +01:00
commit 3698a5edc1
3 changed files with 13 additions and 11 deletions

View file

@ -813,8 +813,7 @@ void FLevelLocals::CopyPlayer(player_t *dst, player_t *src, const char *name)
bool attackdown = dst->attackdown;
bool usedown = dst->usedown;
*dst = *src; // To avoid memory leaks at this point the userinfo in src must be empty which is taken care of by the TransferFrom call above.
dst->CopyFrom(*src, true); // To avoid memory leaks at this point the userinfo in src must be empty which is taken care of by the TransferFrom call above.
dst->cheats |= chasecam;
@ -857,9 +856,6 @@ void FLevelLocals::CopyPlayer(player_t *dst, player_t *src, const char *name)
pspr = pspr->Next;
}
// Don't let the psprites be destroyed when src is destroyed.
src->psprites = nullptr;
// These 2 variables may not be overwritten.
dst->attackdown = attackdown;
dst->usedown = usedown;