mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-29 16:18:35 +01:00
Refactor Move() code
This commit is contained in:
@@ -6,30 +6,28 @@
|
||||
// This might be laggy, comment it out if there are problems.
|
||||
/mob/living/silicon/var/updating = 0
|
||||
|
||||
/mob/living/silicon/robot/Move()
|
||||
var/oldLoc = src.loc
|
||||
/mob/living/silicon/robot/Moved(atom/old_loc, direction, forced = FALSE)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(provides_camera_vision())
|
||||
if(!updating)
|
||||
updating = 1
|
||||
spawn(BORG_CAMERA_BUFFER)
|
||||
if(oldLoc != src.loc)
|
||||
cameranet.updatePortableCamera(src.camera)
|
||||
updating = 0
|
||||
if(!provides_camera_vision())
|
||||
return
|
||||
if(!updating)
|
||||
updating = 1
|
||||
spawn(BORG_CAMERA_BUFFER)
|
||||
if(old_loc != src.loc)
|
||||
cameranet.updatePortableCamera(src.camera)
|
||||
updating = 0
|
||||
|
||||
/mob/living/silicon/AI/Move()
|
||||
var/oldLoc = src.loc
|
||||
/mob/living/silicon/ai/Moved(atom/old_loc, direction, forced = FALSE)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(provides_camera_vision())
|
||||
if(!updating)
|
||||
updating = 1
|
||||
spawn(BORG_CAMERA_BUFFER)
|
||||
if(oldLoc != src.loc)
|
||||
cameranet.updateVisibility(oldLoc, 0)
|
||||
cameranet.updateVisibility(loc, 0)
|
||||
updating = 0
|
||||
if(!provides_camera_vision())
|
||||
return
|
||||
if(!updating)
|
||||
updating = 1
|
||||
spawn(BORG_CAMERA_BUFFER)
|
||||
if(old_loc != src.loc)
|
||||
cameranet.updateVisibility(old_loc, 0)
|
||||
cameranet.updateVisibility(loc, 0)
|
||||
updating = 0
|
||||
|
||||
#undef BORG_CAMERA_BUFFER
|
||||
|
||||
|
||||
@@ -4,18 +4,17 @@
|
||||
|
||||
/mob/living/var/updating_cult_vision = 0
|
||||
|
||||
/mob/living/Move()
|
||||
var/oldLoc = src.loc
|
||||
/mob/living/Moved(atom/old_loc, direction, forced = FALSE)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(cultnet.provides_vision(src))
|
||||
if(!updating_cult_vision)
|
||||
updating_cult_vision = 1
|
||||
spawn(CULT_UPDATE_BUFFER)
|
||||
if(oldLoc != src.loc)
|
||||
cultnet.updateVisibility(oldLoc, 0)
|
||||
cultnet.updateVisibility(loc, 0)
|
||||
updating_cult_vision = 0
|
||||
if(!cultnet.provides_vision(src))
|
||||
return
|
||||
if(!updating_cult_vision)
|
||||
updating_cult_vision = 1
|
||||
spawn(CULT_UPDATE_BUFFER)
|
||||
if(old_loc != src.loc)
|
||||
cultnet.updateVisibility(old_loc, 0)
|
||||
cultnet.updateVisibility(loc, 0)
|
||||
updating_cult_vision = 0
|
||||
|
||||
#undef CULT_UPDATE_BUFFER
|
||||
|
||||
|
||||
Reference in New Issue
Block a user