diff --git a/source/client/defs/custom.qc b/source/client/defs/custom.qc index 17d573c..a6ce2f6 100644 --- a/source/client/defs/custom.qc +++ b/source/client/defs/custom.qc @@ -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. // diff --git a/source/client/main.qc b/source/client/main.qc index 9a96777..7b13e39 100644 --- a/source/client/main.qc +++ b/source/client/main.qc @@ -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 =