Fixed original models not restored when using zr_human on a player.

This commit is contained in:
richard
2009-06-22 17:01:26 +02:00
parent a0d8209c6a
commit 1cc0fc4dda
3 changed files with 28 additions and 5 deletions

View File

@ -101,8 +101,19 @@ bool:ClassApplyModel(client, classindex, cachetype = ZR_CLASS_CACHE_PLAYER)
// Check if the user specified no change.
else if (strcmp(modelpath, "default", false) == 0)
{
// Don't change the model.
return true;
// Get current model.
GetClientModel(client, modelpath, sizeof(modelpath));
// Restore original model if not already set.
if (!StrEqual(ClassOriginalPlayerModel[client], modelpath))
{
strcopy(modelpath, sizeof(modelpath), ClassOriginalPlayerModel[client]);
}
else
{
// Wanted model is already set, don't change.
return true;
}
}
SetEntityModel(client, modelpath);