Merge pull request #22748 from PaulRitter/cmc_bugfixes

cmc hotfixes
This commit is contained in:
Kurfursten
2019-05-04 01:19:44 -05:00
committed by GitHub

View File

@@ -1,4 +1,19 @@
var/list/cmc_holomap_cache = list()
#define ENTRY_SEE_X 1
#define ENTRY_SEE_Y 2
#define ENTRY_MOB 3
#define ENTRY_NAME 4
#define ENTRY_ASSIGNMENT 5
#define ENTRY_STAT 6
#define ENTRY_DAMAGE 7
#define ENTRY_AREA 8
#define ENTRY_IJOB 9
#define ENTRY_POS 10
#define DAMAGE_OXYGEN 1
#define DAMAGE_TOXIN 2
#define DAMAGE_FIRE 3
#define DAMAGE_BRUTE 4
/*
Crew Monitor by Paul, based on the holomaps by Deity
@@ -194,12 +209,12 @@ Crew Monitor by Paul, based on the holomaps by Deity
var/user_uid = "\ref[user]"
//creating the title with name | job - Dead/Alive
var/title = "[name]" + ((job != "") ? " ([job])" : "") + ((stat == 2) ? " - DEAD" : " - ALIVE")
var/title = "[name]" + ((job != "") ? " ([job])" : "") + ((stat == DEAD) ? " - DEAD" : " - ALIVE")
//creating the content with damage and some css coloring
var/content = "Not Available"
if(damage)
content = "(<span style='color: #0080ff'>[damage[1]]</span>/<span style='color: #00CD00'>[damage[2]]</span>/<span style='color: #ffa500'>[damage[3]]</span>/<span style='color: #ff0000'>[damage[4]]</span>)"
content = "(<span style='color: #0080ff'>[damage[DAMAGE_OXYGEN]]</span>/<span style='color: #00CD00'>[damage[DAMAGE_TOXIN]]</span>/<span style='color: #ffa500'>[damage[DAMAGE_FIRE]]</span>/<span style='color: #ff0000'>[damage[DAMAGE_BRUTE]]</span>)"
content += "<br>[player_area]"
@@ -211,7 +226,7 @@ Crew Monitor by Paul, based on the holomaps by Deity
var/icon
if(istype(H, /mob/living/carbon/human))
if(stat != 2)
if(stat != DEAD)
icon = getLifeIcon(damage)
else
icon = "6"
@@ -322,9 +337,6 @@ Crew Monitor by Paul, based on the holomaps by Deity
//initializes the holomap
/obj/machinery/computer/crew/proc/togglemap(var/mob/user)
if(user.isUnconscious())
return
if(user in _using)
deactivate(user)
to_chat(user, "<span class='notice'>You disable the holomap.</span>")
@@ -369,7 +381,7 @@ Crew Monitor by Paul, based on the holomaps by Deity
//ahhh
/obj/machinery/computer/crew/proc/handle_sanity(var/mob/user)
var/uid = "\ref[user]"
if((!user) || (!user.client) || (!(isobserver(user) || issilicon(user)) && (get_dist(user.loc,src.loc) > 1)) || (holoMiniMaps[holomap_z[uid]] == null))
if((!user) || (!user.client) || (user.isUnconscious() && !isobserver(user)) || (!(isobserver(user) || issilicon(user)) && (get_dist(user.loc,src.loc) > 1)) || (holoMiniMaps[holomap_z[uid]] == null))
return FALSE
return TRUE
@@ -400,8 +412,9 @@ Crew Monitor by Paul, based on the holomaps by Deity
for(var/entry in entries[holomap_z[uid]])
//can only be our z, so i'm not checking that, only if we have a pos
if(entry[1]) addCrewMarker(user, entry[1], entry[2], entry[3], entry[4], entry[5], entry[6], entry[7], entry[8], entry[10])
if(entry[ENTRY_POS])
addCrewMarker(user, entry[ENTRY_SEE_X], entry[ENTRY_SEE_Y], entry[ENTRY_MOB], entry[ENTRY_NAME], entry[ENTRY_ASSIGNMENT], entry[ENTRY_STAT], entry[ENTRY_DAMAGE], entry[ENTRY_AREA], entry[ENTRY_POS])
user.client.images |= holomap_images[uid]
user.client.screen |= holomap_tooltips[uid]
else if(!holomap[uid])
@@ -530,15 +543,15 @@ Crew Monitor by Paul, based on the holomaps by Deity
//adding table rows
for(var/entry in entries[holomap_z[uid]])
var/see_x = entry[1]
var/see_y = entry[2]
var/mob/living/carbon/H = entry[3]
var/name = entry[4]
var/job = entry[5]
var/stat = entry[6]
var/list/damage = entry[7]
var/player_area = entry[8]
var/ijob = entry[9]
var/see_x = entry[ENTRY_SEE_X]
var/see_y = entry[ENTRY_SEE_Y]
var/mob/living/carbon/H = entry[ENTRY_MOB]
var/name = entry[ENTRY_NAME]
var/job = entry[ENTRY_ASSIGNMENT]
var/stat = entry[ENTRY_STAT]
var/list/damage = entry[ENTRY_DAMAGE]
var/player_area = entry[ENTRY_AREA]
var/ijob = entry[ENTRY_IJOB]
var/role
switch(ijob)
@@ -565,7 +578,7 @@ Crew Monitor by Paul, based on the holomaps by Deity
icon = "7"
var/list/string = list("<span class='name [role]'>[name]</span> ([job])")
string += "<img src='cmc_[icon].png' height='11' width='11'/>" + (damage ? "(<span class='oxygen'>[damage[1]]</span>/<span class='toxin'>[damage[2]]</span>/<span class='fire'>[damage[3]]</span>/<span class='brute'>[damage[4]]</span>)" : "Not Available")
string += "<img src='cmc_[icon].png' height='11' width='11'/>" + (damage ? "(<span class='oxygen'>[damage[DAMAGE_OXYGEN]]</span>/<span class='toxin'>[damage[DAMAGE_TOXIN]]</span>/<span class='fire'>[damage[DAMAGE_FIRE]]</span>/<span class='brute'>[damage[DAMAGE_BRUTE]]</span>)" : "Not Available")
string += (see_x && see_y) ? "[player_area] ([see_x],[see_y])" : "Not Available"
var/actualstring = "<td>" + string.Join("</td><td>") + "</td>"
@@ -582,4 +595,19 @@ Crew Monitor by Paul, based on the holomaps by Deity
textview_updatequeued[uid] = 0
if(textview_popup[uid])
textview_popup[uid].close()
textview_popup[uid] = null
textview_popup[uid] = null
#undef ENTRY_SEE_X
#undef ENTRY_SEE_Y
#undef ENTRY_MOB
#undef ENTRY_NAME
#undef ENTRY_ASSIGNMENT
#undef ENTRY_STAT
#undef ENTRY_DAMAGE
#undef ENTRY_AREA
#undef ENTRY_IJOB
#undef ENTRY_POS
#undef DAMAGE_OXYGEN
#undef DAMAGE_TOXIN
#undef DAMAGE_FIRE
#undef DAMAGE_BRUTE