Militarysites warn about allies

Bug #1637386 reported by GunChleoc on 2016-10-28
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Low
Unassigned

Bug Description

When allied soldiers approach one of the player's militarysites, the "Your XX discovered an aggressor." is triggered. This message should only be triggered for soldiers of players who aren't in the same team.

Tags: ui Edit Tag help

Related branches

TiborB (tiborb95) wrote :

I just looked at:

bool FindBobEnemySoldier::accept(Bob* const imm) const {
 if (upcast(Soldier, soldier, imm))
  if (soldier->is_on_battlefield() && (!player || soldier->owner().is_hostile(*player)) &&
      soldier->get_current_health())
   return true;

 return false;
}

and wonder what is the logic for "!player" .... ?

GunChleoc (gunchleoc) wrote :

!player is true if the calling object (warehouse, soldier, militarysite or bob) has no owner.

TiborB (tiborb95) on 2017-01-30
Changed in widelands:
importance: Undecided → Low
status: New → In Progress
assignee: nobody → TiborB (tiborb95)
GunChleoc (gunchleoc) on 2017-01-31
Changed in widelands:
status: In Progress → Fix Committed
assignee: TiborB (tiborb95) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers