QA v0.13.0 P3 : Laser removeComponent mort retiré + blacklist IA purgée à l'expiration
This commit is contained in:
parent
1b3032cd7a
commit
a424aab013
@ -326,6 +326,9 @@ public abstract class Behaviour {
|
||||
target = null;
|
||||
targetIsObjective = false;
|
||||
pathFailStart = 0;
|
||||
// QA v0.13.0 P3 : purger la référence au cooldown expire (sinon
|
||||
// le GameObject joueur reste retenu — bénin mais sale).
|
||||
// L'expiration est testée à chaque visionCheck ci-dessous.
|
||||
}
|
||||
if (target != null && Time.frameCount % 300 == 0) {
|
||||
GameLog.d("LS-AI", transform.gameObject.name + " : aucun chemin NavMesh vers "
|
||||
@ -534,6 +537,9 @@ public abstract class Behaviour {
|
||||
// Blacklist anti-boucle : ne PAS ré-acquérir le joueur tenu sur la
|
||||
// position injoignable tant que le cooldown court (cf. champ).
|
||||
boolean cooldownActive = System.currentTimeMillis() < unreachableTargetCooldown;
|
||||
if (!cooldownActive) {
|
||||
lastUnreachableTargetObj = null; // référence purgée à l'expiration (QA P3)
|
||||
}
|
||||
for (GameObject player : players) {
|
||||
float dist = (float) Vector2.distance(transform.position, player.transform.position);
|
||||
if (cooldownActive && player == lastUnreachableTargetObj) {
|
||||
|
||||
@ -43,11 +43,11 @@ public class Laser extends Script {
|
||||
@Override
|
||||
public void onTriggerEnter(Collider other) {
|
||||
if (other.gameObject.getLayer() == solidLayer) {
|
||||
gameObject.removeComponent(Collider.class);
|
||||
// QA v0.13.0 P3 : removeComponent suivi d'un destroy immédiat
|
||||
// est un appel mort (le destroy purge tout) — retiré.
|
||||
GameObject.destroy(gameObject);
|
||||
} else if (other.gameObject.getTag() != null) {
|
||||
if ("projectile-barrier".equals(other.gameObject.getTag())) {
|
||||
gameObject.removeComponent(Collider.class);
|
||||
GameObject.destroy(gameObject);
|
||||
}
|
||||
for (String tag : targetTags) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user