Code: Select all
vara = varb = varc;
Moderator: GZDoom Developers
Code: Select all
vara = varb = varc;
Major Cooke wrote:So is things like:
still disabled? Looks like it will be for now especially since what your latest commit about (a = b) = c disallows such things.Code: Select all
vara = varb = varc;
It's not case sensitive. CamelCase is just a convention, you could also write bSHOOTABLE or bShOOtAbLe if you feel inclined to.ZZYZX wrote:Just saw the new runtime flag setting syntax elsewhere, and I have one question.
Why does ZScript Defaults section along with old A_ChangeFlag, A_CheckFlag and CheckFlag use the same notation (uppercase, without prefix) while the new syntax uses camel case with 'b' prefix? Is it case sensitive?
Code: Select all
[6:44 PM] ZZYZX: @Major Cooke why flag. and not flags.
[6:45 PM] ZZYZX: sounds unnatural
[6:45 PM] Major Cooke: Because you're only addressing one flag? :stuck_out_tongue:
[6:46 PM] ZZYZX: but the structure which holds all the flags is called flags?
[6:46 PM] ZZYZX: Usually
[6:46 PM] ZZYZX: Or if it's an enum
[6:46 PM] Major Cooke: But it's not a structure in this case, from what I understand.
[6:46 PM] Major Cooke: They're just a bunch of booleans now.
[6:46 PM] ZZYZX: It's not a structure right now
[6:46 PM] ZZYZX: but
[6:47 PM] ZZYZX: what I propose
[6:47 PM] ZZYZX: Is to move this bunch of booleans into separate substructure
[6:47 PM] ZZYZX: Which would be called flags
[6:47 PM] Major Cooke: I think that's what he was trying to avoid.
[6:47 PM] ZZYZX: so actor.flags.<all flags here>
[6:47 PM] Major Cooke: Ask him
[6:47 PM] ZZYZX: because??
[6:47 PM] Major Cooke: Idk.
[6:47 PM] Major Cooke: Post there.
[6:47 PM] ZZYZX: I mean that's what makes the code clean.
Code: Select all
ThinkerIterator it;
MultiBlockThingsIterator it2;
Objects are always accessed by reference, i.e. any variable you declare is essentially a pointer. Even in C you cannot instantiate an object just like that, although the syntax is different due to the explicitness of pointers.ZZYZX wrote: Also even more unrelated question: do variable assignments work by value or by reference? Say, if I have two objects, and then state that obj1 = obj2 (or say actor1.flags = actor2.flags), what happens?
I like that approach.ZZYZX wrote:actor.flags.SHOOTABLE
Code: Select all
target.flags = tracer.flags
Shall the testing begin, now that this is out of the way?Graf Zahl wrote:Before merging back I'd like to add bit access instructions so that the flags can be done as regular member variables and avoid the error prone bit masking madness that has caused enough problems in the past.