Skip to content

Commit

Permalink
no quadrant safeguard
Browse files Browse the repository at this point in the history
just do damage directly when using take_quadrant hit, if the ship doesn't use armor quadrants. I keep seeing procs that just call take quadrant hit without making sure, so this is going to make some things quite a bit safer.
  • Loading branch information
DeltaFire15 committed Dec 16, 2024
1 parent e5008de commit 0a735c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nsv13/code/modules/overmap/armour/armour_quadrant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@

#define ARMOUR_DING pick('nsv13/sound/effects/ship/freespace2/ding1.wav', 'nsv13/sound/effects/ship/freespace2/ding2.wav', 'nsv13/sound/effects/ship/freespace2/ding3.wav', 'nsv13/sound/effects/ship/freespace2/ding4.wav', 'nsv13/sound/effects/ship/freespace2/ding5.wav')
/**
* Deals damage to a single quadrant, passing overflow damage onto the hull. Discards damage if the ship has no quadrants, do your checks beforehand.
* Deals damage to a single quadrant, passing overflow damage onto the hull. Goes directly to take_damage if the ship has no quadrants.
* * damage = The amount of damage to cause.
* * quadrant = The key of the quadrant in the quadrant list.
*/
/obj/structure/overmap/proc/take_quadrant_hit(damage, quadrant)
if(!quadrant)
return //No.
if(!use_armour_quadrants)
take_damage(damage)
return
if(!armour_quadrants[quadrant])
return //Nonexistent quadrant. Work on your quads bro.
if ( nodamage )
Expand Down

0 comments on commit 0a735c0

Please sign in to comment.