Inside3D!
     

Operators not working / Logical Weirdness

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
jim



Joined: 05 Aug 2005
Posts: 400
Location: In The Sun

PostPosted: Thu May 29, 2008 10:41 pm    Post subject: Operators not working / Logical Weirdness Reply with quote

I have some weapon that can have two different ammo types loaded in it. Then I run into some kind of logical weirdness. My logic says "the code that doesn't work" works, but it doesn't work...

This code is about picking up the Weapon or letting it stay on the ground.

Logic Explanation:
It lets player to pick up the Weapon always if player has less than two of the kind. When player has two Weapons, then it's not useful to let player pickup a third, if it doesn't give player anything.

First check which ammo type the Weapon is giving. If player don't have enough ammo in the pockets, then pick it up. Otherwise it's needed to check which type ammo of player's Weapons are loaded and are they full. Both incorrect, don't pickup. Both full, don't pickup.

Then comes the weirdness in the logic. It is not enough to check, if one of the Weapons has the correct type loaded and it's not full. But I also need to check if the Weapons have incorrect type and not full, if I didn't do this check, then player would pickup a weapon and not get anything.

The code in pastebin with weird linings
_________________
zbang!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group