mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
TG: Cleans up and uses less area checks, relying more on lastarea.
Revision: r2949 Author: VivianFoxfoot
This commit is contained in:
@@ -64,8 +64,9 @@
|
|||||||
item.layer = initial(item.layer)
|
item.layer = initial(item.layer)
|
||||||
src.visible_message("\red [src] has thrown [item].")
|
src.visible_message("\red [src] has thrown [item].")
|
||||||
|
|
||||||
var/area/a = get_area(src.loc)
|
if(!src.lastarea)
|
||||||
if((istype(src.loc, /turf/space)) || (a.has_gravity == 0))
|
src.lastarea = get_area(src.loc)
|
||||||
|
if((istype(src.loc, /turf/space)) || (src.lastarea.has_gravity == 0))
|
||||||
src.inertia_dir = get_dir(target, src)
|
src.inertia_dir = get_dir(target, src)
|
||||||
step(src, inertia_dir)
|
step(src, inertia_dir)
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/turf/Entered(atom/movable/M as mob|obj)
|
/turf/Entered(atom/movable/M as mob|obj)
|
||||||
|
// var/loopsanity = 100
|
||||||
if(ismob(M))
|
if(ismob(M))
|
||||||
if(!M:lastarea)
|
if(!M:lastarea)
|
||||||
M:lastarea = get_area(M.loc)
|
M:lastarea = get_area(M.loc)
|
||||||
|
|||||||
@@ -172,8 +172,10 @@
|
|||||||
//if(istype(mob.loc, /turf/space) || (mob.flags & NOGRAV))
|
//if(istype(mob.loc, /turf/space) || (mob.flags & NOGRAV))
|
||||||
// if(!mob.Process_Spacemove(0)) return 0
|
// if(!mob.Process_Spacemove(0)) return 0
|
||||||
|
|
||||||
var/area/a = get_area(mob.loc)
|
if(!mob.lastarea)
|
||||||
if((istype(mob.loc, /turf/space)) || (a.has_gravity == 0))
|
mob.lastarea = get_area(mob.loc)
|
||||||
|
|
||||||
|
if((istype(mob.loc, /turf/space)) || (mob.lastarea.has_gravity == 0))
|
||||||
if(!mob.Process_Spacemove(0)) return 0
|
if(!mob.Process_Spacemove(0)) return 0
|
||||||
|
|
||||||
|
|
||||||
@@ -352,16 +354,13 @@
|
|||||||
if(istype(turf,/turf/space))
|
if(istype(turf,/turf/space))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
var/area/a = get_area(turf)
|
|
||||||
|
|
||||||
if(istype(src,/mob/living/carbon/human/)) // Only humans can wear magboots, so we give them a chance to.
|
if(istype(src,/mob/living/carbon/human/)) // Only humans can wear magboots, so we give them a chance to.
|
||||||
if((istype(turf,/turf/simulated/floor)) && (a.has_gravity == 0) && !(istype(src:shoes, /obj/item/clothing/shoes/magboots) && (src:shoes:flags & NOSLIP)))
|
if((istype(turf,/turf/simulated/floor)) && (src.lastarea.has_gravity == 0) && !(istype(src:shoes, /obj/item/clothing/shoes/magboots) && (src:shoes:flags & NOSLIP)))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
if((istype(turf,/turf/simulated/floor)) && (a.has_gravity == 0)) // No one else gets a chance.
|
if((istype(turf,/turf/simulated/floor)) && (src.lastarea.has_gravity == 0)) // No one else gets a chance.
|
||||||
continue
|
continue
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
var/starting_loc = pick(newplayer_start)
|
var/starting_loc = pick(newplayer_start)
|
||||||
if(!starting_loc) starting_loc = locate(1,1,1)
|
if(!starting_loc) starting_loc = locate(1,1,1)
|
||||||
loc = starting_loc
|
loc = starting_loc
|
||||||
|
lastarea = starting_loc
|
||||||
|
|
||||||
sight |= SEE_TURFS
|
sight |= SEE_TURFS
|
||||||
|
|
||||||
var/list/watch_locations = list()
|
var/list/watch_locations = list()
|
||||||
|
|||||||
Reference in New Issue
Block a user