Changeset 126 for abuse/trunk/src/objects.cpp
- Timestamp:
- Mar 18, 2008, 11:22:51 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/objects.cpp
r124 r126 442 442 } 443 443 444 int game_object::can_hurt(game_object *who) // collision checking will ask first to see if you 445 { 446 int is_attacker=current_level->is_attacker(this); 447 // it's you against them! Damage only if it you are attacking or they are attacking you 448 // I.E. don't let them hurt themselves, this can change if you over-ride this virtual function 449 450 if (who->hurtable() && (is_attacker || current_level->is_attacker(who) || hurt_all())) 451 return 1; 452 else return 0; 444 // collision checking will ask first to see if you 445 int game_object::can_hurt(game_object *who) 446 { 447 int is_attacker = current_level->is_attacker(this); 448 449 // it's you against them! Damage only if it you are attacking or they are 450 // attacking you, ie. don't let them hurt themselves. This can change if 451 // you override this virtual function 452 453 if(who->hurtable() 454 && ((_team == -1) || (_team != who->get_team())) 455 && (is_attacker || current_level->is_attacker(who) || hurt_all())) 456 return 1; 457 458 return 0; 453 459 } 454 460 455 461 void game_object::note_attack(game_object *whom) 456 462 { 457 return ;// nevermind463 return; // nevermind 458 464 } 459 465 … … 470 476 int32_t push_xvel, int32_t push_yvel) 471 477 { 478 // No friendly fire 479 if((_team != -1) && (_team == from->get_team())) 480 return; 472 481 473 482 void *d=figures[otype]->get_fun(OFUN_DAMAGE);
Note: See TracChangeset
for help on using the changeset viewer.