Ammo skin only replacements now work.

This commit is contained in:
Richard Allen 2003-04-02 17:58:03 +00:00
parent fc35aa5c48
commit 0f8deb9eeb
2 changed files with 60 additions and 1 deletions

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.42 2003/04/02 17:58:03 jbravo
// Ammo skin only replacements now work.
//
// Revision 1.41 2003/03/28 22:25:10 makro
// no message
//
@ -479,7 +482,7 @@ static void CG_Item(centity_t * cent)
if (wi->customSkin)
ent.customSkin = wi->customSkin;
}
if (item->giType == IT_HOLDABLE) {
if (item->giType == IT_HOLDABLE || item->giType == IT_AMMO) {
itemInfo = &cg_items[item - bg_itemlist];
if (itemInfo->customSkin)
ent.customSkin = itemInfo->customSkin;

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.112 2003/04/02 17:58:03 jbravo
// Ammo skin only replacements now work.
//
// Revision 1.111 2003/03/29 23:04:56 jbravo
// More post _skin cvar fixes
//
@ -1141,6 +1144,59 @@ void CG_RegisterItemVisuals(int itemNum)
}
}
if (item->giType == IT_AMMO) {
if (!strcmp(item->classname, "ammo_mk23")) {
trap_Cvar_VariableStringBuffer("cg_RQ3_ammo_mk23", str, sizeof(str));
model = modelFromStr(str);
skin = skinFromStr(str);
if (strcmp(skin, "default")) {
itemInfo->customSkin = trap_R_RegisterSkin (va("models/ammo/%s.skin", skin));
if (!itemInfo->customSkin)
Com_Printf("^1Ammo skin load failure: %s\n", va("models/ammo/%s.skin", skin));
}
}
if (!strcmp(item->classname, "ammo_shells")) {
trap_Cvar_VariableStringBuffer("cg_RQ3_ammo_shells", str, sizeof(str));
model = modelFromStr(str);
skin = skinFromStr(str);
if (strcmp(skin, "default")) {
itemInfo->customSkin = trap_R_RegisterSkin (va("models/ammo/%s.skin", skin));
if (!itemInfo->customSkin)
Com_Printf("^1Ammo skin load failure: %s\n", va("models/ammo/%s.skin", skin));
}
}
if (!strcmp(item->classname, "ammo_ssg3000")) {
trap_Cvar_VariableStringBuffer("cg_RQ3_ammo_ssg3000", str, sizeof(str));
model = modelFromStr(str);
skin = skinFromStr(str);
if (strcmp(skin, "default")) {
itemInfo->customSkin = trap_R_RegisterSkin (va("models/ammo/%s.skin", skin));
if (!itemInfo->customSkin)
Com_Printf("^1Ammo skin load failure: %s\n", va("models/ammo/%s.skin", skin));
}
}
if (!strcmp(item->classname, "ammo_mp5")) {
trap_Cvar_VariableStringBuffer("cg_RQ3_ammo_mp5", str, sizeof(str));
model = modelFromStr(str);
skin = skinFromStr(str);
if (strcmp(skin, "default")) {
itemInfo->customSkin = trap_R_RegisterSkin (va("models/ammo/%s.skin", skin));
if (!itemInfo->customSkin)
Com_Printf("^1Ammo skin load failure: %s\n", va("models/ammo/%s.skin", skin));
}
}
if (!strcmp(item->classname, "ammo_m4")) {
trap_Cvar_VariableStringBuffer("cg_RQ3_ammo_m4", str, sizeof(str));
model = modelFromStr(str);
skin = skinFromStr(str);
if (strcmp(skin, "default")) {
itemInfo->customSkin = trap_R_RegisterSkin (va("models/ammo/%s.skin", skin));
if (!itemInfo->customSkin)
Com_Printf("^1Ammo skin load failure: %s\n", va("models/ammo/%s.skin", skin));
}
}
}
//
// powerups have an accompanying ring or sphere
//