fix showed equipment in animation of dead player

1. Don't show grenade, only empty hands, if dead player didn't have any
grenade in magazine.
2. Show pistol, instead of weapon "from" akimboendaction, if dead player
had selected akimbo.
This commit is contained in:
aurhat
2021-10-18 15:40:46 +02:00
parent cd3793b8b2
commit b7d1bfc8d7
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -1080,7 +1080,7 @@ void renderclientp(playerent *d)
}
}
string vwep;
if(d->weaponsel) formatstring(vwep)("weapons/%s/world", d->weaponsel->info.modelname);
if(d->weaponsel && !(d->weaponsel->type == GUN_GRENADE && !d->mag[GUN_GRENADE])) formatstring(vwep)("weapons/%s/world", d->weaponsel->info.modelname);
else vwep[0] = 0;
renderclient(d, "playermodels", vwep[0] ? vwep : NULL, -(int)textureload(skin)->id);
}
+4 -3
View File
@@ -1686,7 +1686,8 @@ void checkakimbo()
if(player1->akimbo)
{
akimbo &a = *((akimbo *)player1->weapons[GUN_AKIMBO]);
if(a.timerout() || player1->state == CS_DEAD || player1->state == CS_SPECTATE)
bool isdeadorspect = player1->state == CS_DEAD || player1->state == CS_SPECTATE;
if(a.timerout() || isdeadorspect)
{
weapon &p = *player1->weapons[GUN_PISTOL];
player1->akimbo = false;
@@ -1694,7 +1695,7 @@ void checkakimbo()
if(player1->weaponsel->type==GUN_AKIMBO || (player1->weaponchanging && player1->nextweaponsel->type==GUN_AKIMBO))
{
switch(akimboendaction)
switch(isdeadorspect ? 1 : akimboendaction)
{
case 0: player1->weaponswitch(player1->weapons[GUN_KNIFE]); break;
case 1:
@@ -1747,7 +1748,7 @@ void checkakimbo()
*/
}
}
if(player1->state != CS_DEAD && player1->state != CS_SPECTATE) audiomgr.playsoundc(S_AKIMBOOUT);
if(!isdeadorspect) audiomgr.playsoundc(S_AKIMBOOUT);
}
}
}