Skip to content

Commit

Permalink
Merge pull request #487 from NataKilar/network-turret-saving
Browse files Browse the repository at this point in the history
Network turret saving
  • Loading branch information
Andrew-Fall authored Jan 11, 2024
2 parents a48b6bd + 3f53e2a commit 3589368
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
10 changes: 7 additions & 3 deletions code/game/machinery/turrets/_turrets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,16 @@
return TOPIC_REFRESH

if(href_list["set_default"])
var/amount = input(user, "Input an angle between [leftmost_traverse] and [rightmost_traverse] degrees. Click cancel to disable default.", "Set Default Bearing", default_bearing) as null|num
var/leftmost_default = leftmost_traverse
var/rightmost_default = rightmost_traverse
if(traverse >= 360)
leftmost_default = 0
rightmost_default = 360
var/amount = input(user, "Input an angle between [leftmost_default] and [rightmost_default] degrees. Click cancel to disable default.", "Set Default Bearing", default_bearing) as null|num
if(isnum(amount))
default_bearing = clamp(amount, leftmost_traverse, rightmost_traverse)
default_bearing = clamp(amount, leftmost_default, rightmost_default)
else
default_bearing = null

return TOPIC_REFRESH

if(href_list["manual_fire"])
Expand Down
2 changes: 2 additions & 0 deletions mods/persistence/_persistence.dme
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
#include "game\machinery\doors\_door.dm"
#include "game\machinery\doors\double.dm"
#include "game\machinery\kitchen\gibber.dm"
#include "game\machinery\turrets\_turrets.dm"
#include "game\machinery\turrets\network_turret.dm"
#include "game\objects\item_materials.dm"
#include "game\objects\obj.dm"
#include "game\objects\effects\effect_system.dm"
Expand Down
11 changes: 11 additions & 0 deletions mods/persistence/game/machinery/turrets/_turrets.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SAVED_VAR(/obj/machinery/turret, enabled)
SAVED_VAR(/obj/machinery/turret, installed_gun)
SAVED_VAR(/obj/machinery/turret, traverse)
SAVED_VAR(/obj/machinery/turret, turning_rate)
SAVED_VAR(/obj/machinery/turret, vision_range)
SAVED_VAR(/obj/machinery/turret, default_bearing)

/obj/machinery/turret/Initialize()
if(persistent_id && istype(installed_gun))
setup_gun()
. = ..()
6 changes: 6 additions & 0 deletions mods/persistence/game/machinery/turrets/network_turret.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SAVED_VAR(/obj/machinery/turret/network, check_access)
SAVED_VAR(/obj/machinery/turret/network, check_weapons)
SAVED_VAR(/obj/machinery/turret/network, check_records)
SAVED_VAR(/obj/machinery/turret/network, check_arrest)
SAVED_VAR(/obj/machinery/turret/network, check_lifeforms)
SAVED_VAR(/obj/machinery/turret/network, logs)

0 comments on commit 3589368

Please sign in to comment.