diff --git a/core/src/gamecode/laws.c b/core/src/gamecode/laws.c index 7259612b3..c3c395f8b 100755 --- a/core/src/gamecode/laws.c +++ b/core/src/gamecode/laws.c @@ -2616,6 +2616,7 @@ static bool display_race(faction * f, unit * u, const race * rc) case AT_SPELL: case AT_COMBATSPELL: case AT_DRAIN_ST: + case AT_DRAIN_EXP: case AT_DAZZLE: bytes = snprintf(bufp, size, "%s", LOC(f->locale, "attack_magical")); break; diff --git a/core/src/kernel/unit.c b/core/src/kernel/unit.c index 256338325..8d304251d 100644 --- a/core/src/kernel/unit.c +++ b/core/src/kernel/unit.c @@ -225,6 +225,7 @@ int gift_items(unit * u, int flags) int rule = rule_give(); assert(u->region); + assert(u->faction); if ((u->faction->flags & FFL_QUIT) == 0 || (rule & GIVE_ONDEATH) == 0) { if ((rule & GIVE_ALLITEMS) == 0 && (flags & GIFT_FRIENDS)) diff --git a/support/build.lua b/support/build.lua new file mode 100644 index 000000000..2f50f6679 --- /dev/null +++ b/support/build.lua @@ -0,0 +1,74 @@ +function size() + return 16 +end + +function island(pl, x, y, r) + gmtool.make_block(pl, x, y, r) + gmtool.make_island(pl, x+r/2+2, y+r/2, size() * 3) + gmtool.make_island(pl, x-r-2, y+r/2, size() * 3) + gmtool.make_island(pl, x-r/2-2, y-r/2, size() * 3) + gmtool.make_island(pl, x+r+2, y-r/2, size() * 3) + gmtool.make_island(pl, x+r/2+2, y-r-2, size() * 3) + gmtool.make_island(pl, x-r/2-2, y+r+2, size() * 3) +end + +function cross(pl, x, y, r) + gmtool.make_block(pl, x-r, y+r*2, r) + gmtool.make_block(pl, x+r*4/3, y, r) + gmtool.make_block(pl, x-r*4/3, y, r) + gmtool.make_block(pl, x+r, y-r*2, r) + + gmtool.make_island(pl, x, y, size() * 3) + gmtool.make_island(pl, x, y-r*4/3, size() * 3) + gmtool.make_island(pl, x, y+r*4/3, size() * 3) + gmtool.make_island(pl, x+r*4/3, y-r*4/3, size() * 3) + gmtool.make_island(pl, x-r*4/3, y+r*4/3, size() * 3) +end + +function count() + local i = 0 + for f in factions() do i = i + 1 end + print(i) +end + +function line(pl) + local m = 0 + local x, y + local i = 0 + x = 0 + y = i + local r = get_region(x, y, pl) + while true do + if r==nil then + if m==0 and (i>=0 or i<-10) then + local s = size() + gmtool.make_island(pl, x, y, s*3, s) + else + gmtool.make_block(pl, x, y, 6) + end + r = get_region(x, y, pl) + if r==nil then + r = region.create(x, y, "ocean", pl) + end + m = 1 - m + end + i = r.y + 1 + x = 0 + y = i + r = get_region(x, y, pl) + if r~=nil and r.y==0 then break end + end +end + +function build(pl) + cross(pl, -28, -20, 6) + island(pl, 28, -20, 11) + island(pl, -28, 20, 11) + island(pl, 28, 20, 11) + -- line(pl) +end + +eressea.free_game() +pl = plane.create(0, -50, -40, 90, 80) + +build(pl)