Skip to content

Commit

Permalink
Fixing uses of reserved word operator.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jan 17, 2024
1 parent 6866ce9 commit 8e2bd55
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 102 deletions.
6 changes: 3 additions & 3 deletions code/game/machinery/computer/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
// Proc: get_cyborgs()
// Parameters: 1 (operator - mob which is operating the console.)
// Description: Returns NanoUI-friendly list of accessible cyborgs.
/obj/machinery/computer/robotics/proc/get_cyborgs(var/mob/operator)
/obj/machinery/computer/robotics/proc/get_cyborgs(var/mob/operator_mob)
var/list/robots = list()

for(var/mob/living/silicon/robot/R in mob_list)
Expand Down Expand Up @@ -146,11 +146,11 @@
robot["master_ai"] = R.connected_ai ? R.connected_ai.name : "None"
robot["hackable"] = 0
//Antag synths should be able to hack themselves and see their hacked status.
if(operator && isrobot(operator) && (operator.mind.special_role && operator.mind.original == operator) && (operator == R))
if(operator_mob && isrobot(operator_mob) && (operator_mob.mind.special_role && operator_mob.mind.original == operator_mob) && (operator_mob == R))
robot["hacked"] = R.emagged ? 1 : 0
robot["hackable"] = R.emagged? 0 : 1
// Antag AIs know whether linked cyborgs are hacked or not.
if(operator && isAI(operator) && (R.connected_ai == operator) && (operator.mind.special_role && operator.mind.original == operator))
if(operator_mob && isAI(operator_mob) && (R.connected_ai == operator_mob) && (operator_mob.mind.special_role && operator_mob.mind.original == operator_mob))
robot["hacked"] = R.emagged ? 1 : 0
robot["hackable"] = R.emagged? 0 : 1
robots.Add(list(robot))
Expand Down
14 changes: 7 additions & 7 deletions code/modules/modular_computers/NTNet/NTNRC/conversation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var/global/ntnrc_uid = 0
/datum/ntnet_conversation/
var/id = null
var/title = "Untitled Conversation"
var/datum/computer_file/program/chatclient/operator // "Administrator" of this channel. Creator starts as channel's operator,
var/datum/computer_file/program/chatclient/operator_admin // "Administrator" of this channel. Creator starts as channel's operator,
var/list/messages = list()
var/list/clients = list()
var/password
Expand Down Expand Up @@ -35,7 +35,7 @@ var/global/ntnrc_uid = 0
clients.Add(C)
add_status_message("[C.username] has joined the channel.")
// No operator, so we assume the channel was empty. Assign this user as operator.
if(!operator)
if(!operator_admin)
changeop(C)

/datum/ntnet_conversation/proc/remove_client(var/datum/computer_file/program/chatclient/C)
Expand All @@ -45,21 +45,21 @@ var/global/ntnrc_uid = 0
add_status_message("[C.username] has left the channel.")

// Channel operator left, pick new operator
if(C == operator)
operator = null
if(C == operator_admin)
operator_admin = null
if(clients.len)
var/datum/computer_file/program/chatclient/newop = pick(clients)
changeop(newop)


/datum/ntnet_conversation/proc/changeop(var/datum/computer_file/program/chatclient/newop)
if(istype(newop))
operator = newop
operator_admin = newop
add_status_message("Channel operator status transferred to [newop.username].")

/datum/ntnet_conversation/proc/change_title(var/newtitle, var/datum/computer_file/program/chatclient/client)
if(operator != client)
if(operator_admin != client)
return 0 // Not Authorised

add_status_message("[client.username] has changed channel title from [title] to [newtitle]")
title = newtitle
title = newtitle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

var/datum/ntnet_conversation/channel = ntnet_global.get_chat_channel_by_id(active_channel)
var/authed = FALSE
if(channel && ((channel.operator == src) || netadmin_mode))
if(channel && ((channel.operator_admin == src) || netadmin_mode))
authed = TRUE
switch(action)
if("PRG_speak")
Expand Down Expand Up @@ -71,7 +71,7 @@
return
var/datum/ntnet_conversation/C = new /datum/ntnet_conversation()
C.add_client(src)
C.operator = src
C.operator_admin = src
C.title = channel_title
active_channel = C.id
return TRUE
Expand Down Expand Up @@ -172,7 +172,7 @@
var/list/data = list()
data["can_admin"] = can_run(user, FALSE, access_network)
return data

/datum/computer_file/program/chatclient/tgui_data(mob/user)
if(!ntnet_global || !ntnet_global.chat_channels)
return list()
Expand Down Expand Up @@ -218,7 +218,7 @@
"msg" = M
)))
data["messages"] = messages
data["is_operator"] = (channel.operator == src) || netadmin_mode
data["is_operator"] = (channel.operator_admin == src) || netadmin_mode
else
data["clients"] = list()
data["messages"] = list()
Expand All @@ -227,4 +227,4 @@
data["authed"] = FALSE
data["messages"] = list()

return data
return data
8 changes: 4 additions & 4 deletions code/modules/scripting/AST/AST Nodes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ var/global/const/OOP_GROUP = OOP_UNARY + 1 //()
Class: operator
See <Binary Operators> and <Unary Operators> for subtypes.
*/
/node/expression/operator
/node/expression/operator_node
var/node/expression/exp
var/tmp/name
var/tmp/precedence

/node/expression/operator/New()
/node/expression/operator_node/New()
.=..()
if(!src.name) src.name="[src.type]"

/node/expression/operator/ToString()
/node/expression/operator_node/ToString()
return "operator: [name]"

/*
Expand Down Expand Up @@ -124,4 +124,4 @@ var/global/const/OOP_GROUP = OOP_UNARY + 1 //()
src.value=value

/node/expression/value/reference/ToString()
return "ref: [src.value] ([src.value.type])"
return "ref: [src.value] ([src.value.type])"
38 changes: 19 additions & 19 deletions code/modules/scripting/AST/Operators/Binary Operators.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Class: binary
Represents a binary operator in the AST. A binary operator takes two operands (ie x and y) and returns a value.
*/
/node/expression/operator/binary
/node/expression/operator_node/binary
var/node/expression/exp2

////////// Comparison Operators //////////
Expand All @@ -16,47 +16,47 @@
Returns true if x = y.
*/
//
/node/expression/operator/binary/Equal
/node/expression/operator_node/binary/Equal
precedence=OOP_EQUAL

/*
Class: NotEqual
Returns true if x and y aren't equal.
*/
//
/node/expression/operator/binary/NotEqual
/node/expression/operator_node/binary/NotEqual
precedence=OOP_EQUAL

/*
Class: Greater
Returns true if x > y.
*/
//
/node/expression/operator/binary/Greater
/node/expression/operator_node/binary/Greater
precedence=OOP_COMPARE

/*
Class: Less
Returns true if x < y.
*/
//
/node/expression/operator/binary/Less
/node/expression/operator_node/binary/Less
precedence=OOP_COMPARE

/*
Class: GreaterOrEqual
Returns true if x >= y.
*/
//
/node/expression/operator/binary/GreaterOrEqual
/node/expression/operator_node/binary/GreaterOrEqual
precedence=OOP_COMPARE

/*
Class: LessOrEqual
Returns true if x <= y.
*/
//
/node/expression/operator/binary/LessOrEqual
/node/expression/operator_node/binary/LessOrEqual
precedence=OOP_COMPARE


Expand All @@ -67,23 +67,23 @@
Returns true if x and y are true.
*/
//
/node/expression/operator/binary/LogicalAnd
/node/expression/operator_node/binary/LogicalAnd
precedence=OOP_AND

/*
Class: LogicalOr
Returns true if x, y, or both are true.
*/
//
/node/expression/operator/binary/LogicalOr
/node/expression/operator_node/binary/LogicalOr
precedence=OOP_OR

/*
Class: LogicalXor
Returns true if either x or y but not both are true.
*/
//
/node/expression/operator/binary/LogicalXor //Not implemented in nS
/node/expression/operator_node/binary/LogicalXor //Not implemented in nS
precedence=OOP_OR


Expand All @@ -97,7 +97,7 @@
011 & 110 = 010
*/
//
/node/expression/operator/binary/BitwiseAnd
/node/expression/operator_node/binary/BitwiseAnd
precedence=OOP_BIT

/*
Expand All @@ -108,7 +108,7 @@
011 | 110 = 111
*/
//
/node/expression/operator/binary/BitwiseOr
/node/expression/operator_node/binary/BitwiseOr
precedence=OOP_BIT

/*
Expand All @@ -119,7 +119,7 @@
011 xor 110 = 101
*/
//
/node/expression/operator/binary/BitwiseXor
/node/expression/operator_node/binary/BitwiseXor
precedence=OOP_BIT


Expand All @@ -130,45 +130,45 @@
Returns the sum of x and y.
*/
//
/node/expression/operator/binary/Add
/node/expression/operator_node/binary/Add
precedence=OOP_ADD

/*
Class: Subtract
Returns the difference of x and y.
*/
//
/node/expression/operator/binary/Subtract
/node/expression/operator_node/binary/Subtract
precedence=OOP_ADD

/*
Class: Multiply
Returns the product of x and y.
*/
//
/node/expression/operator/binary/Multiply
/node/expression/operator_node/binary/Multiply
precedence=OOP_MULTIPLY

/*
Class: Divide
Returns the quotient of x and y.
*/
//
/node/expression/operator/binary/Divide
/node/expression/operator_node/binary/Divide
precedence=OOP_MULTIPLY

/*
Class: Power
Returns x raised to the power of y.
*/
//
/node/expression/operator/binary/Power
/node/expression/operator_node/binary/Power
precedence=OOP_POW

/*
Class: Modulo
Returns the remainder of x / y.
*/
//
/node/expression/operator/binary/Modulo
/node/expression/operator_node/binary/Modulo
precedence=OOP_MULTIPLY
12 changes: 6 additions & 6 deletions code/modules/scripting/AST/Operators/Unary Operators.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Class: unary
Represents a unary operator in the AST. Unary operators take a single operand (referred to as x below) and return a value.
*/
/node/expression/operator/unary
/node/expression/operator_node/unary
precedence=OOP_UNARY

/*
Expand All @@ -16,7 +16,7 @@
!true = false and !false = true
*/
//
/node/expression/operator/unary/LogicalNot
/node/expression/operator_node/unary/LogicalNot
name="logical not"

/*
Expand All @@ -27,25 +27,25 @@
~10 (decimal 2) = 01 (decimal 1).
*/
//
/node/expression/operator/unary/BitwiseNot
/node/expression/operator_node/unary/BitwiseNot
name="bitwise not"

/*
Class: Minus
Returns -x.
*/
//
/node/expression/operator/unary/Minus
/node/expression/operator_node/unary/Minus
name="minus"

/*
Class: group
A special unary operator representing a value in parentheses.
*/
//
/node/expression/operator/unary/group
/node/expression/operator_node/unary/group
precedence=OOP_GROUP

/node/expression/operator/unary/New(node/expression/exp)
/node/expression/operator_node/unary/New(node/expression/exp)
src.exp=exp
return ..()
Loading

0 comments on commit 8e2bd55

Please sign in to comment.