mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
minor turf reservation fix (#38935)
no longer reserves 1 more height+width than necessary, checks against invalid sizes
This commit is contained in:
committed by
yogstation13-bot
parent
98b95ff548
commit
c5868b545e
@@ -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
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user