Merge pull request #10867 from VOREStation/Fixes/10787

Fix excessive table merge, convert climbers lazy
This commit is contained in:
Aronai Sieyes
2021-07-04 18:46:28 -04:00
committed by Chompstation Bot
parent 0b9ebd3c6a
commit c30f4c2dbc
5 changed files with 29 additions and 27 deletions

View File

@@ -7,7 +7,7 @@
var/climb_delay = 3.5 SECONDS var/climb_delay = 3.5 SECONDS
var/breakable var/breakable
var/parts var/parts
var/list/climbers = list() var/list/climbers
var/block_turf_edges = FALSE // If true, turf edge icons will not be made on the turf this occupies. var/block_turf_edges = FALSE // If true, turf edge icons will not be made on the turf this occupies.
var/list/connections = list("0", "0", "0", "0") var/list/connections = list("0", "0", "0", "0")
@@ -35,7 +35,7 @@
if(H.species.can_shred(user)) if(H.species.can_shred(user))
attack_generic(user,1,"slices") attack_generic(user,1,"slices")
if(climbers.len && !(user in climbers)) if(LAZYLEN(climbers) && !(user in climbers))
user.visible_message("<span class='warning'>[user.name] shakes \the [src].</span>", \ user.visible_message("<span class='warning'>[user.name] shakes \the [src].</span>", \
"<span class='notice'>You shake \the [src].</span>") "<span class='notice'>You shake \the [src].</span>")
structure_shaken() structure_shaken()
@@ -103,21 +103,21 @@
return return
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>") usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
climbers |= user LAZYDISTINCTADD(climbers, user)
if(!do_after(user,(issmall(user) ? climb_delay * 0.6 : climb_delay))) if(!do_after(user,(issmall(user) ? climb_delay * 0.6 : climb_delay)))
climbers -= user LAZYREMOVE(climbers, user)
return return
if (!can_climb(user, post_climb_check=1)) if (!can_climb(user, post_climb_check=1))
climbers -= user LAZYREMOVE(climbers, user)
return return
usr.forceMove(get_turf(src)) usr.forceMove(get_turf(src))
if (get_turf(user) == get_turf(src)) if (get_turf(user) == get_turf(src))
usr.visible_message("<span class='warning'>[user] climbs onto \the [src]!</span>") usr.visible_message("<span class='warning'>[user] climbs onto \the [src]!</span>")
climbers -= user LAZYREMOVE(climbers, user)
/obj/structure/proc/structure_shaken() /obj/structure/proc/structure_shaken()
for(var/mob/living/M in climbers) for(var/mob/living/M in climbers)
@@ -204,7 +204,7 @@
if(can_visually_connect_to(S)) if(can_visually_connect_to(S))
if(S.can_visually_connect()) if(S.can_visually_connect())
if(propagate) if(propagate)
//S.update_connections() //Not here S.update_connections()
S.update_icon() S.update_icon()
dirs += get_dir(src, S) dirs += get_dir(src, S)

View File

@@ -26,14 +26,14 @@
return return
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>") usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
climbers |= user LAZYDISTINCTADD(climbers, user)
if(!do_after(user,(issmall(user) ? 20 : 34))) if(!do_after(user,(issmall(user) ? 20 : 34)))
climbers -= user LAZYREMOVE(climbers, user)
return return
if(!can_climb(user, post_climb_check=1)) if(!can_climb(user, post_climb_check=1))
climbers -= user LAZYREMOVE(climbers, user)
return return
if(get_turf(user) == get_turf(src)) if(get_turf(user) == get_turf(src))
@@ -42,7 +42,7 @@
usr.forceMove(get_turf(src)) usr.forceMove(get_turf(src))
usr.visible_message("<span class='warning'>[user] climbed over \the [src]!</span>") usr.visible_message("<span class='warning'>[user] climbed over \the [src]!</span>")
climbers -= user LAZYREMOVE(climbers, user)
/obj/structure/fitness/boxing_ropes/can_climb(var/mob/living/user, post_climb_check=0) //Sets it to keep people from climbing over into the next turf if it is occupied. /obj/structure/fitness/boxing_ropes/can_climb(var/mob/living/user, post_climb_check=0) //Sets it to keep people from climbing over into the next turf if it is occupied.
if(!..()) if(!..())
@@ -84,14 +84,14 @@
return return
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>") usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
climbers |= user LAZYDISTINCTADD(climbers, user)
if(!do_after(user,(issmall(user) ? 20 : 34))) if(!do_after(user,(issmall(user) ? 20 : 34)))
climbers -= user LAZYREMOVE(climbers, user)
return return
if(!can_climb(user, post_climb_check=1)) if(!can_climb(user, post_climb_check=1))
climbers -= user LAZYREMOVE(climbers, user)
return return
if(get_turf(user) == get_turf(src)) if(get_turf(user) == get_turf(src))
@@ -100,7 +100,7 @@
usr.forceMove(get_turf(src)) usr.forceMove(get_turf(src))
usr.visible_message("<span class='warning'>[user] climbed over \the [src]!</span>") usr.visible_message("<span class='warning'>[user] climbed over \the [src]!</span>")
climbers -= user LAZYREMOVE(climbers, user)
/obj/structure/fitness/boxing_ropes_bottom/can_climb(var/mob/living/user, post_climb_check=0) /obj/structure/fitness/boxing_ropes_bottom/can_climb(var/mob/living/user, post_climb_check=0)
if(!..()) if(!..())
@@ -143,14 +143,14 @@
return return
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>") usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
climbers |= user LAZYDISTINCTADD(climbers, user)
if(!do_after(user,(issmall(user) ? 20 : 34))) if(!do_after(user,(issmall(user) ? 20 : 34)))
climbers -= user LAZYREMOVE(climbers, user)
return return
if(!can_climb(user, post_climb_check=1)) if(!can_climb(user, post_climb_check=1))
climbers -= user LAZYREMOVE(climbers, user)
return return
if(get_turf(user) == get_turf(src)) if(get_turf(user) == get_turf(src))
@@ -159,7 +159,7 @@
usr.forceMove(get_turf(src)) usr.forceMove(get_turf(src))
usr.visible_message("<span class='warning'>[user] climbed over \the [src]!</span>") usr.visible_message("<span class='warning'>[user] climbed over \the [src]!</span>")
climbers -= user LAZYREMOVE(climbers, user)
/obj/structure/fitness/boxing_turnbuckle/can_climb(var/mob/living/user, post_climb_check=0) /obj/structure/fitness/boxing_turnbuckle/can_climb(var/mob/living/user, post_climb_check=0)
if(!..()) if(!..())

View File

@@ -55,14 +55,14 @@
return return
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>") usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
climbers |= user LAZYDISTINCTADD(climbers, user)
if(!do_after(user,(issmall(user) ? 20 : 34))) if(!do_after(user,(issmall(user) ? 20 : 34)))
climbers -= user LAZYREMOVE(climbers, user)
return return
if(!can_climb(user, post_climb_check=1)) if(!can_climb(user, post_climb_check=1))
climbers -= user LAZYREMOVE(climbers, user)
return return
if(get_turf(user) == get_turf(src)) if(get_turf(user) == get_turf(src))
@@ -71,7 +71,7 @@
usr.forceMove(get_turf(src)) usr.forceMove(get_turf(src))
usr.visible_message("<span class='warning'>[user] climbed over \the [src]!</span>") usr.visible_message("<span class='warning'>[user] climbed over \the [src]!</span>")
climbers -= user LAZYREMOVE(climbers, user)
/obj/structure/ledge/can_climb(var/mob/living/user, post_climb_check=0) /obj/structure/ledge/can_climb(var/mob/living/user, post_climb_check=0)
if(!..()) if(!..())

View File

@@ -286,14 +286,14 @@
return return
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>") usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
climbers |= user LAZYDISTINCTADD(climbers, user)
if(!do_after(user,(issmall(user) ? 20 : 34))) if(!do_after(user,(issmall(user) ? 20 : 34)))
climbers -= user LAZYREMOVE(climbers, user)
return return
if(!can_climb(user, post_climb_check=1)) if(!can_climb(user, post_climb_check=1))
climbers -= user LAZYREMOVE(climbers, user)
return return
if(get_turf(user) == get_turf(src)) if(get_turf(user) == get_turf(src))
@@ -303,7 +303,7 @@
usr.visible_message("<span class='warning'>[user] climbed over \the [src]!</span>") usr.visible_message("<span class='warning'>[user] climbed over \the [src]!</span>")
if(!anchored) take_damage(maxhealth) // Fatboy if(!anchored) take_damage(maxhealth) // Fatboy
climbers -= user LAZYREMOVE(climbers, user)
/obj/structure/railing/can_climb(var/mob/living/user, post_climb_check=0) /obj/structure/railing/can_climb(var/mob/living/user, post_climb_check=0)
if(!..()) if(!..())

View File

@@ -333,6 +333,8 @@ var/list/table_icon_cache = list()
return FALSE return FALSE
if(istype(src,/obj/structure/table/bench) && !istype(S,/obj/structure/table/bench)) if(istype(src,/obj/structure/table/bench) && !istype(S,/obj/structure/table/bench))
return FALSE return FALSE
if(istype(src,/obj/structure/table/rack) && !istype(S,/obj/structure/table/rack))
return FALSE
if(istype(S,/obj/structure/table)) if(istype(S,/obj/structure/table))
return TRUE return TRUE
..() ..()