fixes a few bugs (#4552)

* fixes

* bitfs

* fix

* fix

* fix

Co-authored-by: VM_USER <VM_USER>
This commit is contained in:
silicons
2022-10-16 17:37:02 -07:00
committed by GitHub
co-authored by VM_USER <VM_USER>
parent 8798504cdc
commit a18f3cb3da
7 changed files with 60 additions and 18 deletions
+1
View File
@@ -40,6 +40,7 @@ DEFINE_BITFIELD(item_flags, list(
BITFIELD(SURGICAL_TOOL),
BITFIELD(IN_STORAGE),
BITFIELD(ITEM_THROW_UNCATCHABLE),
BITFIELD(ITEM_NO_TOOL_ATTACK),
))
//! Flags for the clothing_flags var on /obj/item
+40
View File
@@ -29,6 +29,11 @@
/// use proc
#define SLOT_EQUIP_CHECK_USE_PROC (1<<1)
DEFINE_BITFIELD(slot_equip_checks, list(
BITFIELD(SLOT_EQUIP_CHECK_USE_FLAGS),
BITFIELD(SLOT_EQUIP_CHECK_USE_PROC),
))
//! slot meta inventory_slot_flags flags
/// render on mob
#define INV_SLOT_IS_RENDERED (1<<0)
@@ -49,6 +54,18 @@
/// do not show on strip panel unless it's occupied by an item
#define INV_SLOT_STRIP_ONLY_REMOVES (1<<8)
DEFINE_BITFIELD(inventory_slot_flags, list(
BITFIELD(INV_SLOT_IS_RENDERED),
BITFIELD(INV_SLOT_CONSIDERED_WORN),
BITFIELD(INV_SLOT_ALLOW_RANDOM_ID),
BITFIELD(INV_SLOT_IS_INVENTORY),
BITFIELD(INV_SLOT_HUD_REQUIRES_EXPAND),
BITFIELD(INV_SLOT_IS_ABSTRACT),
BITFIELD(INV_SLOT_IS_STRIPPABLE),
BITFIELD(INV_SLOT_STRIP_SIMPLE_LINK),
BITFIELD(INV_SLOT_STRIP_ONLY_REMOVES),
))
//! slot flags
// Item inventory slot bitmasks.
#define SLOT_OCLOTHING (1<<0)
@@ -73,6 +90,29 @@
// todo: this shouldn't be a slot flag wtf
#define SLOT_HOLSTER (1<<15)
#define SLOT_FLAG_BITFIELDS list( \
BITFIELD(SLOT_OCLOTHING), \
BITFIELD(SLOT_ICLOTHING), \
BITFIELD(SLOT_GLOVES), \
BITFIELD(SLOT_EYES), \
BITFIELD(SLOT_EARS), \
BITFIELD(SLOT_MASK), \
BITFIELD(SLOT_HEAD), \
BITFIELD(SLOT_FEET), \
BITFIELD(SLOT_ID), \
BITFIELD(SLOT_BELT), \
BITFIELD(SLOT_BACK), \
BITFIELD(SLOT_POCKET), \
BITFIELD(SLOT_DENYPOCKET), \
BITFIELD(SLOT_TWOEARS), \
BITFIELD(SLOT_TIE), \
BITFIELD(SLOT_HOLSTER), \
)
DEFINE_BITFIELD(slot_flags, SLOT_FLAG_BITFIELDS)
DEFINE_BITFIELD(slot_flags_required, SLOT_FLAG_BITFIELDS)
DEFINE_BITFIELD(slot_flags_forbidden, SLOT_FLAG_BITFIELDS)
//! legacy
/// Takes 40ds = 4s to strip someone.
#define HUMAN_STRIP_DELAY 4 SECONDS
@@ -228,7 +228,7 @@
playsound(src, W.tool_sound, 100, 1)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
if(do_after(user, 40 * W.tool_speed))
if(do_after(user, 40 * W.tool_speed) && state == 1)
if(!src) return
to_chat(user, "<span class='notice'>You cut the airlock wires.!</span>")
new/obj/item/stack/cable_coil(src.loc, 1)
+1 -1
View File
@@ -198,7 +198,7 @@
* checks if we need something to attach to in a certain slot
*/
/obj/item/proc/equip_check_beltlink(mob/M, slot, mob/user, flags)
if(item_flags & EQUIP_IGNORE_BELTLINK)
if(clothing_flags & EQUIP_IGNORE_BELTLINK)
return TRUE
if(!ishuman(M))
+5 -4
View File
@@ -5,14 +5,15 @@
if(machine && !CanMouseDrop(machine, src))
machine = null
handle_regular_hud_updates()
handle_vision()
handle_light()
if(handle_regular_UI_updates()) // Status & health update, are we dead or alive etc.
handle_disabilities() // eye, ear, brain damages
handle_statuses() //all special effects, stunned, weakened, jitteryness, hallucination, sleeping, etc
handle_regular_hud_updates()
handle_vision()
handle_light()
handle_actions()
update_canmove()
+10 -10
View File
@@ -1,4 +1,4 @@
var/global/list/limb_icon_cache = list()
GLOBAL_LIST_EMPTY(limb_icon_cache)
/obj/item/organ/external/proc/compile_icon()
cut_overlays()
@@ -189,11 +189,11 @@ var/global/list/limb_icon_cache = list()
if(body_hair && islist(h_col) && h_col.len >= 3)
var/cache_key = "[body_hair]-[icon_name]-[h_col[1]][h_col[2]][h_col[3]]"
if(!limb_icon_cache[cache_key])
if(!GLOB.limb_icon_cache[cache_key])
var/icon/I = icon(species.get_icobase(owner), "[icon_name]_[body_hair]")
I.Blend(rgb(h_col[1],h_col[2],h_col[3]), ICON_MULTIPLY)
limb_icon_cache[cache_key] = I
mob_icon.Blend(limb_icon_cache[cache_key], ICON_OVERLAY)
GLOB.limb_icon_cache[cache_key] = I
mob_icon.Blend(GLOB.limb_icon_cache[cache_key], ICON_OVERLAY)
if(model)
icon_cache_key += "_model_[model]"
@@ -209,11 +209,11 @@ var/global/list/limb_icon_cache = list()
if(body_hair && islist(h_col) && h_col.len >= 3)
var/cache_key = "[body_hair]-[icon_name]-[h_col[1]][h_col[2]][h_col[3]]"
if(!limb_icon_cache[cache_key])
if(!GLOB.limb_icon_cache[cache_key])
var/icon/I = icon(species.get_icobase(owner), "[icon_name]_[body_hair]")
I.Blend(rgb(h_col[1],h_col[2],h_col[3]), ICON_MULTIPLY)
limb_icon_cache[cache_key] = I
mob_icon.Blend(limb_icon_cache[cache_key], ICON_OVERLAY)
GLOB.limb_icon_cache[cache_key] = I
mob_icon.Blend(GLOB.limb_icon_cache[cache_key], ICON_OVERLAY)
dir = EAST
icon = mob_icon
@@ -280,9 +280,9 @@ var/list/robot_hud_colours = list("#CFCFCF","#AFAFAF","#8F8F8F","#6F6F6F","#4F4F
// This looks convoluted, but it's this way to avoid icon proc calls.
if(!hud_damage_image)
var/cache_key = "dambase-[icon_cache_key]"
if(!icon_cache_key || !limb_icon_cache[cache_key])
limb_icon_cache[cache_key] = icon(get_icon(), null, SOUTH)
var/image/temp = image(limb_icon_cache[cache_key])
if(!icon_cache_key || !GLOB.limb_icon_cache[cache_key])
GLOB.limb_icon_cache[cache_key] = icon(get_icon(), null, SOUTH)
var/image/temp = image(GLOB.limb_icon_cache[cache_key])
if((robotic < ORGAN_ROBOT) && species)
// Calculate the required colour matrix.
var/r = 0.30 * species.health_hud_intensity
+2 -2
View File
@@ -36,7 +36,7 @@
vital = TRUE
cannot_amputate = TRUE
parent_organ = null
gendered_icon = TRUE
gendered_icon = FALSE
/obj/item/organ/external/diona/groin
name = "fork"
@@ -47,7 +47,7 @@
w_class = ITEMSIZE_LARGE
body_part = LOWER_TORSO
parent_organ = BP_TORSO
gendered_icon = TRUE
gendered_icon = FALSE
/obj/item/organ/external/diona/arm
name = "left upper tendril"