nothing big. bugfix in gmtool-coordinates

This commit is contained in:
Enno Rehling 2009-07-25 13:35:34 +00:00
parent 19e0d7468e
commit dd3054de73
3 changed files with 14 additions and 11 deletions

View File

@ -495,20 +495,20 @@ study_speedup(unit * u)
#define MINTURN 5 /* 5 */
#define OFSTURN 2 /* 2 */
if (turn>MINTURN) {
static int rule = -1;
if (rule<0) {
rule = get_param_int(global.parameters, "study.speedup", 0);
static int speed_rule = -1;
if (speed_rule<0) {
speed_rule = get_param_int(global.parameters, "study.speedup", 0);
}
if (rule==1) {
double age = OFSTURN;
if (speed_rule==1) {
double learn_age = OFSTURN;
int i;
for (i=0;i!=u->skill_size;++i) {
skill * sv = u->skills+i;
double time = sv->level*(sv->level+1)/2.0;
age += time;
double learn_time = sv->level*(sv->level+1)/2.0;
learn_age += learn_time;
}
if (age < turn) {
return 2.0-age/turn;
if (learn_age < turn) {
return 2.0-learn_age/turn;
}
}
}

View File

@ -174,9 +174,11 @@ static void
lua_paint_info(struct window * wnd, const struct state * st)
{
struct lua_State * L = paint_state;
int nx = st->cursor.x, ny = st->cursor.y;
pnormalize(&nx, &ny, st->cursor.pl);
lua_rawgeti(L, LUA_REGISTRYINDEX, paint_handle);
tolua_pushnumber(L, st->cursor.x);
tolua_pushnumber(L, st->cursor.y);
tolua_pushnumber(L, nx);
tolua_pushnumber(L, ny);
if (lua_pcall(L, 2, 1, 0)!=0) {
const char* error = lua_tostring(L, -1);
log_error(("paint function failed: %s\n", error));

View File

@ -261,6 +261,7 @@
<!-- Gesang der Versklavung -->
<resource name="aura" amount="40" cost="fixed"/>
</spell>
<!-- TODO: exploitable (transfers items) -->
<spell name="big_recruit" type="cerddor" rank="5" level="14" index="179" variable="true">
<!-- Hohe Kunst der Überzeugung -->
<resource name="aura" amount="20" cost="level"/>