Fixed a bug with the player panel

This commit is contained in:
Albert Iordache
2012-01-08 20:42:05 +02:00
parent 59806cb3a7
commit 4a3c17738e

View File

@@ -1890,19 +1890,23 @@
if(istype(H.wear_id, /obj/item/device/pda)) if(istype(H.wear_id, /obj/item/device/pda))
var/obj/item/device/pda/PDA = H.wear_id var/obj/item/device/pda/PDA = H.wear_id
if(!isnull(PDA.id)) // The PDA may contain no ID
id = PDA.id // The ID is contained inside the PDA id = PDA.id // The ID is contained inside the PDA
else
id = H.wear_id
if(!id) else
usr << "<font color=red>ERROR:</font> Inform the coders that an [H.name] had wear_id but no ID on their ID slot." id = H.wear_id // The ID was on the ID slot
dat += "<td><font color=red>ERROR</font></td>"
else if(isnull(id.assignment)) if(!id) // Happens when there's no ID in the PDA located on the wear_id slot
usr << "<font color=red>ERROR:</font> Inform the coders that an [id.name] was checked for its assignment variable." dat += "<td>[M.mind.assigned_role] (No ID)</td>"
else if(isnull(id.assignment)) // Preventing runtime errors blocking the player panel
usr << "<font color=red>ERROR:</font> Inform the coders that an [id.name] was checked for its assignment variable, and it was null."
dat += "<td><font color=red>ERROR</font></td>" dat += "<td><font color=red>ERROR</font></td>"
else else
if(M.mind.assigned_role == id.assignment) // Polymorph if(M.mind.assigned_role == id.assignment) // Polymorph
dat += "<td>[M.mind.assigned_role]</td>" dat += "<td>[M.mind.assigned_role]</td>"
else else
dat += "<td>[M.mind.assigned_role] ([id.assignment])" dat += "<td>[M.mind.assigned_role] ([id.assignment])"