From 5606233ad63574874103ea0dc0f7c4087cdae6ec Mon Sep 17 00:00:00 2001
From: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com>
Date: Fri, 6 Sep 2024 00:16:11 +0000
Subject: [PATCH 1/7] Automatic changelog compile [ci skip]
---
html/changelog.html | 6 ------
1 file changed, 6 deletions(-)
diff --git a/html/changelog.html b/html/changelog.html
index a7edadd9339..aec509027e6 100644
--- a/html/changelog.html
+++ b/html/changelog.html
@@ -113,12 +113,6 @@
Pockets-byte updated:
Added new fighter sprite and fighter with shields
Added new fighter weapon and sprite
-
- 05 July 2024
- Pockets-byte updated:
-
- - Added relayed (overmap) laser projectiles for boom
-
GoonStation 13 Development Team
From 969a62f18cd3585b6cd1a8053d479b6b1b63d720 Mon Sep 17 00:00:00 2001
From: DeltaFire <46569814+DeltaFire15@users.noreply.github.com>
Date: Fri, 6 Sep 2024 19:17:19 +0200
Subject: [PATCH 2/7] Sabre insanity, also known as one proc adjustment that
might possibly fix stuff (now includes ~300% more proc adjustments) (#2666)
---
.../code/controllers/subsystem/starsystem.dm | 11 ++++++---
nsv13/code/modules/overmap/FTL/ftl_jump.dm | 23 +++++++++++++++----
.../overmap/fighters/fighters_launcher.dm | 19 +++++++++++----
nsv13/code/modules/overmap/overmap.dm | 17 ++++++++++++++
.../modules/overmap/weapons/plasma_gun.dm | 4 +++-
5 files changed, 61 insertions(+), 13 deletions(-)
diff --git a/nsv13/code/controllers/subsystem/starsystem.dm b/nsv13/code/controllers/subsystem/starsystem.dm
index 0a4f35dde2e..366242bf860 100644
--- a/nsv13/code/controllers/subsystem/starsystem.dm
+++ b/nsv13/code/controllers/subsystem/starsystem.dm
@@ -253,6 +253,7 @@ Returns a faction datum by its name (case insensitive!)
if(sys.name == id)
return sys
+///AVOID using this if possible, go by the objects current_system var if you can. Do not trust the weird ships[] list unless you HAVE to (e.g. you haven't set the system yet)
/datum/controller/subsystem/star_system/proc/find_system(obj/O) //Used to determine what system a ship is currently in. Famously used to determine the starter system that you've put the ship in.
var/datum/star_system/system
if(isovermap(O))
@@ -355,9 +356,13 @@ Returns a faction datum by its name (case insensitive!)
highestTickets = F.tickets
return winner
-/datum/controller/subsystem/star_system/proc/add_ship(obj/structure/overmap/OM, turf/target)
+/datum/controller/subsystem/star_system/proc/add_ship(obj/structure/overmap/OM, turf/target, datum/star_system/system_override)
ships[OM] = list("ship" = OM, "x" = 0, "y" = 0, "current_system" = system_by_id(OM.starting_system), "last_system" = system_by_id(OM.starting_system), "target_system" = null, "from_time" = 0, "to_time" = 0, "occupying_z" = OM.z)
- var/datum/star_system/curr = ships[OM]["current_system"]
+ var/datum/star_system/curr
+ if(!system_override)
+ curr = ships[OM]["current_system"]
+ else
+ curr = system_override
curr.add_ship(OM, target)
//Welcome to bracket hell.
@@ -675,7 +680,7 @@ Returns a faction datum by its name (case insensitive!)
for(var/mob/M in OM.mobs_in_ship)
M?.client?.color = null
if(dist <= 2)
- OM.current_system?.remove_ship(OM)
+ OM.current_system?.remove_ship(OM, is_ftl_jump = FALSE)
for(var/area/crushed as() in OM.linked_areas)
if(istype(crushed, /area/space))
continue
diff --git a/nsv13/code/modules/overmap/FTL/ftl_jump.dm b/nsv13/code/modules/overmap/FTL/ftl_jump.dm
index 8fd06aa7043..08cbd3547fd 100644
--- a/nsv13/code/modules/overmap/FTL/ftl_jump.dm
+++ b/nsv13/code/modules/overmap/FTL/ftl_jump.dm
@@ -81,7 +81,7 @@
contents_positions = null
contents_positions = list()
-/datum/star_system/proc/remove_ship(obj/structure/overmap/OM, turf/new_location)
+/datum/star_system/proc/remove_ship(obj/structure/overmap/OM, turf/new_location, is_ftl_jump = TRUE)
var/list/other_player_ships = list()
for(var/atom/X in system_contents)
if(istype(X, /obj/structure/overmap))
@@ -95,7 +95,8 @@
OM.reserved_z = temp
OM.forceMove(new_location ? new_location : locate(OM.x, OM.y, OM.reserved_z)) //Annnd actually kick them out of the current system.
system_contents -= OM
- ftl_pull_small_craft(OM)
+ if(is_ftl_jump)
+ ftl_pull_small_craft(OM)
return //Early return here. This means that another player ship is already holding the system, and we really don't need to double-check for this.
OM.forceMove(new_location ? new_location : locate(OM.x, OM.y, OM.reserved_z)) //Annnd actually kick them out of the current system.
@@ -104,16 +105,28 @@
if(!OM.reserved_z) //If this isn't actually a big ship with its own interior, do not pull ships, as only those get their own reserved z.
return
if(other_player_ships.len) //There's still other ships here, only pull ships of our own faction.
- ftl_pull_small_craft(OM)
+ if(is_ftl_jump)
+ ftl_pull_small_craft(OM)
return
+
for(var/atom/movable/X in system_contents) //Do a last check for safety so we don't stasis a player ship that slid by our other checks somehow.
if(istype(X, /obj/structure/overmap))
var/obj/structure/overmap/ship = X
if(ship != OM && ship.reserved_z) //If there's somehow a player ship in the system that is somehow not in other_player_ships, emergency return.
message_admins("Somehow [ship] got by the initial checks for system exits. This probably shouldn't happen, yell at a coder and / or check ftl.dm")
- ftl_pull_small_craft(OM)
+ if(is_ftl_jump)
+ ftl_pull_small_craft(OM)
return
- ftl_pull_small_craft(OM, FALSE)
+ if(is_ftl_jump)
+ ftl_pull_small_craft(OM, FALSE)
+ else //We are leaving the overmap while holding system and with no other current holders, which risks nullspacing
+ for(var/obj/structure/overmap/last_chance in system_contents)
+ if(!last_chance.spec_pre_system_unload())
+ continue
+ last_chance.reserved_z = OM.reserved_z //We are about to nullspace something that should preserve z. Hand over your z instead.
+ OM.reserved_z = null
+ return
+
for(var/atom/movable/X in system_contents)
contents_positions[X] = list("x" = X.x, "y" = X.y) //Cache the ship's position so we can regenerate it later.
X.moveToNullspace() //Anything that's an NPC should be stored safely in nullspace until we return.
diff --git a/nsv13/code/modules/overmap/fighters/fighters_launcher.dm b/nsv13/code/modules/overmap/fighters/fighters_launcher.dm
index 4faa951073e..2417666ffec 100644
--- a/nsv13/code/modules/overmap/fighters/fighters_launcher.dm
+++ b/nsv13/code/modules/overmap/fighters/fighters_launcher.dm
@@ -267,9 +267,20 @@
speed_limit = 20 //Let them accelerate to hyperspeed due to the launch, and temporarily break the speed limit.
addtimer(VARSET_CALLBACK(src, speed_limit, initial(speed_limit)), 5 SECONDS) //Give them 5 seconds of super speed mode before we take it back from them
-/obj/structure/overmap/small_craft/proc/handle_moved()
+/obj/structure/overmap/small_craft/proc/handle_moved() //Sooo we call this every single tile we move. Is there no better way? (There probably is)
+ //SIGNAL_HANDLER //This should be a signal handler but the proc it calls sleeps and I am not asyncing *this*.
check_overmap_elegibility()
+
+/*
+Welcome to the "uh oh" zone because fighters travelling from and to overmaps is a bit volatile.
+Last time things broke it was caused by d), but if small ship docking starts being weird again, check these four possible weak points first:
+a) something is being weird with the reserved_z of the fighter being used.
+b) asteroid reserved areas for their zs are not being handled properly.
+c) something is being odd with the last overmap var.
+d) the ships[] list of ssstarsystem is acting up again.
+*/
+
/obj/structure/overmap/small_craft/proc/check_overmap_elegibility(ignore_position = FALSE, ignore_cooldown = FALSE) //What we're doing here is checking if the fighter's hitting the bounds of the Zlevel. If they are, we need to transfer them to overmap space.
if(!ignore_position && !is_near_boundary())
return FALSE
@@ -305,7 +316,7 @@
get_reserved_z()
if(current_system) // No I can't use ?, because if it's null we use the previous value instead
starting_system = current_system.name //Just fuck off it works alright?
- SSstar_system.add_ship(src, get_turf(OM))
+ SSstar_system.add_ship(src, get_turf(OM), current_system)
if(current_system && !LAZYFIND(current_system.system_contents, src))
LAZYADD(current_system.system_contents, src)
@@ -357,8 +368,8 @@
var/turf/T = get_turf(pick(OM.docking_points))
forceMove(T)
if(current_system)
- current_system.remove_ship(src, T)
- OM.overmaps_in_ship |= src
+ current_system.remove_ship(src, T, is_ftl_jump = FALSE)
+ OM.overmaps_in_ship += src
bound_width = initial(bound_width)
bound_height = initial(bound_height)
DC.docking_mode = FALSE
diff --git a/nsv13/code/modules/overmap/overmap.dm b/nsv13/code/modules/overmap/overmap.dm
index 96ac015cb01..6184028ce4e 100644
--- a/nsv13/code/modules/overmap/overmap.dm
+++ b/nsv13/code/modules/overmap/overmap.dm
@@ -537,9 +537,12 @@ Proc to spool up a new Z-level for a player ship and assign it a treadmill.
M.forceMove(T)
M.apply_damage(200)
kill_boarding_level()
+ if(current_system)
+ current_system.remove_ship(src, is_ftl_jump = FALSE) //bit risky call since we already do some things before but probably should still work.
if(reserved_z)
free_treadmills += reserved_z
reserved_z = null
+ current_system = null //I'm not sure why we never dropped this variable.
return ..()
/obj/structure/overmap/forceMove(atom/destination)
@@ -975,3 +978,17 @@ Proc to spool up a new Z-level for a player ship and assign it a treadmill.
var/_z = pick_n_take(free_treadmills)
reserved_z = _z
return reserved_z
+
+///Special proc called right before a system is nullspaced and a last chance to assume a z. Returns TRUE if the ship should not be unloaded.
+/obj/structure/overmap/proc/spec_pre_system_unload()
+ if(!ai_controlled && length(mobs_in_ship))
+ return TRUE
+ return FALSE
+
+/obj/structure/overmap/small_craft/spec_pre_system_unload()
+ . = ..()
+ if(.)
+ return
+ if(ftl_drive)
+ return TRUE
+ return FALSE
diff --git a/nsv13/code/modules/overmap/weapons/plasma_gun.dm b/nsv13/code/modules/overmap/weapons/plasma_gun.dm
index 98e35f509e1..5fec3945d80 100644
--- a/nsv13/code/modules/overmap/weapons/plasma_gun.dm
+++ b/nsv13/code/modules/overmap/weapons/plasma_gun.dm
@@ -377,7 +377,9 @@
return
var/obj/structure/overmap/target_lock
var/target_distance
- var/datum/star_system/target_system = SSstar_system.find_system(overmap_firer)
+ var/datum/star_system/target_system = overmap_firer.current_system
+ if(!target_system)
+ return
var/list/targets = target_system.system_contents
for(var/obj/structure/overmap/ship in targets)
if(QDELETED(ship) && ship.mass != MASS_TINY) //It destroys itself when its target is destroyed, ignoring destroyed fighters
From ed1f6c218a6cd7868758d0f390667b1e42f10156 Mon Sep 17 00:00:00 2001
From: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com>
Date: Fri, 6 Sep 2024 12:18:01 -0500
Subject: [PATCH 3/7] Automatic changelog generation for PR #2666 [ci skip]
---
html/changelogs/AutoChangeLog-pr-2666.yml | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 html/changelogs/AutoChangeLog-pr-2666.yml
diff --git a/html/changelogs/AutoChangeLog-pr-2666.yml b/html/changelogs/AutoChangeLog-pr-2666.yml
new file mode 100644
index 00000000000..103a521e234
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-2666.yml
@@ -0,0 +1,11 @@
+author: DeltaFire15
+delete-after: true
+changes:
+ - bugfix: Possibly fixes some weird Sabre behavior.
+ - bugfix: Also makes one single gun check of the plasma caster slightly safer.
+ - bugfix: Fixes a weird edge case with docking behavior.
+ - bugfix: Fixes remove_ship() assuming all remove_ship() calls were FTL based.
+ - bugfix: Overmap objects when deleting have remove_ship() called for them (this
+ should mostly only affect z carriers which drop their z or pass it to another
+ ship).
+ - bugfix: Overmap objects that are deleted now drop their current_system var.
From 07a671070ae7e9153de4a5f339f8e4e7fe8aeffd Mon Sep 17 00:00:00 2001
From: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com>
Date: Fri, 6 Sep 2024 18:04:40 +0000
Subject: [PATCH 4/7] Automatic changelog compile [ci skip]
---
html/changelog.html | 11 +++++++++++
html/changelogs/.all_changelog.yml | 10 ++++++++++
html/changelogs/AutoChangeLog-pr-2666.yml | 11 -----------
3 files changed, 21 insertions(+), 11 deletions(-)
delete mode 100644 html/changelogs/AutoChangeLog-pr-2666.yml
diff --git a/html/changelog.html b/html/changelog.html
index aec509027e6..592e7a59aa1 100644
--- a/html/changelog.html
+++ b/html/changelog.html
@@ -56,6 +56,17 @@
-->
+
06 September 2024
+
DeltaFire15 updated:
+
+ - Possibly fixes some weird Sabre behavior.
+ - Also makes one single gun check of the plasma caster slightly safer.
+ - Fixes a weird edge case with docking behavior.
+ - Fixes remove_ship() assuming all remove_ship() calls were FTL based.
+ - Overmap objects when deleting have remove_ship() called for them (this should mostly only affect z carriers which drop their z or pass it to another ship).
+ - Overmap objects that are deleted now drop their current_system var.
+
+
24 August 2024
DeltaFire15 updated:
diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml
index fb622fc6cea..d47dc401f49 100644
--- a/html/changelogs/.all_changelog.yml
+++ b/html/changelogs/.all_changelog.yml
@@ -2136,3 +2136,13 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py.
- tweak: turf changes
- balance: added random ore spawns
- bugfix: pre-beebase objects and turfs
+2024-09-06:
+ DeltaFire15:
+ - bugfix: Possibly fixes some weird Sabre behavior.
+ - bugfix: Also makes one single gun check of the plasma caster slightly safer.
+ - bugfix: Fixes a weird edge case with docking behavior.
+ - bugfix: Fixes remove_ship() assuming all remove_ship() calls were FTL based.
+ - bugfix: Overmap objects when deleting have remove_ship() called for them (this
+ should mostly only affect z carriers which drop their z or pass it to another
+ ship).
+ - bugfix: Overmap objects that are deleted now drop their current_system var.
diff --git a/html/changelogs/AutoChangeLog-pr-2666.yml b/html/changelogs/AutoChangeLog-pr-2666.yml
deleted file mode 100644
index 103a521e234..00000000000
--- a/html/changelogs/AutoChangeLog-pr-2666.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-author: DeltaFire15
-delete-after: true
-changes:
- - bugfix: Possibly fixes some weird Sabre behavior.
- - bugfix: Also makes one single gun check of the plasma caster slightly safer.
- - bugfix: Fixes a weird edge case with docking behavior.
- - bugfix: Fixes remove_ship() assuming all remove_ship() calls were FTL based.
- - bugfix: Overmap objects when deleting have remove_ship() called for them (this
- should mostly only affect z carriers which drop their z or pass it to another
- ship).
- - bugfix: Overmap objects that are deleted now drop their current_system var.
From 81dd6a83712ffdcb22226267c67b38f84a52d0bd Mon Sep 17 00:00:00 2001
From: Bokkiewokkie <43698041+Bokkiewokkie@users.noreply.github.com>
Date: Fri, 6 Sep 2024 22:24:59 +0200
Subject: [PATCH 5/7] Makes asteroids not just replace every turf when
generating ores (#2699)
---
nsv13/code/modules/mining/asteroid.dm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/nsv13/code/modules/mining/asteroid.dm b/nsv13/code/modules/mining/asteroid.dm
index dc6896a7577..6ae18405aab 100644
--- a/nsv13/code/modules/mining/asteroid.dm
+++ b/nsv13/code/modules/mining/asteroid.dm
@@ -130,8 +130,8 @@ GLOBAL_LIST_EMPTY(asteroid_spawn_markers) //handles mining asteroids, kind of s
center = T
else
center = locate(T.x+(width/2), T.y+(height/2), T.z)
- for(var/turf/target_turf as() in RANGE_TURFS(rand(3,5), center)) //Give that boi a nice core.
- if(prob(85)) //Bit of random distribution
+ for(var/turf/closed/mineral/target_turf as() in RANGE_TURFS(rand(4,6), center)) //Give that boi a nice core.
+ if(prob(80)) //Bit of random distribution
var/turf_type = pick(core_composition)
target_turf.ChangeTurf(turf_type) //Make the core itself
// add boundaries
From eb2eb012562e22dc35c23b86e5eb4a7dd9fcc35b Mon Sep 17 00:00:00 2001
From: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com>
Date: Fri, 6 Sep 2024 15:25:38 -0500
Subject: [PATCH 6/7] Automatic changelog generation for PR #2699 [ci skip]
---
html/changelogs/AutoChangeLog-pr-2699.yml | 4 ++++
1 file changed, 4 insertions(+)
create mode 100644 html/changelogs/AutoChangeLog-pr-2699.yml
diff --git a/html/changelogs/AutoChangeLog-pr-2699.yml b/html/changelogs/AutoChangeLog-pr-2699.yml
new file mode 100644
index 00000000000..eee0ab43bac
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-2699.yml
@@ -0,0 +1,4 @@
+author: Bokkiewokkie
+delete-after: true
+changes:
+ - tweak: Changed asteroid ore spawning to respect asteroid maps more
From 71d251ba33315d43930a1748d064b3630eed29b4 Mon Sep 17 00:00:00 2001
From: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com>
Date: Fri, 6 Sep 2024 21:03:48 +0000
Subject: [PATCH 7/7] Automatic changelog compile [ci skip]
---
html/changelog.html | 4 ++++
html/changelogs/.all_changelog.yml | 2 ++
html/changelogs/AutoChangeLog-pr-2699.yml | 4 ----
3 files changed, 6 insertions(+), 4 deletions(-)
delete mode 100644 html/changelogs/AutoChangeLog-pr-2699.yml
diff --git a/html/changelog.html b/html/changelog.html
index 592e7a59aa1..af8c4df6db6 100644
--- a/html/changelog.html
+++ b/html/changelog.html
@@ -57,6 +57,10 @@
06 September 2024
+
Bokkiewokkie updated:
+
+ - Changed asteroid ore spawning to respect asteroid maps more
+
DeltaFire15 updated:
- Possibly fixes some weird Sabre behavior.
diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml
index d47dc401f49..b4f81691ab5 100644
--- a/html/changelogs/.all_changelog.yml
+++ b/html/changelogs/.all_changelog.yml
@@ -2137,6 +2137,8 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py.
- balance: added random ore spawns
- bugfix: pre-beebase objects and turfs
2024-09-06:
+ Bokkiewokkie:
+ - tweak: Changed asteroid ore spawning to respect asteroid maps more
DeltaFire15:
- bugfix: Possibly fixes some weird Sabre behavior.
- bugfix: Also makes one single gun check of the plasma caster slightly safer.
diff --git a/html/changelogs/AutoChangeLog-pr-2699.yml b/html/changelogs/AutoChangeLog-pr-2699.yml
deleted file mode 100644
index eee0ab43bac..00000000000
--- a/html/changelogs/AutoChangeLog-pr-2699.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-author: Bokkiewokkie
-delete-after: true
-changes:
- - tweak: Changed asteroid ore spawning to respect asteroid maps more