fix automatic switching to primary weapon after grenade throw

When player had only one grenade and threw it, and switched to edit mode
before "attackmillis >= throwwait", then grenade stayed in his hand,
although there weren't any grenades in magazine.
This commit is contained in:
aurhat
2021-10-20 22:49:29 +02:00
parent a95a4048cf
commit 7cc9f1a11f
+1 -1
View File
@@ -70,7 +70,7 @@ void toggleedit(bool force)
player1->state = editing ? CS_EDITING : (watchingdemo ? CS_SPECTATE : CS_ALIVE);
if(editing && player1->onladder) player1->onladder = false;
if(editing && (player1->weaponsel->type == GUN_SNIPER && ((sniperrifle *)player1->weaponsel)->scoped)) ((sniperrifle *)player1->weaponsel)->onownerdies(); // or ondeselecting()
if(editing && (player1->weaponsel->type == GUN_GRENADE)) ((grenades *)player1->weaponsel)->onownerdies();
if(editing && (player1->weaponsel->type == GUN_GRENADE) && ((grenades *)player1->weaponsel)->state < GST_THROWING) ((grenades *)player1->weaponsel)->onownerdies();
if(!force) addmsg(SV_EDITMODE, "ri", editing);
}