ParkourPenguin I post too much
Reputation: 150 Joined: 06 Jul 2014 Posts: 4657
|
Posted: Sun Jul 22, 2018 9:27 am Post subject: |
|
|
The first is copying global (maybe upvalue) variables to local variables. This could be a minor optimization in a critical part of the code.
The second is the closest thing Lua has to a ternary conditional operator. The "and" and "or" operators short-circuit: if the first operand to "and" / "or" evaluates to false / true respectively, the expression will return the first operand and the second operand will not be evaluated.
That code is equivalent to this:
Code: | local newGroup
if IsInRaid() then
newGroup = "raid"
elseif IsInGroup() then
newGroup = "party"
else
newGroup = false
end |
_________________ I don't know where I'm going, but I'll figure it out when I get there.
|
|