Skip to content

Commit

Permalink
minimap_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AndroBetel committed Feb 15, 2024
1 parent 99a6815 commit e3097ae
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
28 changes: 14 additions & 14 deletions code/controllers/subsystem/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ SUBSYSTEM_DEF(minimaps)
/proc/get_tacmap_data_png(faction)
var/list/map_list

if(faction == FACTION_MARINE)
if(faction in FACTION_LIST_HUMANOID )
map_list = GLOB.uscm_flat_tacmap_data
else if(faction == XENO_HIVE_NORMAL)
map_list = GLOB.xeno_flat_tacmap_data
Expand All @@ -402,7 +402,7 @@ SUBSYSTEM_DEF(minimaps)
* * faction: FACTION_MARINE or XENO_HIVE_NORMAL
*/
/proc/get_unannounced_tacmap_data_png(faction)
if(faction == FACTION_MARINE)
if(faction in FACTION_LIST_HUMANOID )
return GLOB.uscm_unannounced_map
else if(faction == XENO_HIVE_NORMAL)
return GLOB.xeno_unannounced_map
Expand All @@ -418,7 +418,7 @@ SUBSYSTEM_DEF(minimaps)
/proc/get_tacmap_data_svg(faction)
var/list/map_list

if(faction == FACTION_MARINE)
if(faction in FACTION_LIST_HUMANOID )
map_list = GLOB.uscm_svg_tacmap_data
else if(faction == XENO_HIVE_NORMAL)
map_list = GLOB.xeno_svg_tacmap_data
Expand All @@ -443,9 +443,9 @@ SUBSYSTEM_DEF(minimaps)
return

var/is_observer = user.faction == FACTION_NEUTRAL && isobserver(user)
if(is_observer || user.faction == FACTION_MARINE)
if(is_observer || user.faction in FACTION_LIST_HUMANOID )

Check warning on line 446 in code/controllers/subsystem/minimap.dm

View workflow job for this annotation

GitHub Actions / Run Linters

ambiguous `||` on left side of an `in`
// Send marine maps
var/datum/flattened_tacmap/latest = get_tacmap_data_png(FACTION_MARINE)
var/datum/flattened_tacmap/latest = get_tacmap_data_png(user.faction)
if(latest)
SSassets.transport.send_assets(user.client, latest.asset_key)
var/datum/flattened_tacmap/unannounced = get_unannounced_tacmap_data_png(FACTION_MARINE)
Expand All @@ -471,7 +471,7 @@ SUBSYSTEM_DEF(minimaps)
* * Returns a boolean value, TRUE if the operation was successful, FALSE if it was not (on cooldown generally).
*/
/datum/tacmap/drawing/proc/distribute_current_map_png(faction)
if(faction == FACTION_MARINE)
if(faction in FACTION_LIST_HUMANOID)
if(!COOLDOWN_FINISHED(GLOB, uscm_flatten_map_icon_cooldown))
return FALSE
COOLDOWN_START(GLOB, uscm_flatten_map_icon_cooldown, flatten_map_cooldown_time)
Expand All @@ -493,7 +493,7 @@ SUBSYSTEM_DEF(minimaps)
if(!client || !client.mob)
continue
var/mob/client_mob = client.mob
if(client_mob.faction == faction)
if(client_mob.faction in FACTION_LIST_HUMANOID )
faction_clients += client
else if(client_mob.faction == FACTION_NEUTRAL && isobserver(client_mob))
faction_clients += client
Expand All @@ -510,7 +510,7 @@ SUBSYSTEM_DEF(minimaps)
var/flat_tacmap_png = SSassets.transport.get_asset_url(flat_tacmap_key)
var/datum/flattened_tacmap/new_flat = new(flat_tacmap_png, flat_tacmap_key)

if(faction == FACTION_MARINE)
if(faction in FACTION_LIST_HUMANOID )
GLOB.uscm_unannounced_map = new_flat
else //if(faction == XENO_HIVE_NORMAL)
GLOB.xeno_unannounced_map = new_flat
Expand All @@ -528,7 +528,7 @@ SUBSYSTEM_DEF(minimaps)
/datum/tacmap/drawing/proc/store_current_svg_coords(faction, svg_coords, ckey)
var/datum/svg_overlay/svg_store_overlay = new(svg_coords, ckey)

if(faction == FACTION_MARINE)
if(faction in FACTION_LIST_HUMANOID )
GLOB.uscm_svg_tacmap_data += svg_store_overlay
else if(faction == XENO_HIVE_NORMAL)
GLOB.xeno_svg_tacmap_data += svg_store_overlay
Expand Down Expand Up @@ -729,7 +729,7 @@ SUBSYSTEM_DEF(minimaps)
old_map = get_tacmap_data_png(faction)
current_svg = get_tacmap_data_svg(faction)

var/use_live_map = faction == FACTION_MARINE && skillcheck(user, SKILL_LEADERSHIP, SKILL_LEAD_EXPERT) || is_xeno
var/use_live_map = skillcheck(user, SKILL_LEADERSHIP, SKILL_LEAD_EXPERT) || is_xeno

if(use_live_map && !map_holder)
var/level = SSmapping.levels_by_trait(targeted_ztrait)
Expand Down Expand Up @@ -807,9 +807,9 @@ SUBSYSTEM_DEF(minimaps)

data["isXeno"] = is_xeno
data["canViewTacmap"] = is_xeno
data["canViewCanvas"] = faction == FACTION_MARINE || faction == XENO_HIVE_NORMAL
data["canViewCanvas"] = faction in FACTION_LIST_HUMANOID || faction == XENO_HIVE_NORMAL

Check warning on line 810 in code/controllers/subsystem/minimap.dm

View workflow job for this annotation

GitHub Actions / Run Linters

ambiguous `=` on left side of an `in`

if(faction == FACTION_MARINE && skillcheck(user, SKILL_LEADERSHIP, SKILL_LEAD_EXPERT) || faction == XENO_HIVE_NORMAL && isqueen(user))
if(skillcheck(user, SKILL_LEADERSHIP, SKILL_LEAD_EXPERT) || faction == XENO_HIVE_NORMAL && isqueen(user))
data["canDraw"] = TRUE
data["canViewTacmap"] = TRUE

Expand Down Expand Up @@ -898,7 +898,7 @@ SUBSYSTEM_DEF(minimaps)
if(!istype(params["image"], /list)) // potentially very serious?
return FALSE

if(faction == FACTION_MARINE)
if(faction in FACTION_LIST_HUMANOID )
GLOB.uscm_flat_tacmap_data += new_current_map
else if(faction == XENO_HIVE_NORMAL)
GLOB.xeno_flat_tacmap_data += new_current_map
Expand All @@ -907,7 +907,7 @@ SUBSYSTEM_DEF(minimaps)
current_svg = get_tacmap_data_svg(faction)
old_map = get_tacmap_data_png(faction)

if(faction == FACTION_MARINE)
if(faction in FACTION_LIST_HUMANOID )
COOLDOWN_START(GLOB, uscm_canvas_cooldown, canvas_cooldown_time)
var/mob/living/carbon/human/human_leader = user
for(var/datum/squad/current_squad in RoleAuthority.squads)
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/devices/radio/headset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@
initial_keys = list(/obj/item/device/encryptionkey/colony)
has_hud = TRUE
hud_type = MOB_HUD_FACTION_UPP
minimap_type = MINIMAP_FLAG_UPP

/obj/item/device/radio/headset/distress/UPP/cct
name = "UPP-CCT headset"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/game_master/game_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100)
if(!object || !z_level)
return

SSminimaps.add_marker(object, z_level, MINIMAP_FLAG_USCM, given_image = background)
SSminimaps.add_marker(object, z_level, MINIMAP_FLAG_ALL, given_image = background)

var/objective_info = tgui_input_text(user, "Objective info?", "Objective Info")

Expand Down
6 changes: 2 additions & 4 deletions code/modules/almayer/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@
/obj/structure/machinery/prop/almayer/CICmap/Initialize()
. = ..()

if (faction == FACTION_MARINE)
map = new /datum/tacmap/drawing(src, minimap_type)
else
map = new(src, minimap_type) // Non-drawing version
map = new /datum/tacmap/drawing(src, minimap_type)


/obj/structure/machinery/prop/almayer/CICmap/Destroy()
QDEL_NULL(map)
Expand Down
3 changes: 2 additions & 1 deletion maps/map_files/chapaev/chapaev.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2747,7 +2747,8 @@
layer = 2.97;
name = "Tactical Map Display";
pixel_x = 7;
faction = "UPP"
faction = "UPP";
minimap_type = 8
},
/obj/structure/machinery/computer/cameras/almayer/vehicle{
pixel_x = -12;
Expand Down

0 comments on commit e3097ae

Please sign in to comment.