Skip to content

Commit

Permalink
Merge branch 'master' into Command-Area-Remake
Browse files Browse the repository at this point in the history
  • Loading branch information
LC4492 committed Jul 20, 2023
2 parents bf92794 + 1520217 commit 8ad9197
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
17 changes: 17 additions & 0 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,23 @@
var/client/C = usr.client
C?.open_particle_editor(src)

/atom/movable/vv_edit_var(var_name, var_value)
var/static/list/banned_edits = list(NAMEOF_STATIC(src, step_x) = TRUE, NAMEOF_STATIC(src, step_y) = TRUE, NAMEOF_STATIC(src, step_size) = TRUE, NAMEOF_STATIC(src, bounds) = TRUE)
var/static/list/careful_edits = list(NAMEOF_STATIC(src, bound_x) = TRUE, NAMEOF_STATIC(src, bound_y) = TRUE, NAMEOF_STATIC(src, bound_width) = TRUE, NAMEOF_STATIC(src, bound_height) = TRUE)
var/static/list/not_falsey_edits = list(NAMEOF_STATIC(src, bound_width) = TRUE, NAMEOF_STATIC(src, bound_height) = TRUE)
if(banned_edits[var_name])
return FALSE //PLEASE no.
if(careful_edits[var_name] && (var_value % world.icon_size) != 0)
return FALSE
if(not_falsey_edits[var_name] && !var_value)
return FALSE

if(!isnull(.))
datum_flags |= DF_VAR_EDITED
return

return ..()

//when a mob interact with something that gives them a special view,
//check_eye() is called to verify that they're still eligible.
//if they are not check_eye() usually reset the mob's view.
Expand Down
6 changes: 6 additions & 0 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@
VV_DROPDOWN_OPTION(VV_HK_EXPLODE, "Trigger Explosion")
VV_DROPDOWN_OPTION(VV_HK_EMPULSE, "Trigger EM Pulse")

/turf/vv_edit_var(var_name, new_value)
var/static/list/banned_edits = list(NAMEOF_STATIC(src, x), NAMEOF_STATIC(src, y), NAMEOF_STATIC(src, z))
if(var_name in banned_edits)
return FALSE
. = ..()

/turf/ex_act(severity)
return 0

Expand Down
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-3932.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "harryob"
delete-after: True
changes:
- admin: "you can no longer touch bad vars"

0 comments on commit 8ad9197

Please sign in to comment.