From f9420418ea8cef81724faf7f180b8283405b2df9 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Fri, 7 Jul 2023 17:56:23 +0100 Subject: [PATCH 1/6] yay --- code/modules/admin/admin_verbs.dm | 11 +++++++++++ code/modules/customitems/item_spawning.dm | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index ba5d52a23f97..131874e0533a 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -393,6 +393,17 @@ var/list/roundstart_mod_verbs = list( prefs.save_preferences() return +/client/proc/claim_donor() + set category = "OOC.Donor" + set name = "Claim Donor Gear" + if(!donator) + to_chat(usr, SPAN_WARNING("You are not a donator. How did you get this?")) + return FALSE + if(!ishuman(mob)) + to_chat(usr, SPAN_WARNING("You need to be a living human to do this.")) + return FALSE + EquipCustomItems(mob) + return TRUE #define MAX_WARNS 3 #define AUTOBANTIME 10 diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 3bf8e5e71f33..4a7512d2928f 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -7,6 +7,15 @@ GLOBAL_LIST_FILE_LOAD(custom_items, "config/custom_items.txt") /proc/EquipCustomItems(mob/living/carbon/human/M) + var/client/donor = M.client + if(!donor.donator) + return FALSE + var/wanted = alert(M, "Do you want to use your donor gear this round?\n\nNote: You may claim your donor gear at a later point.", "Use Donor Gear?", "Yes", "No") + if(wanted != "Yes") + to_chat(M, SPAN_WARNING("You have chosen not to use your donor gear this round. It may be claimed later in the OOC tab.")) + add_verb(donor, /client/proc/claim_donor) + return FALSE + remove_verb(donor, /client/proc/claim_donor) for(var/line in GLOB.custom_items) // split & clean up var/list/Entry = splittext(line, ":") @@ -17,6 +26,7 @@ GLOBAL_LIST_FILE_LOAD(custom_items, "config/custom_items.txt") continue; if(Entry[1] == M.ckey && Entry[2] == M.real_name) + var/list/Paths = splittext(Entry[3], ",") for(var/P in Paths) var/ok = 0 // 1 if the item was placed successfully From c2fa4077ad434ca8b01e553503060f40a2e47970 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Fri, 7 Jul 2023 17:59:25 +0100 Subject: [PATCH 2/6] x --- code/modules/customitems/item_spawning.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 4a7512d2928f..659f03855f70 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -10,7 +10,7 @@ GLOBAL_LIST_FILE_LOAD(custom_items, "config/custom_items.txt") var/client/donor = M.client if(!donor.donator) return FALSE - var/wanted = alert(M, "Do you want to use your donor gear this round?\n\nNote: You may claim your donor gear at a later point.", "Use Donor Gear?", "Yes", "No") + var/wanted = alert(M, "Do you want to use your donor gear this round?\nYou will still receive this prompt if you are a donator without special gear.\n\nNote: You may claim your donor gear at a later point.", "Use Donor Gear?", "Yes", "No") if(wanted != "Yes") to_chat(M, SPAN_WARNING("You have chosen not to use your donor gear this round. It may be claimed later in the OOC tab.")) add_verb(donor, /client/proc/claim_donor) From 802e5437b032874bbc0409456bc39bdc888459b2 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Fri, 7 Jul 2023 18:04:50 +0100 Subject: [PATCH 3/6] self-policing --- code/modules/admin/admin_verbs.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 131874e0533a..c3eef6363fa0 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -398,6 +398,8 @@ var/list/roundstart_mod_verbs = list( set name = "Claim Donor Gear" if(!donator) to_chat(usr, SPAN_WARNING("You are not a donator. How did you get this?")) + log_debug("[key_name(mob)] attempted to claim donor gear without being on the donor list.") + remove_verb(src, /client/proc/claim_donor)//Little bit of self-policing. return FALSE if(!ishuman(mob)) to_chat(usr, SPAN_WARNING("You need to be a living human to do this.")) From aa07d9cd5bb025bf3b8e3ddf77979df60174589d Mon Sep 17 00:00:00 2001 From: forest2001 Date: Fri, 7 Jul 2023 18:19:12 +0100 Subject: [PATCH 4/6] Forest you overcomplicate things oopsie x --- code/controllers/subsystem/ticker.dm | 2 -- code/modules/client/client_procs.dm | 2 ++ code/modules/customitems/item_spawning.dm | 7 ------- code/modules/mob/new_player/new_player.dm | 1 - 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 0e23b99a9cc2..752d1b5ccae6 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -398,7 +398,6 @@ SUBSYSTEM_DEF(ticker) var/mob/M = J.spawn_in_player(player) if(istype(M)) J.equip_job(M) - EquipCustomItems(M) if(M.client) var/client/C = M.client @@ -428,7 +427,6 @@ SUBSYSTEM_DEF(ticker) captainless = FALSE if(player.job) RoleAuthority.equip_role(player, RoleAuthority.roles_by_name[player.job], late_join = FALSE) - EquipCustomItems(player) if(player.client) var/client/C = player.client if(C.player_data && C.player_data.playtime_loaded && length(C.player_data.playtimes) == 0) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 6926175c835a..b27d72515108 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -436,6 +436,8 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( if(src.ckey == line) src.donator = 1 add_verb(src, /client/proc/set_ooc_color_self) + add_verb(src, /client/proc/claim_donor) + to_chat(src, SPAN_WARNING("If you have special donor gear, you may claim it from the OOC tab.")) //if(prefs.window_skin & TOGGLE_WINDOW_SKIN) // set_night_skin() diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 659f03855f70..110e929600c2 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -8,13 +8,6 @@ GLOBAL_LIST_FILE_LOAD(custom_items, "config/custom_items.txt") /proc/EquipCustomItems(mob/living/carbon/human/M) var/client/donor = M.client - if(!donor.donator) - return FALSE - var/wanted = alert(M, "Do you want to use your donor gear this round?\nYou will still receive this prompt if you are a donator without special gear.\n\nNote: You may claim your donor gear at a later point.", "Use Donor Gear?", "Yes", "No") - if(wanted != "Yes") - to_chat(M, SPAN_WARNING("You have chosen not to use your donor gear this round. It may be claimed later in the OOC tab.")) - add_verb(donor, /client/proc/claim_donor) - return FALSE remove_verb(donor, /client/proc/claim_donor) for(var/line in GLOB.custom_items) // split & clean up diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 9f88f0f9d611..341fc9406396 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -245,7 +245,6 @@ var/mob/living/carbon/human/character = create_character(TRUE) //creates the human and transfers vars and mind RoleAuthority.equip_role(character, RoleAuthority.roles_for_mode[rank], late_join = TRUE) - EquipCustomItems(character) if(security_level > SEC_LEVEL_BLUE || EvacuationAuthority.evac_status) to_chat(character, SPAN_HIGHDANGER("As you stagger out of hypersleep, the sleep bay blares: '[EvacuationAuthority.evac_status ? "VESSEL UNDERGOING EVACUATION PROCEDURES, SELF DEFENSE KIT PROVIDED" : "VESSEL IN HEIGHTENED ALERT STATUS, SELF DEFENSE KIT PROVIDED"]'.")) From ea7d9d7b4523ba8c0ffa45c20d8ac7b2cbff8824 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Fri, 7 Jul 2023 18:36:09 +0100 Subject: [PATCH 5/6] removes char name match --- code/modules/customitems/item_spawning.dm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 110e929600c2..3f0d6863f47b 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -18,9 +18,8 @@ GLOBAL_LIST_FILE_LOAD(custom_items, "config/custom_items.txt") if(Entry.len < 3) continue; - if(Entry[1] == M.ckey && Entry[2] == M.real_name) - - var/list/Paths = splittext(Entry[3], ",") + if(Entry[1] == M.ckey) + var/list/Paths = splittext(Entry[2], ",") for(var/P in Paths) var/ok = 0 // 1 if the item was placed successfully P = trim(P) From 39d75ec95d1431415d20b44c437f04d5447c127a Mon Sep 17 00:00:00 2001 From: forest2001 Date: Fri, 7 Jul 2023 21:19:05 +0100 Subject: [PATCH 6/6] logs/fix --- code/modules/admin/admin_verbs.dm | 2 ++ code/modules/client/client_procs.dm | 2 +- code/modules/customitems/item_spawning.dm | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index c3eef6363fa0..ee8a710cd495 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -404,6 +404,8 @@ var/list/roundstart_mod_verbs = list( if(!ishuman(mob)) to_chat(usr, SPAN_WARNING("You need to be a living human to do this.")) return FALSE + log_game("[key_name(mob)] claimed their donor gear at [get_area_name(mob)].")//No gaming it in the field for free stuff. + mob.attack_log += text("\[[time_stamp()]\] [key_name(mob)] claimed their donor gear at [get_area_name(mob)].") EquipCustomItems(mob) return TRUE diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index b27d72515108..af9e52307b32 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -437,7 +437,7 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( src.donator = 1 add_verb(src, /client/proc/set_ooc_color_self) add_verb(src, /client/proc/claim_donor) - to_chat(src, SPAN_WARNING("If you have special donor gear, you may claim it from the OOC tab.")) + to_chat(src, SPAN_YAUTJABOLDBIG("If you have special donor gear, you may claim it from the OOC tab.")) //if(prefs.window_skin & TOGGLE_WINDOW_SKIN) // set_night_skin() diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 3f0d6863f47b..2d407dcca3d0 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -15,7 +15,7 @@ GLOBAL_LIST_FILE_LOAD(custom_items, "config/custom_items.txt") for(var/i = 1 to Entry.len) Entry[i] = trim(Entry[i]) - if(Entry.len < 3) + if(Entry.len < 2) continue; if(Entry[1] == M.ckey)