2010-08-08 10:06:34 +02:00
|
|
|
#include <platform.h>
|
|
|
|
#include <kernel/config.h>
|
|
|
|
#include "equipment.h"
|
|
|
|
|
|
|
|
/* kernel includes */
|
2018-05-11 21:30:26 +02:00
|
|
|
#include "callbacks.h"
|
2012-05-25 08:50:27 +02:00
|
|
|
#include "faction.h"
|
2018-05-11 21:30:26 +02:00
|
|
|
#include "item.h"
|
2010-08-08 10:06:34 +02:00
|
|
|
#include "race.h"
|
2016-09-24 17:29:55 +02:00
|
|
|
#include "spell.h"
|
2018-05-11 21:30:26 +02:00
|
|
|
#include "unit.h"
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
/* util includes */
|
2017-01-26 17:41:21 +01:00
|
|
|
#include <selist.h>
|
2017-09-08 22:24:17 +02:00
|
|
|
#include <critbit.h>
|
2017-09-17 20:42:43 +02:00
|
|
|
#include <util/log.h>
|
2010-08-08 10:06:34 +02:00
|
|
|
#include <util/rand.h>
|
|
|
|
#include <util/rng.h>
|
2017-12-28 18:29:40 +01:00
|
|
|
#include <util/strings.h>
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
/* libc includes */
|
|
|
|
#include <assert.h>
|
|
|
|
#include <string.h>
|
2014-03-15 19:29:11 +01:00
|
|
|
#include <stdlib.h>
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2018-05-11 21:30:26 +02:00
|
|
|
bool equip_unit(struct unit *u, const char *eqname)
|
2010-08-08 10:06:34 +02:00
|
|
|
{
|
2018-05-11 21:30:26 +02:00
|
|
|
return equip_unit_mask(u, eqname, EQUIP_ALL);
|
2010-08-08 10:06:34 +02:00
|
|
|
}
|
|
|
|
|
2018-05-11 21:30:26 +02:00
|
|
|
bool equip_unit_mask(struct unit *u, const char *eqname, int mask)
|
2010-08-08 10:06:34 +02:00
|
|
|
{
|
2018-05-11 21:30:26 +02:00
|
|
|
if (callbacks.equip_unit) {
|
|
|
|
return callbacks.equip_unit(u, eqname, mask);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|