self.nextthink = time;\r
self.think = explode;\r
}\r
+\r
+void PlayerGib(entity e, entity attacker)\r
+{\r
+ if(e.stat_eaten)\r
+ return; // you can't gib inside the stomach\r
+\r
+ float gib_health;\r
+ gib_health = cvar("sv_gibhealth");\r
+ if(gib_health > 0) // someone is being stupid\r
+ gib_health = 0;\r
+ if(cvar("g_healthsize")) // smaller bodies are more likely to gib and vice versa\r
+ gib_health *= e.scale;\r
+\r
+ if (e.health <= gib_health && e.modelindex != 0)\r
+ {\r
+ // don't use any animations as a gib\r
+ e.frame = 0;\r
+ e.dead_frame = 0;\r
+ // view just above the floor\r
+ e.view_ofs = '0 0 4';\r
+\r
+ Violence_GibSplash(e, 1, 1, attacker);\r
+ e.modelindex = 0; // restore later\r
+ e.solid = SOLID_NOT; // restore later\r
+ }\r
+}\r