Turns the Grenade Satchel into a Belt, plus related changes#12481
Turns the Grenade Satchel into a Belt, plus related changes#12481TheManWithNoHands wants to merge 6 commits into
Conversation
|
does the grenade qol also work for the regular grenade belts riflemen can buy? |
Its for ALL grenade belts. All.. like 3 or so. |
| /obj/item/storage/proc/toggle_lock(obj/item/card/id/card, mob/living/carbon/human/H) | ||
| if(QDELETED(locking_id)) | ||
| to_chat(H, SPAN_NOTICE("You lock \the [src]!")) | ||
| locking_id = card |
There was a problem hiding this comment.
This needs to clear the locking_id reference properly
Either store a WEAKREF() or add it to Destroy on /obj/item/storage then attach a COMSIG_PARENT_QDELETED handler to it
There was a problem hiding this comment.
Aight. Then i'll sit down and learn how those things are used.
I think i did it right?
There was a problem hiding this comment.
Here's what i suggest specifically: Use the WEAKREF() method. Since this is core storage object code, using signals can conflict with other storages use of it.
A weakref allows you to keep track of something without holding it up from being deleted.
- Instead of defining
locking_idas /obj/item/card/id above, you use a /datum/weakref - When you store it, you use WEAKREF :
locking_id = WEAKREF(card) - When you want to check it, you "resolve" it into the real item:
var/obj/item/card/id/card = locking_id?.resolve() - If the result is null, that means the id is gone. That can also replace your
QDELETEDcheck just above this. - In Destroy() you only need to
= nullthe weakref, notQDEL_NULL
If you have more questions about it don't hesitate to reply here or hit me up on discord
|
removed qol changes with grenade packs for atomization |
About the pull request
Explain why it's good for the game
The Grenade Satchel has no real reason to use the backpack slot. It holds about the same in grenades, and while it can hold bigger grenades we just dont have bigger grenades. Its only real diffrence is the ability to lock it. Wich is not worth the backpack slot. So on the belt it goes like its non lockable cousin. This should make the satchel into more then a box sitting at FOB to store your private stash.
How i did that i might have wasted my time by doing a small refactor kinda. (Idunno if that counts)
To not repeat code by having the same id lock code in bags and belts, i put it on their parent. /obj/item/storage.
I think this is the better option, being now you can slap the ID lock function on any storage with 1 var change, but i will undo that and just put it on belts if thats preferd.
I dont think its breaking any item either, i couldnt find any storage item that is messed up because of it.
Testing Photographs and Procedure
Screenshots & Videos
Changelog
🆑NHC
add: Added an ID lockable Grenade Belt
code: Moved the ID lock code from backpacks to its parent, storage
del: Removed the Grenade Satchel
imageadd: added Item and on_mob sprites for the new grenade belt
/:cl: