Skip to content

Commit d2388dc

Browse files
committed
Remove clamping of human grunt opfor head value to allow custom heads
1 parent eb69891 commit d2388dc

File tree

2 files changed

+50
-67
lines changed

2 files changed

+50
-67
lines changed

dlls/fgrunt.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,8 +1895,6 @@ void CHFGrunt :: Spawn()
18951895
else
18961896
m_iHead = FG_HEAD_MASK;
18971897
}
1898-
else if ( m_iHead >= FG_HEAD_COUNT )
1899-
m_iHead = FG_HEAD_MASK;
19001898

19011899
if (FBitSet( pev->weapons, FGRUNT_9MMAR ))
19021900
{
@@ -2881,7 +2879,7 @@ void CDeadFGrunt::Spawn()
28812879
m_iHead = FG_HEAD_BERET_BLACK;
28822880
}
28832881
}
2884-
else if ( m_iHead < 0 || m_iHead >= FG_HEAD_COUNT )
2882+
else if ( m_iHead < 0 )
28852883
m_iHead = 0;
28862884

28872885
SetBodygroup( FG_HEAD_GROUP, m_iHead );

fgd/halflife.fgd

Lines changed: 49 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5330,7 +5330,53 @@
53305330
2 : "Dark"
53315331
]
53325332
]
5333-
@PointClass base(Monster, TalkMonster, Sequence) size(-16 -16 0, 16 16 72) studio("models/hgrunt_opfor.mdl") = monster_human_grunt_ally : "Human Grunt Ally (camo)"
5333+
5334+
@BaseClass = HumanGruntAllyHead
5335+
[
5336+
head(Choices) : "Heads" : -1 =
5337+
[
5338+
-2 : "Random"
5339+
-1 : "Default"
5340+
0 : "Gas Mask"
5341+
1 : "Beret"
5342+
2 : "Ops Mask"
5343+
3 : "Bandana White"
5344+
4 : "Bandana Black"
5345+
5 : "MP"
5346+
6 : "Major"
5347+
7 : "Beret (Black)"
5348+
8 : "Custom (8)"
5349+
9 : "Custom (9)"
5350+
10 : "Custom (10)"
5351+
11 : "Custom (11)"
5352+
12 : "Custom (12)"
5353+
13 : "Custom (13)"
5354+
14 : "Custom (14)"
5355+
15 : "Custom (15)"
5356+
16 : "Custom (16)"
5357+
17 : "Custom (17)"
5358+
18 : "Custom (18)"
5359+
19 : "Custom (19)"
5360+
20 : "Custom (20)"
5361+
]
5362+
]
5363+
5364+
@BaseClass = HumanGruntAllyWeapon
5365+
[
5366+
weapons(Choices) : "Weapons" : 3 =
5367+
[
5368+
0 : "None"
5369+
1 : "9mmAR"
5370+
3 : "9mmAR + HG"
5371+
5 : "9mmAR + GL"
5372+
8 : "Shotgun"
5373+
10 : "Shotgun + HG"
5374+
16 : "Saw"
5375+
18 : "Saw + HG"
5376+
]
5377+
]
5378+
5379+
@PointClass base(Monster, TalkMonster, HumanGruntAllyHead, HumanGruntAllyWeapon) size(-16 -16 0, 16 16 72) studio("models/hgrunt_opfor.mdl") = monster_human_grunt_ally : "Human Grunt Ally (camo)"
53345380
[
53355381
sequence(Choices) : "Animation Sequence (editor)" : 7 =
53365382
[
@@ -5415,35 +5461,9 @@
54155461
32 : "SquadLeader" : 0
54165462
1024: "Don't Drop Gun" : 0
54175463
]
5418-
5419-
weapons(Choices) : "Weapons" : 3 =
5420-
[
5421-
0 : "None"
5422-
1 : "9mmAR"
5423-
3 : "9mmAR + HG"
5424-
5 : "9mmAR + GL"
5425-
8 : "Shotgun"
5426-
10 : "Shotgun + HG"
5427-
16 : "Saw"
5428-
18 : "Saw + HG"
5429-
]
5430-
5431-
head(Choices) : "Heads" : -1 =
5432-
[
5433-
-2 : "Random"
5434-
-1 : "Default"
5435-
0 : "Gas Mask"
5436-
1 : "Beret"
5437-
2 : "Ops Mask"
5438-
3 : "Bandana White"
5439-
4 : "Bandana Black"
5440-
5 : "MP"
5441-
6 : "Major"
5442-
7 : "Beret (Black)"
5443-
]
54445464
]
54455465

5446-
@PointClass base(Repel, Sequence, CustomSentences) size(-16 -16 0, 16 16 72) studio("models/hgrunt_opfor.mdl") = monster_grunt_ally_repel : "Human Grunt Ally (Repel)"
5466+
@PointClass base(Repel, HumanGruntAllyHead, HumanGruntAllyWeapon, CustomSentences) size(-16 -16 0, 16 16 72) studio("models/hgrunt_opfor.mdl") = monster_grunt_ally_repel : "Human Grunt Ally (Repel)"
54475467
[
54485468
sequence(Choices) : "Animation Sequence (editor)" : 49 =
54495469
[
@@ -5526,32 +5546,9 @@
55265546
1024: "Don't Drop Gun" : 0
55275547
]
55285548
netname(string) : "Squad Name"
5529-
weapons(Choices) : "Weapons" : 3 =
5530-
[
5531-
1 : "9mmAR"
5532-
3 : "9mmAR + HG"
5533-
5 : "9mmAR + GL"
5534-
8 : "Shotgun"
5535-
10 : "Shotgun + HG"
5536-
16 : "Saw"
5537-
18 : "Saw + HG"
5538-
]
5539-
head(Choices) : "Heads" : -1 =
5540-
[
5541-
-2 : "Random"
5542-
-1 : "Default"
5543-
0 : "Gas Mask"
5544-
1 : "Beret"
5545-
2 : "Ops Mask"
5546-
3 : "Bandana White"
5547-
4 : "Bandana Black"
5548-
5 : "MP"
5549-
6 : "Major"
5550-
7 : "Beret (Black)"
5551-
]
55525549
]
55535550

5554-
@PointClass base(DeadMonster) size(-16 -16 0, 16 16 72) studio("models/hgrunt_opfor.mdl") = monster_human_grunt_ally_dead : "Dead Human Grunt Ally"
5551+
@PointClass base(DeadMonster, HumanGruntAllyHead) size(-16 -16 0, 16 16 72) studio("models/hgrunt_opfor.mdl") = monster_human_grunt_ally_dead : "Dead Human Grunt Ally"
55555552
[
55565553
sequence(Choices) : "Animation Sequence (editor)" : 40 =
55575554
[
@@ -5581,18 +5578,6 @@
55815578
8 : "Shotgun"
55825579
16 : "Saw"
55835580
]
5584-
head(Choices) : "Heads" : 0 =
5585-
[
5586-
-2 : "Random"
5587-
0 : "Gas Mask"
5588-
1 : "Beret"
5589-
2 : "Ops Mask"
5590-
3 : "Bandana White"
5591-
4 : "Bandana Black"
5592-
5 : "MP"
5593-
6 : "Major"
5594-
7 : "Beret (Black)"
5595-
]
55965581
]
55975582

55985583
@PointClass base(Monster, TalkMonster, Sequence) size(-16 -16 0, 16 16 72) studio("models/hgrunt_medic.mdl") = monster_human_medic_ally : "Medic"

0 commit comments

Comments
 (0)