Skip to content

Commit

Permalink
fixes unrelated bug to human AI, also fixes dropped items not being r…
Browse files Browse the repository at this point in the history
…emoved from equipment map
  • Loading branch information
Zonespace27 committed Sep 24, 2024
1 parent 2c72024 commit ab10637
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions code/modules/gear_presets/_select_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ GLOBAL_LIST_INIT(rebel_rifles, list(
var/gunpath = pick(GLOB.rebel_smgs)
var/ammopath = GLOB.rebel_smgs[gunpath]

spawn_weapon(gunpath, ammopath, M, ammo_amount)
spawn_weapon(gunpath, ammopath, M, FALSE, ammo_amount)

return 1

Expand All @@ -643,7 +643,7 @@ GLOBAL_LIST_INIT(rebel_rifles, list(
var/gunpath = pick(GLOB.rebel_shotguns)
var/ammopath = GLOB.rebel_shotguns[gunpath]

spawn_weapon(gunpath, ammopath, M, ammo_amount)
spawn_weapon(gunpath, ammopath, M, FALSE, ammo_amount)

return 1

Expand All @@ -653,7 +653,7 @@ GLOBAL_LIST_INIT(rebel_rifles, list(
var/gunpath = pick(GLOB.rebel_rifles)
var/ammopath = GLOB.rebel_rifles[gunpath]

spawn_weapon(gunpath, ammopath, M, ammo_amount)
spawn_weapon(gunpath, ammopath, M, FALSE, ammo_amount)

return 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

//X.do_click(src, "", list())

brain.unholster_primary()
brain.unholster_primary() // this should eventually have support for melee weapons
//brain.ensure_primary_hand(brain.primary_weapon)
brain.tied_human.do_click(target, "", list())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@
appraise_inventory(slot == "belt", slot == "backpack", slot == "left_pocket", slot == "right_pocket")
break

for(var/id in equipment_map)
for(var/obj/item/item_ref as anything in equipment_map[id])
if(item_ref == dropped)
equipment_map[id] -= item_ref
return

/datum/human_ai_brain/proc/set_primary_weapon(obj/item/weapon/gun/new_gun)
if(primary_weapon)
UnregisterSignal(primary_weapon, COMSIG_PARENT_QDELETING)
Expand Down

0 comments on commit ab10637

Please sign in to comment.