Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another few random fixes #2634

Merged
merged 1 commit into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/controllers/subsystem/explosion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ SUBSYSTEM_DEF(explosions)
var/throw_dir = L[2]
var/max_range = L[3]
for(var/atom/movable/A in T)
if(!A.anchored && A.move_resist != INFINITY)
if(!QDELETED(A) && !A.anchored && A.move_resist != INFINITY) //NSV13 - also check for QDELETED
var/atom_throw_range = rand(throw_range, max_range)
var/turf/throw_at = get_ranged_target_turf(A, throw_dir, atom_throw_range)
A.throw_at(throw_at, atom_throw_range, EXPLOSION_THROW_SPEED, quickstart = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@

///Is the passed in mob an admin ghost
/proc/IsAdminGhost(var/mob/user)
if(!user) //Are they a mob? Auto interface updates call this with a null src
if(!user || !ismob(user)) //Are they a mob? Auto interface updates call this with a null src //NSV13 - you DO know sending the wrong type is NOT equal to null, RIGHT?
return
if(!user.client) // Do they have a client?
return
Expand Down
4 changes: 3 additions & 1 deletion nsv13/code/game/machinery/computer/_ship.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ GLOBAL_LIST_INIT(computer_beeps, list('nsv13/sound/effects/computer/beep.ogg','n
return ..()

/obj/machinery/computer/ship/Destroy()
. = ..()
for(var/mob/living/M in ui_users)
ui_close(M)
linked?.stop_piloting(M)
linked = null
ui_users = null //drop list to the GC
return ..()

//Viewscreens for regular crew to watch combat
/obj/machinery/computer/ship/viewscreen
Expand Down
3 changes: 2 additions & 1 deletion nsv13/code/game/machinery/computer/helm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
req_one_access = list(ACCESS_SYNDICATE)

/obj/machinery/computer/ship/helm/Destroy()
linked?.helm = null
if(linked && linked.helm == src)
linked.helm = null
return ..()

/obj/machinery/computer/ship/helm/set_position(obj/structure/overmap/OM)
Expand Down
3 changes: 2 additions & 1 deletion nsv13/code/game/machinery/computer/tactical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
circuit = /obj/item/circuitboard/computer/ship/tactical_computer

/obj/machinery/computer/ship/tactical/Destroy()
linked?.tactical = null
if(linked && linked.tactical == src)
linked.tactical = null
return ..()

/obj/machinery/computer/ship/tactical/ui_interact(mob/user, datum/tgui/ui)
Expand Down
15 changes: 12 additions & 3 deletions nsv13/code/modules/overmap/overmap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
var/backward_maxthrust = 3
var/side_maxthrust = 1
var/mass = MASS_SMALL //The "mass" variable will scale the movespeed according to how large the ship is.
var/landing_gear = FALSE //Allows you to move in atmos without scraping the hell outta your ship

var/bump_impulse = 0.6
var/bounce_factor = 0.7 // how much of our velocity to keep on collision
Expand All @@ -118,8 +117,18 @@
var/list/beacons_in_ship = list()

// Controlling equipment
var/obj/machinery/computer/ship/helm //Relay beeping noises when we act
var/obj/machinery/computer/ship/tactical

/*
These are probably more okay not being lists since only one person can control either of these two slots at a time.
*/
var/obj/machinery/computer/ship/helm/helm //Relay beeping noises when we act
var/obj/machinery/computer/ship/tactical/tactical

/*
|| THIS SHOULD BE A LIST, there could be a billion dradises that can keep fighting for which one is considered the ship dradis any time someone interacts with one!!!
|| When you change this, also change the reference cleaning on del for this var from being on the dradis to being on the ship listening for the console's QDEL signal.
\/ I'm not feeling like refactoring that right now though. Maybe in the future. -Delta
*/
var/obj/machinery/computer/ship/dradis/dradis //So that pilots can check the radar easily

// Ship weapons
Expand Down
3 changes: 3 additions & 0 deletions nsv13/code/modules/overmap/physics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,9 @@ This proc is to be used when someone gets stuck in an overmap ship, gauss, WHATE
if(isovermap(proj.homing_target))
var/obj/structure/overmap/overmap_target = proj.homing_target
overmap_target.on_missile_lock(src, proj)

LAZYINITLIST(proj.impacted) //The spawn call after this might be causing some issues so the list should exist before async actions.

spawn()
proj.preparePixelProjectileOvermap(target, src, null, round((rand() - 0.5) * proj.spread), lateral=lateral)
proj.fire()
Expand Down
5 changes: 5 additions & 0 deletions nsv13/code/modules/overmap/radar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ Called by add_sensor_profile_penalty if remove_in is used.
if(beacon)
. += "<span class='sciradio'>It's currently linked to [beacon] in [get_area(beacon)]. You can use a multitool to switch whether it delivers here, or to your cargo bay.</span>"

/obj/machinery/computer/ship/dradis/Destroy()
if(linked && linked.dradis == src)
linked.dradis = null //clean ref. Usually the ship would register this deleting and handle the del there instead, but overmap reference code is so decentralized I am not refactoring that right now.
return ..()

/obj/machinery/computer/ship/dradis/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/supplypod_beacon))
var/obj/item/supplypod_beacon/sb = W
Expand Down
Loading