node drones hard deletes (#82927)

i noticed node drones were being hard deleted 60% of the time. its
because the ore vent wasnt cleaning up after them. also fixes some
runtimes if ur id card didnt have a registered account
fix hard deletes
This commit is contained in:
Ben10Omintrix
2024-04-30 15:41:10 +03:00
committed by GitHub
parent ff22a70da1
commit a8d5a8dcc4
@@ -261,6 +261,8 @@
* Also gives xp and mining points to all nearby miners in equal measure.
*/
/obj/structure/ore_vent/proc/handle_wave_conclusion()
SIGNAL_HANDLER
SEND_SIGNAL(src, COMSIG_VENT_WAVE_CONCLUDED)
COOLDOWN_RESET(src, wave_cooldown)
particles = null
@@ -275,7 +277,8 @@
visible_message(span_danger("\the [src] creaks and groans as the mining attempt fails, and the vent closes back up."))
icon_state = initial(icon_state)
update_appearance(UPDATE_ICON_STATE)
return FALSE //Bad end, try again.
node = null
return //Bad end, try again.
for(var/mob/living/miner in range(7, src)) //Give the miners who are near the vent points and xp.
var/obj/item/card/id/user_id_card = miner.get_idcard(TRUE)
@@ -284,9 +287,11 @@
if(!user_id_card)
continue
var/point_reward_val = (MINER_POINT_MULTIPLIER * boulder_size) - MINER_POINT_MULTIPLIER // We remove the base value of discovering the vent
user_id_card.registered_account.mining_points += point_reward_val
user_id_card.registered_account.bank_card_talk("You have been awarded [point_reward_val] mining points for your efforts.")
if(user_id_card.registered_account)
user_id_card.registered_account.mining_points += point_reward_val
user_id_card.registered_account.bank_card_talk("You have been awarded [point_reward_val] mining points for your efforts.")
node.pre_escape() //Visually show the drone is done and flies away.
node = null
add_overlay(mutable_appearance('icons/obj/mining_zones/terrain.dmi', "well", ABOVE_MOB_LAYER))
/**
@@ -327,8 +332,9 @@
var/obj/item/card/id/user_id_card = user.get_idcard(TRUE)
if(isnull(user_id_card))
return
user_id_card.registered_account.mining_points += (MINER_POINT_MULTIPLIER)
user_id_card.registered_account.bank_card_talk("You've been awarded [MINER_POINT_MULTIPLIER] mining points for discovery of an ore vent.")
if(user_id_card.registered_account)
user_id_card.registered_account.mining_points += (MINER_POINT_MULTIPLIER)
user_id_card.registered_account.bank_card_talk("You've been awarded [MINER_POINT_MULTIPLIER] mining points for discovery of an ore vent.")
return
if(scan_only)
return