fix up some 515+516 compiler issues

This commit is contained in:
Spookerton
2025-07-09 16:51:48 +01:00
parent 4f97866d65
commit 3243478f57
4 changed files with 76 additions and 68 deletions

View File

@@ -172,9 +172,6 @@ Turf and target are separate in case you want to teleport some distance from a t
return 1
return 0
/proc/sign(x)
return x!=0?x/abs(x):0
/proc/getline(atom/M,atom/N)//Ultra-Fast Bresenham Line-Drawing Algorithm
var/px=M.x //starting x
var/py=M.y
@@ -183,8 +180,8 @@ Turf and target are separate in case you want to teleport some distance from a t
var/dy=N.y-py
var/dxabs=abs(dx)//Absolute value of x distance
var/dyabs=abs(dy)
var/sdx=sign(dx) //Sign of x distance (+ or -)
var/sdy=sign(dy)
var/sdx=SIGN(dx) //Sign of x distance (+ or -)
var/sdy=SIGN(dy)
var/x=dxabs>>1 //Counters for steps taken, setting to distance/2
var/y=dyabs>>1 //Bit-shifting makes me l33t. It also makes getline() unnessecarrily fast.
var/j //Generic integer for counting

View File

@@ -29,10 +29,10 @@
error("Invalid hook '/hook/[hook]' called.")
return 0
var/caller = new hook_path
var/hook/instance = new hook_path
var/status = 1
for(var/P in typesof("[hook_path]/proc"))
if(!call(caller, P)(arglist(args)))
if(!call(instance, P)(arglist(args)))
error("Hook '[P]' failed or runtimed.")
status = 0

View File

@@ -161,90 +161,101 @@ LINEN BINS
icon_state = "doublesheetian"
item_state = "sheetian"
/obj/structure/bedsheetbin
name = "linen bin"
desc = "A linen bin. It looks rather cosy."
icon = 'icons/obj/structures.dmi'
icon_state = "linenbin-full"
anchored = 1
var/amount = 20
anchored = TRUE
var/max_amount = 10
var/min_amount
var/amount
var/list/sheets = list()
var/obj/item/hidden = null
var/obj/item/hidden
/obj/structure/bedsheetbin/Destroy()
QDEL_NULL_LIST(sheets)
QDEL_NULL(hidden)
return ..()
/obj/structure/bedsheetbin/Initialize()
. = ..()
amount = max_amount
/obj/structure/bedsheetbin/examine(mob/user, distance, infix, suffix)
. = ..()
if(amount < 1)
if (amount < 1)
. += "There are no bed sheets in the bin."
else if(amount == 1)
else if (amount == 1)
. += "There is one bed sheet in the bin."
else
. += "There are [amount] bed sheets in the bin."
/obj/structure/bedsheetbin/update_icon()
switch(amount)
if(0) icon_state = "linenbin-empty"
if(1 to amount / 2) icon_state = "linenbin-half"
else icon_state = "linenbin-full"
var/scale = clamp((amount / max_amount) * 100, 0, 100)
switch (scale)
if (0)
icon_state = "linenbin-empty"
if (1 to 50)
icon_state = "linenbin-half"
else
icon_state = "linenbin-full"
/obj/structure/bedsheetbin/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/bedsheet))
/obj/structure/bedsheetbin/attackby(obj/item/item, mob/living/user)
if (istype(item, /obj/item/bedsheet))
user.drop_item()
I.loc = src
sheets.Add(I)
item.loc = src
sheets += item
amount++
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
else if(amount && !hidden && I.w_class < ITEMSIZE_LARGE) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
to_chat(user, "<span class='notice'>You put [item] in [src].</span>")
else if (amount && !hidden && item.w_class < ITEMSIZE_LARGE)
user.drop_item()
I.loc = src
hidden = I
to_chat(user, "<span class='notice'>You hide [I] among the sheets.</span>")
/obj/structure/bedsheetbin/attack_hand(mob/user as mob)
if(amount >= 1)
amount--
var/obj/item/bedsheet/B
if(sheets.len > 0)
B = sheets[sheets.len]
sheets.Remove(B)
else
B = new /obj/item/bedsheet(loc)
B.loc = user.loc
user.put_in_hands(B)
to_chat(user, "<span class='notice'>You take [B] out of [src].</span>")
if(hidden)
hidden.loc = user.loc
to_chat(user, "<span class='notice'>[hidden] falls out of [B]!</span>")
hidden = null
item.loc = src
hidden = item
to_chat(user, "<span class='notice'>You hide [item] among the sheets.</span>")
/obj/structure/bedsheetbin/attack_hand(mob/living/user)
if(amount < 1)
return
add_fingerprint(user)
/obj/structure/bedsheetbin/attack_tk(mob/user as mob)
if(amount >= 1)
amount--
var/obj/item/bedsheet/B
if(sheets.len > 0)
B = sheets[sheets.len]
sheets.Remove(B)
var/obj/item/bedsheet/sheet = length(sheets)
if (sheet)
sheet = sheets[sheet]
--sheets.len
else
B = new /obj/item/bedsheet(loc)
B.loc = loc
to_chat(user, "<span class='notice'>You telekinetically remove [B] from [src].</span>")
sheet = new /obj/item/bedsheet
user.put_in_hands(sheet)
to_chat(user, "<span class='notice'>You take [sheet] out of [src].</span>")
if (hidden)
hidden.dropInto(loc)
hidden = null
to_chat(user, "<span class='notice'>[hidden] falls out of [src]!</span>")
update_icon()
if(hidden)
hidden.loc = loc
hidden = null
/obj/structure/bedsheetbin/attack_tk(mob/living/user)
if(amount < 1)
return
add_fingerprint(user)
amount--
var/obj/item/bedsheet/sheet = length(sheets)
if (sheet)
sheet = sheets[sheet]
--sheets.len
else
sheet = new /obj/item/bedsheet
sheet.dropInto(loc)
to_chat(user, "<span class='notice'>You telekinetically remove [sheet] from [src].</span>")
if (hidden)
hidden.dropInto(loc)
hidden = null
to_chat(user, "<span class='notice'>[hidden] falls out of [src]!</span>")
update_icon()

View File

@@ -236,7 +236,7 @@
src.healths.icon_state = "health3"
if(0 to 50)
src.healths.icon_state = "health4"
if(config.health_threshold_dead to 0)
if(-100 to 0)
src.healths.icon_state = "health5"
else
src.healths.icon_state = "health6"