Skip to content

Commit

Permalink
convert to view
Browse files Browse the repository at this point in the history
  • Loading branch information
Doubleumc committed Nov 26, 2023
1 parent 5ad11b7 commit 43b42c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
18 changes: 4 additions & 14 deletions code/modules/admin/game_master/game_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -209,22 +209,12 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100)

return

if("delete_near_xenos")
if(tgui_alert(ui.user, "Do you want to delete xenos within your view range?", "Confirmation", list("Yes", "No")) != "Yes")
if("delete_xenos_in_view")
if(tgui_alert(ui.user, "Do you want to delete all xenos within your view range?", "Confirmation", list("Yes", "No")) != "Yes")
return

var/turf/current_turf = get_turf(usr)
var/view_min_x = current_turf.x - usr.client.view
var/view_min_y = current_turf.y - usr.client.view
var/view_max_x = current_turf.x + usr.client.view
var/view_max_y = current_turf.y + usr.client.view

for(var/mob/living/carbon/xenomorph/nearby_xeno as anything in GLOB.xeno_mob_list)
var/turf/xeno_turf = get_turf(nearby_xeno)
if(xeno_turf.z != current_turf.z || !ISINRANGE(xeno_turf.x, view_min_x, view_max_x) || !ISINRANGE(xeno_turf.y, view_min_y, view_max_y))
continue

qdel(nearby_xeno)
for(var/mob/living/carbon/xenomorph/viewed_xeno in view(ui.user.client.view))
qdel(viewed_xeno)

return

Expand Down
4 changes: 2 additions & 2 deletions tgui/packages/tgui/interfaces/GameMaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ export const GameMasterSpawningPanel = (props, context) => {
</Stack.Item>
<Stack.Item>
<Button
content="Delete near xenos"
content="Delete viewed xenos"
onClick={() => {
act('delete_near_xenos');
act('delete_xenos_in_view');
}}
/>
</Stack.Item>
Expand Down

0 comments on commit 43b42c0

Please sign in to comment.