ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/attack.C
(Generate patch)

Comparing deliantra/server/server/attack.C (file contents):
Revision 1.55 by elmex, Sun Apr 15 19:23:18 2007 UTC vs.
Revision 1.56 by root, Tue Apr 24 12:32:15 2007 UTC

1438 return maxdam; 1438 return maxdam;
1439 } 1439 }
1440 1440
1441 if (QUERY_FLAG (op, FLAG_FRIENDLY) && op->type != PLAYER) 1441 if (QUERY_FLAG (op, FLAG_FRIENDLY) && op->type != PLAYER)
1442 { 1442 {
1443 remove_friendly_object (op);
1444
1445 if (op->owner && op->owner->type == PLAYER && op->owner->contr->ranges[range_golem] == op)
1446 op->owner->contr->ranges[range_golem] = 0;
1447
1448 op->destroy (); 1443 op->destroy ();
1449 return maxdam; 1444 return maxdam;
1450 } 1445 }
1451 1446
1452 /* Now lets start dealing with experience we get for killing something */ 1447 /* Now lets start dealing with experience we get for killing something */
1670} 1665}
1671 1666
1672/* Find out if this is friendly fire (PVP and attacker is peaceful) or not 1667/* Find out if this is friendly fire (PVP and attacker is peaceful) or not
1673 * Returns 0 this is not friendly fire 1668 * Returns 0 this is not friendly fire
1674 */ 1669 */
1675
1676int 1670int
1677friendly_fire (object *op, object *hitter) 1671friendly_fire (object *op, object *hitter)
1678{ 1672{
1679 object *owner; 1673 object *owner;
1680 int friendlyfire; 1674 int friendlyfire;
1737 object *owner = hitter->owner; 1731 object *owner = hitter->owner;
1738 1732
1739 if (!owner) 1733 if (!owner)
1740 owner = hitter; 1734 owner = hitter;
1741 1735
1742 if (owner->type == PLAYER && (!op_on_battleground (op, 0, 0) && (op->contr->peaceful || owner->contr->peaceful)) && op != owner) 1736 if (owner->type == PLAYER
1737 && (!op_on_battleground (op, 0, 0)
1738 && (op->contr->peaceful || owner->contr->peaceful))
1739 && op != owner)
1743 return 0; 1740 return 0;
1744 } 1741 }
1745#endif 1742#endif
1746 1743
1747 if (body_attack) 1744 if (body_attack)
1954 /* Used to be ghosthit removal - we now use the ONE_HIT flag. Note 1951 /* Used to be ghosthit removal - we now use the ONE_HIT flag. Note
1955 * that before if the player was immune to ghosthit, the monster 1952 * that before if the player was immune to ghosthit, the monster
1956 * remained - that is no longer the case. 1953 * remained - that is no longer the case.
1957 */ 1954 */
1958 if (QUERY_FLAG (hitter, FLAG_ONE_HIT)) 1955 if (QUERY_FLAG (hitter, FLAG_ONE_HIT))
1959 {
1960 if (QUERY_FLAG (hitter, FLAG_FRIENDLY))
1961 remove_friendly_object (hitter);
1962
1963 hitter->destroy (); 1956 hitter->destroy ();
1964 } 1957
1965 /* Lets handle creatures that are splitting now */ 1958 /* Lets handle creatures that are splitting now */
1966 else if (type & AT_PHYSICAL && !QUERY_FLAG (op, FLAG_FREED) && QUERY_FLAG (op, FLAG_SPLITTING)) 1959 else if (type & AT_PHYSICAL && !QUERY_FLAG (op, FLAG_FREED) && QUERY_FLAG (op, FLAG_SPLITTING))
1967 { 1960 {
1968 int i; 1961 int i;
1969 int friendly = QUERY_FLAG (op, FLAG_FRIENDLY); 1962 int friendly = QUERY_FLAG (op, FLAG_FRIENDLY);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines