Skip to content

Commit

Permalink
minor turf reservation fix (tgstation#38935)
Browse files Browse the repository at this point in the history
no longer reserves 1 more height+width than necessary, checks against invalid sizes
  • Loading branch information
silicons authored and ninjanomnom committed Jul 6, 2018
1 parent ac6543b commit b310286
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/modules/mapping/space_management/space_reservation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
SSmapping.reserve_turfs(v)

/datum/turf_reservation/proc/Reserve(width, height, zlevel)
if(width > world.maxx || height > world.maxy)
if(width > world.maxx || height > world.maxy || width < 1 || height < 1)
return FALSE
var/list/avail = SSmapping.unused_turfs["[zlevel]"]
var/turf/BL
Expand All @@ -33,7 +33,7 @@
continue
if(BL.x + width > world.maxx || BL.y + height > world.maxy)
continue
TR = locate(BL.x + width, BL.y + height, BL.z)
TR = locate(BL.x + width - 1, BL.y + height - 1, BL.z)
if(!(TR.flags_1 & UNUSED_RESERVATION_TURF_1))
continue
final = block(BL, TR)
Expand Down

0 comments on commit b310286

Please sign in to comment.