forked from github/server
monster faction may learn from experience
This commit is contained in:
parent
5ef9b624ff
commit
1789bc06e9
1 changed files with 2 additions and 1 deletions
|
@ -27,6 +27,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "curse.h"
|
||||
#include "item.h"
|
||||
#include "move.h"
|
||||
#include "monster.h"
|
||||
#include "order.h"
|
||||
#include "plane.h"
|
||||
#include "race.h"
|
||||
|
@ -1945,7 +1946,7 @@ static double produceexp_chance(void) {
|
|||
|
||||
void produceexp_ex(struct unit *u, skill_t sk, int n, bool (*learn)(unit *, skill_t, double))
|
||||
{
|
||||
if (n != 0 && playerrace(u_race(u))) {
|
||||
if (n != 0 && (is_monsters(u->faction) || playerrace(u_race(u)))) {
|
||||
double chance = produceexp_chance();
|
||||
if (chance > 0.0F) {
|
||||
learn(u, sk, (n * chance) / u->number);
|
||||
|
|
Loading…
Reference in a new issue