• Advertisement

Archived

This topic is now archived and is closed to further replies.

Problem with my logical operators...

This topic is 5500 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

if(Fighter_Stats[Ships[count].ship_type].primweapon_double = false)
			{
			Init_Bullet(&Bullets[bulletcount+1], &Ships[count], count, Fighter_Stats[Ships[count].ship_type].primweapon_type, Ships[count].x, Ships[count].y);
			bulletcount++;
			}
			else
			{
			Init_Bullet(&Bullets[bulletcount+1], &Ships[count], count, Fighter_Stats[Ships[count].ship_type].primweapon_type, Ang_x(Ships[count].x, 10, 0 - Ships[count].angle + 1.5), Ang_y(Ships[count].y, 10, 0 - Ships[count].angle + 1.5));
			Init_Bullet(&Bullets[bulletcount+2], &Ships[count], count, Fighter_Stats[Ships[count].ship_type].primweapon_type, Ang_x(Ships[count].x, 10, 0 - Ships[count].angle - 1.5), Ang_y(Ships[count].y, 10, 0 - Ships[count].angle - 1.5));
			bulletcount += 2;
			}
 
Thats a code snippet from my game. The problem: the ships are allways firing double, whether the variable is true OR false. Never mind the code inside the loop, but I''m sure its something in the if statement. I allready checked my variables... their global and allready defined, just like they should be. Any help would be appreciated

Share this post


Link to post
Share on other sites
Advertisement
if(Fighter_Stats[Ships[count].ship_type].primweapon_double = false)

You''re doing an assignment, not comparison. Use == instead of =

Share this post


Link to post
Share on other sites

  • Advertisement