Skip to content

Commit

Permalink
place admins correctly in the middle of their nice new map
Browse files Browse the repository at this point in the history
  • Loading branch information
harryob committed Feb 21, 2024
1 parent b3cd827 commit 040d13a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions code/modules/admin/verbs/load_event_level.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
// Get dims & guesstimate center turf (in practice, current implem means min is always 1)
var/dim_x = boundaries[MAP_MAXX] - boundaries[MAP_MINX] + 1
var/dim_y = boundaries[MAP_MAXY] - boundaries[MAP_MINY] + 1
var/center_x = boundaries[MAP_MINX] + round(dim_x / 2) // Technically off by 0.5 due to above +1. Whatever
var/center_y = boundaries[MAP_MINY] + round(dim_y / 2)

var/prompt = alert(C, "Are you SURE you want to load this template as level ? This is SLOW and can freeze server for a bit. Dimensions are: [dim_x] x [dim_y]", "Template Confirm" ,"Yes","Nope!")
if(prompt != "Yes")
Expand All @@ -40,6 +38,9 @@
to_chat(C, "Failed to load the template to a Z-Level! Sorry!")
return

var/center_x = round(loaded.bounds[MAP_MAXX] / 2) // Technically off by 0.5 due to above +1. Whatever
var/center_y = round(loaded.bounds[MAP_MAXY] / 2)

// Now notify the staff of the load - this goes in addition to the generic template load game log
message_admins("Successfully loaded template as new Z-Level by ckey: [logckey], template name: [template.name]", center_x, center_y, loaded.z_value)
if(isobserver(C?.mob))
Expand Down

0 comments on commit 040d13a

Please sign in to comment.