-
- int idx;
- if (this.weaponchild) // v_ model attached to invisible h_ model
- {
- idx = gettagindex(this.weaponchild, "shell");
- if (!idx) idx = gettagindex(this.weaponchild, "tag_shell");
- if (idx) this.spawnorigin = gettaginfo(this.weaponchild, idx);
- }
- else
- {
- idx = 0;
+ {
+ int idx = 0;
+ // v_ model attached to invisible h_ model
+ if (this.weaponchild
+ && ((idx = gettagindex(this.weaponchild, "shell")) || (idx = gettagindex(this.weaponchild, "tag_shell"))))
+ {
+ this.spawnorigin = gettaginfo(this.weaponchild, idx);
+ }
+ else if ((idx = gettagindex(this, "shell")) || (idx = gettagindex(this, "tag_shell")))
+ {
+ this.spawnorigin = gettaginfo(this, idx);
+ }
+ else
+ {
+ LOG_WARNINGF("weapon model %s does not support the 'shell' tag, will display casings wrong\n",
+ this.model);
+ this.spawnorigin = this.movedir;
+ }