Ok, I'm putting socketed items into my mud. I've got everything done except for the socket function. In the function I'm checking to see if the item is either a blue gem, a red gem or a yellow gem. For some reason that I cannot explain it is messing up. Here's the code:
Here's my test. I had a gem and a sword. The gem is item_gem_red.
I then changed the gem to a blue gem for the second if check to see if it's working.
Can anyone see what's going on? I've stared at this things for quite awhile and can't figure it out. Either my != is wrong or my || is wrong somehow? I'm not sure.
/*These if checks are to see if the item_type is working*/
if (first_ob->item_type == ITEM_GEM_RED)
send_to_char( "This item is a red gem!\n\r", ch );
if (first_ob->item_type != ITEM_GEM_RED)
send_to_char( "This item is not a red gem!\n\r", ch );
if (second_ob->item_type == ITEM_WEAPON)
send_to_char( "This item is a sword!\n\r", ch );
/* This is where it stops. My != if check isn't working correctly. */
if ( first_ob->item_type != ITEM_GEM_BLUE
|| first_ob->item_type != ITEM_GEM_RED
|| first_ob->item_type != ITEM_GEM_YELLOW )
{
send_to_char( "This item must be a gem!\n\r", ch );
return;
}
Here's my test. I had a gem and a sword. The gem is item_gem_red.
<1564hp 1240mv>
< 2>socket gem sword
This item is a red gem!
This item is a sword!
This item must be a gem!
I then changed the gem to a blue gem for the second if check to see if it's working.
<1564hp 1240mv>
< 2>oset gem type gem-blue
Build: Orik: oset gem type gem-blue
<1564hp 1240mv>
< 2>socket gem sword
This item is not a red gem!
This item is a sword!
This item must be a gem!
Can anyone see what's going on? I've stared at this things for quite awhile and can't figure it out. Either my != is wrong or my || is wrong somehow? I'm not sure.