jarnar85 / source-sdk-2013

The 2013 edition of the Source SDK
https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted
Other
0 stars 0 forks source link

[BUG] Model-Error for Citizens #16

Open jarnar85 opened 4 years ago

jarnar85 commented 4 years ago

Describe the bug Normal model-generation behavior in npc_citizen17.cpp leads to precaching fail when calling it for player_setclass in CBasePlayer::SetStats

To Reproduce Steps to reproduce the behavior:

  1. Mimic behavior of CNPC_Citizen::SelectModel in CNPC_Citizen::GetBaseData in the default section
  2. in console enter "player_setclass citizen"
  3. See how the game breakes while trying to precache because the value of szModelName changes in CBasePlayer::SetModelCaching

Expected behavior The player model changes and uses a random head (for now)

Additional context It seems as if the string-creation is the problem here... as fixed strings do not have the issue (current circumvention)