Skip to content

Commit

Permalink
fix (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
Waselon authored Sep 8, 2024
1 parent f3bfebb commit 75cfd0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions code/game/objects/items/motion_detector.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@

///Prepare the blip to be print on the operator screen
/obj/item/attachable/motiondetector/proc/prepare_blip(mob/target, status)
if(!operator.client)
if(!operator || !operator.client)
return
if(!target) //если мы вызываем метод без target то где то в вышестоящем коде ошибка, но всё же лучше чем ничего
return
Expand All @@ -172,7 +172,7 @@
var/list/actualview = getviewsize(operator.client.view)
var/viewX = actualview[1]
var/viewY = actualview[2]
var/turf/center_view = get_view_center(operator)
var/turf/center_view = get_view_center(operator) ? get_view_center(operator) : get_turf(src)
var/screen_pos_y = target.y - center_view.y + round(viewY * 0.5) + 1
var/dir
if(screen_pos_y < 1)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/modular_armor/attachments/modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@
var/list/actualview = getviewsize(operator.client.view)
var/viewX = actualview[1]
var/viewY = actualview[2]
var/turf/center_view = get_view_center(operator)
var/turf/center_view = get_view_center(operator) ? get_view_center(operator) : get_turf(src)
var/screen_pos_y = target.y - center_view.y + round(viewY * 0.5) + 1
var/dir
if(screen_pos_y < 1)
Expand Down

0 comments on commit 75cfd0b

Please sign in to comment.