Skip to content

Commit

Permalink
Update flamer.dm
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveloopers authored Apr 6, 2024
1 parent 2e408cf commit 01c70fb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions code/modules/projectiles/guns/flamer/flamer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@

var/turf/turfs[] = get_line(user, target, FALSE)
var/turf/first_turf = turfs[1]
var/ammount_to_use = (min(turfs.len, foam_range) * use_multiplier) // the ammount of units that will be drained from the tank
var/ammount_required = (min(turfs.len, foam_range) * use_multiplier) // the ammount of units that this click requires
for(var/turf/turf in turfs)

if(current_mag.reagents.total_volume < ammount_to_use)
foam_range = round(current_mag.reagents.total_volume / use_multiplier)
if(chemical.volume < ammount_required)
foam_range = round(chemical.volume / use_multiplier)

if(distance >= foam_range)
break
Expand All @@ -271,12 +271,12 @@

distance++

// this is likely not needed but I want to be on the safe side
current_mag.reagents.total_volume = clamp(current_mag.reagents.total_volume -= (distance * use_multiplier), 0, current_mag.reagents.maximum_volume)
var/ammount_used = distance * use_multiplier // the actual ammount of units that we used

chemical.volume = clamp(chemical.volume -= (distance * use_multiplier), 0, current_mag.reagents.maximum_volume)
chemical.volume = max(chemical.volume -= ammount_used, 0)
current_mag.reagents.total_volume = chemical.volume // this is needed for show_percentage to work

if(current_mag.reagents.total_volume < use_multiplier) // there aren't enough units left for a single tile of foam, empty the tank
if(chemical.volume < use_multiplier) // there aren't enough units left for a single tile of foam, empty the tank
current_mag.reagents.clear_reagents()

show_percentage(user)
Expand Down

0 comments on commit 01c70fb

Please sign in to comment.