Expected
The magazine model should be visible in the grip, as it is on Glock19.
Actual
The magazine is not rendered at all on Glock19_Tan. The weapon still functions normally (magazine count, chambering, reload).
Root cause
Both colour variants share the same model:
dz\weapons\pistols\glock\glock19.p3d
The magazine is not a separate mesh on the weapon - it is a proxy inside the model:
proxy:dz\weapons\attachments\magazine\magazine_glock19
In the vanilla config (weapons_pistols.pbo -> glock\config.bin):
class Glock19: Glock19_Base
{
hiddenSelections[] = { "zasleh", "zbytek", "magazine", "bullet" };
hiddenSelectionsMaterials[] =
{
"",
"dz\weapons\pistols\glock\data\glock19.rvmat", // zbytek
"", // magazine <-- empty
""
};
};
class Glock19_Tan: Glock19
{
hiddenSelectionsMaterials[] =
{
"",
"dz\weapons\pistols\glock\data\glock19_tan.rvmat", // zbytek
"", // magazine <-- empty
""
};
};
Because the "magazine" entry is an empty string, the magazine proxy inherits the
parent's current material at render time:
- Glock19 -> inherits glock19.rvmat -> the magazine renders correctly
- Glock19_Tan -> inherits glock19_tan.rvmat -> the tan material's stages / UV
layout are authored for the gun body, so the magazine proxy
fails to render
Note: Glock19_Tan also carries an extra entry that Glock19 does not have:
class DamageSystem { class GlobalHealth { class Health {
RefTexsMats[] = { "dz\weapons\pistols\glock\data\glock19.rvmat" };
}; }; };
Clearing that entry alone did NOT fix the invisible magazine in our tests, so it
appears to be unrelated (though it is also inconsistent with the base class).
The server log additionally spams this line for every Glock19_Tan while it is in
use, which is consistent with the weapon state machine disagreeing with the
magazine state:
[WeaponFSM::ValidateAndRepairHelper] :: [INFO] :: [wpnfsm] ValidateAndRepair
Attempting to repair: Glock19_Tan:xxxxx - MagazineRepair - Pistol_CLO_CHG_BU1_MA1
- state: 1 != weapon: 0
Suggested fix
In the vanilla config for Glock19_Tan, give the "magazine" hidden-selection an
explicit material instead of leaving it empty (the magazine itself only ships a
black material, so pointing it at the black body material is correct):
class Glock19_Tan: Glock19
{
hiddenSelectionsMaterials[] =
{
"",
"dz\weapons\pistols\glock\data\glock19_tan.rvmat",
"dz\weapons\pistols\glock\data\glock19.rvmat", // magazine
""
};
};
Additionally, consider removing the RefTexsMats[] entry from Glock19_Tan's
DamageSystem, since the base Glock19 does not define it.
Workaround
We ship this as a config override in our server/client mod. After applying it the
magazine renders correctly on Glock19_Tan (verified in game).