ID:149180
 
I get some weird code from these 2 procs:

mob/proc/RedTraiCheck()
if(usr.Guild == "Fighters of the Red Order")
if(src.Guild == "Fighters of the Red Order")
usr.Award_Status = 0
usr.Guild == "Fighters of the Black Order")

mob/proc/BlackTraiCheck()
if(usr.Guild == "Fighters of the Black Order")
if(src.Guild == "Fighters of the Black Order")
usr.Award_Status = 0
usr.Guild == "Fighters of the Red Order")

All the errors are flagged in RedTraiCheck(), but that's odd, since it's just the same code mixed around.
Asked and answered in this thread.
Drafonis wrote:
I get some weird code from these 2 procs:

mob/proc/RedTraiCheck()
if(usr.Guild == "Fighters of the Red Order")
if(src.Guild == "Fighters of the Red Order")
usr.Award_Status = 0
usr.Guild == "Fighters of the Black Order")

mob/proc/BlackTraiCheck()
if(usr.Guild == "Fighters of the Black Order")
if(src.Guild == "Fighters of the Black Order")
usr.Award_Status = 0
usr.Guild == "Fighters of the Red Order")

All the errors are flagged in RedTraiCheck(), but that's odd, since it's just the same code mixed around.


usr.Guild == "Fighters of the Black Order")

This has two things wrong with it. Mainly, the ) at the end of it, and the ==.

==s are only used inside of ifs and stuff like that. var/blah == blah has no effect.

I'd help clear it up for you, but not too sure what you're trying to do. The way it's set up now looks like after you confirm they're in one guild you want to switch em to the other. Doesn't make so much sense though.
In response to Zagreus
Zagreus wrote:
Drafonis wrote:
I get some weird code from these 2 procs:

mob/proc/RedTraiCheck()
if(usr.Guild == "Fighters of the Red Order")
if(src.Guild == "Fighters of the Red Order")
usr.Award_Status = 0
usr.Guild == "Fighters of the Black Order")

mob/proc/BlackTraiCheck()
if(usr.Guild == "Fighters of the Black Order")
if(src.Guild == "Fighters of the Black Order")
usr.Award_Status = 0
usr.Guild == "Fighters of the Red Order")

All the errors are flagged in RedTraiCheck(), but that's odd, since it's just the same code mixed around.


usr.Guild == "Fighters of the Black Order")

This has two things wrong with it. Mainly, the ) at the end of it, and the ==.

==s are only used inside of ifs and stuff like that. var/blah == blah has no effect.

I'd help clear it up for you, but not too sure what you're trying to do. The way it's set up now looks like after you confirm they're in one guild you want to switch em to the other. Doesn't make so much sense though.

What it's supposed to do is that, since this is a proc executed in the attack verb, it checks if the person is attacking a fellow Guild member and if he is, he is sent to the other guild and loses all his awards.