forked from mirror/openmw-tes3mp
Improve AI prioritising health potions
This commit is contained in:
parent
a29abb85f1
commit
8a210c49e9
1 changed files with 4 additions and 1 deletions
|
@ -294,7 +294,10 @@ namespace MWMechanics
|
||||||
// Effect doesn't heal more than we need, *or* we are below 1/2 health
|
// Effect doesn't heal more than we need, *or* we are below 1/2 health
|
||||||
if (current.getModified() - current.getCurrent() > toHeal
|
if (current.getModified() - current.getCurrent() > toHeal
|
||||||
|| current.getCurrent() < current.getModified()*0.5)
|
|| current.getCurrent() < current.getModified()*0.5)
|
||||||
return 10000.f * priority;
|
{
|
||||||
|
return 10000.f * priority
|
||||||
|
- (toHeal - (current.getModified()-current.getCurrent())); // prefer the most fitting potion
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return -10000.f * priority; // Save for later
|
return -10000.f * priority; // Save for later
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue