- 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:
parent
86a4aea650
commit
3698a5edc1
3 changed files with 13 additions and 11 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue