Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] (PR#11227) AI Hunters Pessimistic about Missile Effectiven
Home

[Freeciv-Dev] (PR#11227) AI Hunters Pessimistic about Missile Effectiven

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11227) AI Hunters Pessimistic about Missile Effectiveness (dangling ptr)
From: "Benedict Adamson" <badamson@xxxxxxxxxxx>
Date: Sat, 27 Nov 2004 14:37:34 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=11227 >

The ai_hunter_manage function tries launching missiles at its target, 
using ai_hunter_try_launch. It also tries directly attacking the target, 
by moving towards the target, using ai_unit_goto and then 
ai_unit_attack. It tries the missile attack before the direct attack.

However, it assumes that the target still exists when computing the 
direct attack; that is, it assumes the missile attack fails. The code 
unfortunately retains a pointer to the target, which is then a dangling 
pointer and can cause a crash.





[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11227) AI Hunters Pessimistic about Missile Effectiveness (dangling ptr), Benedict Adamson <=