CLIENT: CSQC overriding Zombie skin variances

This commit is contained in:
cypress 2024-05-22 19:19:52 -07:00
parent 3ad99583df
commit 81b4aa187e
2 changed files with 29 additions and 0 deletions

View file

@ -241,6 +241,23 @@ vector playerOrigin;
vector playerOriginOld;
vector playerVelocity;
//
// List of Zombie limb meshes for custom skinning
//
string zombie_skins[] =
{
"models/ai/zb%.mdl",
"models/ai/zbc%.mdl",
"models/ai/zcfull.mdl",
"models/ai/zhc^.mdl",
"models/ai/zalc(.mdl",
"models/ai/zarc(.mdl",
"models/ai/zfull.mdl",
"models/ai/zh^.mdl",
"models/ai/zal(.mdl",
"models/ai/zar(.mdl"
};
//
// Screen sizes, self-explanatory.
//

View file

@ -56,6 +56,13 @@ void() ToggleMenu =
}
}
float(float isnew) SetZombieSkinning =
{
self.drawmask = MASK_ENGINE;
setcustomskin(self, __NULL__, sprintf("replace \"\" \"models/ai/zfull.mdl_%d.pcx\"\n", self.skin));
return PREDRAW_NEXT;
};
noref void(float apiver, string enginename, float enginever) CSQC_Init =
{
setwindowcaption("Nazi Zombies: Portable");
@ -163,6 +170,11 @@ noref void(float apiver, string enginename, float enginever) CSQC_Init =
build_datetime = fgets(file);
fclose(file);
}
// Intercept every Zombie mesh to apply custom skinning
for(float i = 0; i < zombie_skins.length; i++) {
deltalisten(zombie_skins[i], SetZombieSkinning, 0);
}
};
noref void() CSQC_WorldLoaded =