ludic.wildlife (18.3): wildlife_listed - still one of this state's animals, so a crowd lets go of one a load or a clear removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 00:36:31 +03:00
parent 9ec1b3a9bf
commit 95f2087148
4 changed files with 10 additions and 3 deletions

View file

@ -58,11 +58,12 @@ NAV_SHIM int nav_crowd_target(void *p, int i, float x, float y, float z) {
if (!ref) return 0;
return c->crowd->requestMoveTarget(i, ref, near) ? 1 : 0;
}
// a new top speed, as a walker goes from a walk to a run
// a new top speed, as a walker goes from a walk to a run; 0 stands it still (a new target moves it again)
NAV_SHIM void nav_crowd_speed(void *p, int i, float speed) {
Crowd *c = static_cast<Crowd *>(p);
const dtCrowdAgent *a = c->crowd->getAgent(i);
if (!a || !a->active) return;
if (speed < 0.01f) { c->crowd->resetMoveTarget(i); return; } // standing: no target, not no acceleration
dtCrowdAgentParams ap = a->params;
ap.maxSpeed = speed;
ap.maxAcceleration = speed * 4.0f;