#### Archived

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

# Problem with my logical operators...

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

## 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 on other sites
if(Fighter_Stats[Ships[count].ship_type].primweapon_double = false)

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

##### Share on other sites
Um...

oops...

Shoulda seen that one...

1. 1
Rutin
37
2. 2
3. 3
4. 4
5. 5

• 11
• 12
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
633349
• Total Posts
3011464
• ### Who's Online (See full list)

There are no registered users currently online

×