We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4726d82 commit af5a621Copy full SHA for af5a621
Server/Components/NPCs/NPC/npc.cpp
@@ -254,7 +254,14 @@ void NPC::setVelocity(Vector3 velocity, bool update)
254
255
void NPC::setHealth(float health)
256
{
257
- footSync_.HealthArmour.x = health;
+ if (health < 0.0f)
258
+ {
259
+ footSync_.HealthArmour.x = 0.0f;
260
+ }
261
+ else
262
263
+ footSync_.HealthArmour.x = health;
264
265
}
266
267
float NPC::getHealth() const
@@ -264,7 +271,14 @@ float NPC::getHealth() const
271
272
void NPC::setArmour(float armour)
273
- footSync_.HealthArmour.y = armour;
274
+ if (armour < 0.0f)
275
276
+ footSync_.HealthArmour.y = 0.0f;
277
278
279
280
+ footSync_.HealthArmour.y = armour;
281
268
282
269
283
270
284
float NPC::getArmour() const
0 commit comments