diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 34528960b8..048247c630 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -102,8 +102,14 @@ if ("answerMessage") if (!authenticated(usr)) return - var/answer_index = text2num(params["answer"]) - var/message_index = text2num(params["message"]) + var/answer_index = params["answer"] + var/message_index = params["message"] + + // If either of these aren't numbers, then bad voodoo. + if(!isnum(answer_index) || !isnum(message_index)) + message_admins("[ADMIN_LOOKUPFLW(usr)] provided an invalid index type when replying to a message on [src] [ADMIN_JMP(src)]. This should not happen. Please check with a maintainer and/or consult tgui logs.") + CRASH("Non-numeric index provided when answering comms console message.") + if (!answer_index || !message_index || answer_index < 1 || message_index < 1) return var/datum/comm_message/message = messages[message_index] @@ -156,7 +162,11 @@ if ("deleteMessage") if (!authenticated(usr)) return - var/message_index = text2num(params["message"]) + var/message_index = params["message"] + + if(!isnum(message_index)) + message_admins("[ADMIN_LOOKUPFLW(usr)] provided an invalid index type when deleting a message on [src] [ADMIN_JMP(src)]. This should not happen. Please check with a maintainer and/or consult tgui logs.") + CRASH("Non-numeric index provided when deleting comms console message.") if (!message_index) return LAZYREMOVE(messages, LAZYACCESS(messages, message_index)) diff --git a/code/modules/events/pirates.dm b/code/modules/events/pirates.dm index 0dc4ea1b02..388a4fdac0 100644 --- a/code/modules/events/pirates.dm +++ b/code/modules/events/pirates.dm @@ -66,7 +66,7 @@ SScommunications.send_message(threat_msg,unique = TRUE) /datum/round_event/pirates/proc/answered() - if(threat_msg && threat_msg.answered == 1) + if(threat_msg?.answered == 1) var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_CAR) if(D) if(D.adjust_money(-payoff)) @@ -75,6 +75,8 @@ return else priority_announce("Trying to cheat us? You'll regret this!",sender_override = ship_name) + else if(threat_msg?.answered == 2) + priority_announce("You won't pay? Fine then, we'll take those credits by force!",sender_override = ship_name) if(!shuttle_spawned) spawn_shuttle() else diff --git a/icons/obj/machines/dominator.dmi b/icons/obj/machines/dominator.dmi index 3718fc4f83..1b4622f1fb 100644 Binary files a/icons/obj/machines/dominator.dmi and b/icons/obj/machines/dominator.dmi differ diff --git a/tgui/packages/tgui/interfaces/CommunicationsConsole.js b/tgui/packages/tgui/interfaces/CommunicationsConsole.js index 958111bd7f..a9b07a8f36 100644 --- a/tgui/packages/tgui/interfaces/CommunicationsConsole.js +++ b/tgui/packages/tgui/interfaces/CommunicationsConsole.js @@ -641,7 +641,7 @@ export const PageMessages = (props, context) => { color={message.answered === answerIndex + 1 ? "good" : undefined} key={answerIndex} onClick={message.answered ? undefined : () => act("answerMessage", { - message: messageIndex + 1, + message: parseInt(messageIndex, 10) + 1, answer: answerIndex + 1, })} /> @@ -664,7 +664,7 @@ export const PageMessages = (props, context) => { content="Delete" color="red" onClick={() => act("deleteMessage", { - message: messageIndex + 1, + message: parseInt(messageIndex, 10) + 1, })} /> )}>