Merge pull request #73 from badgerman/master

ongoing bugfixing
This commit is contained in:
Enno Rehling 2014-12-14 06:14:30 +01:00
commit 9d1b9d01f9
7 changed files with 31 additions and 12 deletions

View File

@ -747,7 +747,7 @@
<attack type="5"/> <attack type="5"/>
</race> </race>
<race name="clone" magres="0.900000" maxaura="0.000000" regaura="0.000000" weight="1000" capacity="540" speed="1.0" hp="40" damage="0d0" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" canlearn="no" teach="no" noheal="yes"> <race name="clone" magres="0.900000" maxaura="0.000000" regaura="0.000000" weight="1000" capacity="540" speed="1.0" hp="40" damage="0d0" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" canlearn="no" teach="no" noheal="yes" giveitem="yes">
<ai splitsize="10000"/> <ai splitsize="10000"/>
<skill name="crossbow" modifier="-99"/> <skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/> <skill name="mining" modifier="-99"/>

View File

@ -981,7 +981,7 @@
<familiar race="rat"/> <familiar race="rat"/>
<familiar race="imp"/> <familiar race="imp"/>
</race> </race>
<race name="clone" magres="0.900000" maxaura="0.000000" regaura="0.000000" recruitcost="0" weight="1000" capacity="540" speed="1.000000" hp="40" damage="0d0" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" canlearn="no" teach="no" noheal="yes"> <race name="clone" magres="0.900000" maxaura="0.000000" regaura="0.000000" recruitcost="0" weight="1000" capacity="540" speed="1.000000" hp="40" damage="0d0" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" canlearn="no" teach="no" noheal="yes" giveitem="yes">
<ai splitsize="10000"/> <ai splitsize="10000"/>
<skill name="alchemy" modifier="-99"/> <skill name="alchemy" modifier="-99"/>
<skill name="crossbow" modifier="-99"/> <skill name="crossbow" modifier="-99"/>

View File

@ -1,12 +1,18 @@
function use_snowman(u, amount) function use_snowman(u, amount)
if u.region.terrain == "glacier" then local have = u:get_item("snowman")
local man = unit.create(u.faction, u.region) if have<amount then
man.race = "snowman" amount = have
man.number = amount end
u:add_item("snowman", -amount) if amount>0 and u.region.terrain == "glacier" then
return 0 local man = unit.create(u.faction, u.region)
end man.race = "snowman"
return -4 man.number = amount
if u:add_item("snowman", -amount)~= nil then
return -1
end
return 0
end
return -4
end end
local self = {} local self = {}

View File

@ -750,6 +750,7 @@ void give_cmd(unit * u, order * ord)
msg_feedback(u, ord, "race_noregroup", "race", u_race(u))); msg_feedback(u, ord, "race_noregroup", "race", u_race(u)));
return; return;
} }
n = _min(u->number, n);
msg = u2 ? give_men(n, u, u2, ord) : disband_men(n, u, ord); msg = u2 ? give_men(n, u, u2, ord) : disband_men(n, u, ord);
if (msg) { if (msg) {
ADDMSG(&u->faction->msgs, msg); ADDMSG(&u->faction->msgs, msg);

View File

@ -81,6 +81,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#endif #endif
/* external libraries */ /* external libraries */
#include <storage.h>
#include <iniparser.h> #include <iniparser.h>
#include <critbit.h> #include <critbit.h>
@ -2132,6 +2133,16 @@ bool has_limited_skills(const struct unit * u)
} }
} }
static int read_ext(attrib * a, void *owner, struct storage *store)
{
int len;
READ_INT(store, &len);
store->api->r_bin(store->handle, NULL, (size_t)len);
return AT_READ_OK;
}
void attrib_init(void) void attrib_init(void)
{ {
/* Alle speicherbaren Attribute müssen hier registriert werden */ /* Alle speicherbaren Attribute müssen hier registriert werden */
@ -2178,6 +2189,7 @@ void attrib_init(void)
at_register(&at_germs); at_register(&at_germs);
at_deprecate("xontormiaexpress", a_readint); /* required for old datafiles */ at_deprecate("xontormiaexpress", a_readint); /* required for old datafiles */
at_deprecate("lua", read_ext); /* required for old datafiles */
} }
void kernel_init(void) void kernel_init(void)

View File

@ -4701,7 +4701,7 @@ int sp_gooddreams(castorder * co)
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/* Name: /* Name: Seelenkopie / Doppelganger
* Stufe: 9 * Stufe: 9
* Kategorie: * Kategorie:
* Wirkung: * Wirkung:

View File

@ -299,7 +299,7 @@ int a_read(struct storage *store, attrib ** attribs, void *owner)
na = a_new(at); na = a_new(at);
} }
else { else {
const void * kv; const void * kv = 0;
cb_find_prefix(&cb_deprecated, zText, strlen(zText) + 1, &kv, 1, 0); cb_find_prefix(&cb_deprecated, zText, strlen(zText) + 1, &kv, 1, 0);
if (kv) { if (kv) {
cb_get_kv(kv, &reader, sizeof(reader)); cb_get_kv(kv, &reader, sizeof(reader));