diff --git a/.gitignore b/.gitignore index fd1a7c349..24219490f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.vscode/ *.orig eressea.ini Debug @@ -26,12 +27,6 @@ ipch/ *.bak bin/ build*/ -game-e2/data -game-e2/*.log* -game-e2/reports/ -game-e3/data/ -game-e3/*.log* -game-e3/reports/ *.log *.log.* tags diff --git a/.gitmodules b/.gitmodules index f8177ab09..2242a8068 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,34 +1,28 @@ [submodule "lunit"] path = lunit - url = git://github.com/ennorehling/lunit.git -[submodule "crypto"] - path = crypto - url = git://github.com/ennorehling/crypto.git + url = https://github.com/ennorehling/lunit.git [submodule "cmake"] path = cmake - url = git://github.com/ennorehling/cmake.git + url = https://github.com/ennorehling/cmake.git [submodule "quicklist"] path = quicklist - url = git://github.com/ennorehling/quicklist.git + url = https://github.com/ennorehling/quicklist.git [submodule "critbit"] path = critbit - url = git://github.com/ennorehling/critbit.git + url = https://github.com/ennorehling/critbit.git [submodule "dlmalloc"] path = dlmalloc - url = git://github.com/ennorehling/dlmalloc.git + url = https://github.com/ennorehling/dlmalloc.git [submodule "cutest"] path = cutest - url = git://github.com/ennorehling/cutest.git + url = https://github.com/ennorehling/cutest.git [submodule "iniparser"] path = iniparser - url = git://github.com/ennorehling/iniparser.git + url = https://github.com/ennorehling/iniparser.git [submodule "cJSON"] path = cJSON - url = git://github.com/ennorehling/cJSON.git + url = https://github.com/ennorehling/cJSON.git [submodule "storage"] path = storage - url = git://github.com/ennorehling/storage.git + url = https://github.com/ennorehling/storage.git branch = master -[submodule "tolua"] - path = tolua - url = git://github.com/ennorehling/tolua.git diff --git a/.travis.yml b/.travis.yml index 003fb67ad..78aaf3648 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,8 @@ script: s/travis-build addons: apt: packages: - - liblua5.2-dev + - liblua5.1-dev + - libtolua-dev - libncurses5-dev - libsqlite3-dev - libxml2-dev diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e1b61e1b..d60d3d721 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,10 +60,11 @@ CONFIGURE_FILE ( ${CMAKE_CURRENT_SOURCE_DIR}/autoconf.h.in ${CMAKE_BINARY_DIR}/include/autoconf.h) INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}/include) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_AUTOCONF") + +## skip compiler/libc detection and force cmake autoconf: +#add_definitions(-DUSE_AUTOCONF) add_subdirectory (cutest) -add_subdirectory (crypto) add_subdirectory (cJSON) add_subdirectory (storage) add_subdirectory (iniparser) diff --git a/autoconf.h.in b/autoconf.h.in index 1c151b6f9..f3f197db1 100644 --- a/autoconf.h.in +++ b/autoconf.h.in @@ -33,127 +33,4 @@ #cmakedefine HAVE_DIRECT_MKDIR 1 #cmakedefine HAVE_DIRECT__MKDIR 1 -#if defined(HAVE_STRINGS_H) -#include -#endif - -#if defined(HAVE_UNISTD_H) -#include -#endif - -#if defined(HAVE_IO_H) -#include -#endif - -#if defined(HAVE_WINDOWS_H) -#include -#endif - -#if defined(HAVE_STDBOOL_H) -# include -#else -# if ! HAVE__BOOL -# ifdef __cplusplus -typedef bool _Bool; -# else -typedef unsigned char _Bool; -# endif -# endif -# define bool _Bool -# define false 0 -# define true 1 -# define __bool_true_false_are_defined 1 -#endif - -#ifndef HAVE__ACCESS -#ifdef HAVE_ACCESS -#define _access(path, mode) access(path, mode) -#endif -#endif - -#ifndef _A_RDONLY -#ifdef R_OK -#define _A_RDONLY R_OK -#endif -#endif - -#if !defined(HAVE__MEMICMP) -#if defined(HAVE_MEMICMP) -#define _memicmp(a, b, n) memicmp(a, b, n) -#elif defined(HAVE_STRNCASECMP) -#define _memicmp(a, b, n) strncasecmp(a, b, n) -#else -#define _memicmp(a, b, n) lcp_memicmp(a, b, n) -#endif -#endif - -#if !defined(HAVE__STRCMPL) -#if defined(HAVE_STRCMPL) -#define _strcmpl(a, b) strcmpl(a, b) -#elif defined(HAVE__STRICMP) -#define _strcmpl(a, b) _stricmp(a, b) -#elif defined(HAVE_STRICMP) -#define _strcmpl(a, b) stricmp(a, b) -#elif defined(HAVE_STRCASECMP) -#define _strcmpl(a, b) strcasecmp(a, b) -#else -#define _strcmpl(a, b) lcp_strcmpl(a, b) -#endif -#endif - -#if defined(HAVE_DIRECT__MKDIR) -#include -#elif defined(HAVE_DIRECT_MKDIR) -#include -#define _mkdir(a) mkdir(a) -#elif defined(HAVE_SYS_STAT_MKDIR) -#include -#define _mkdir(a) mkdir(a, 0777) -#endif - -#if !defined(HAVE__STRLWR) -#if defined(HAVE_STRLWR) -#define _strlwr(a) strlwr(a) -#else -#define _strlwr(a) lcp_strlwr(a) -#endif -#endif - -#if !defined(HAVE__STRDUP) -#if defined(HAVE_STRDUP) -#define _strdup(a) strdup(a) -#else -#define _strdup(a) lcp_strdup(a) -#endif -#endif - -#if !defined(HAVE__SLEEP) -#if defined(HAVE_USLEEP) -#define _sleep(a) usleep(a) -#elif defined(HAVE_SLEEP) -#define _sleep(a) sleep((a)/1000) -#else -#define _sleep(a) lcp_sleep(a) -#endif -#endif - -#if !defined(HAVE__SNPRINTF) -#if defined(HAVE_SNPRINTF) -#define _snprintf snprintf -#else -#define _snprintf lcp_snprintf -#endif -#endif - -#ifndef _min -#define _min(a,b) ((a) < (b) ? (a) : (b)) -#endif -#ifndef _max -#define _max(a,b) ((a) > (b) ? (a) : (b)) -#endif - -#if !defined(DBG_UNREFERENCED_PARAMETER) -#define DBG_UNREFERENCED_PARAMETER(x) x -#endif - #endif diff --git a/conf/e2/config.xml b/conf/e2/config.xml index 5516fd601..0441a46f6 100644 --- a/conf/e2/config.xml +++ b/conf/e2/config.xml @@ -54,14 +54,14 @@ - eressea-server@eressea.de - eressea-server@eressea.de + eressea-server@eressea.kn-bremen.de + eressea-server@eressea.kn-bremen.de - + Bitte denke daran, deine Befehle mit dem Betreff - ERESSEA 2 BEFEHLE an eressea-server@eressea.de zu senden. + ERESSEA 2 BEFEHLE an eressea-server@eressea.kn-bremen.de zu senden. Remember to send your orders to - eressea-server@eressea.de with the subject ERESSEA 2 ORDERS. + eressea-server@eressea.kn-bremen.de with the subject ERESSEA 2 ORDERS. ERESSEA 2 BEFEHLE diff --git a/conf/e3/config.json b/conf/e3/config.json index c9a86c8da..30bc7e599 100644 --- a/conf/e3/config.json +++ b/conf/e3/config.json @@ -1,9 +1,9 @@ { - "include": [ - "keywords.json", + "include": [ + "keywords.json", "prefixes.json", "e3/terrains.json" - ], + ], "disabled": [ "herbalism", "alchemy", diff --git a/conf/e3/config.xml b/conf/e3/config.xml index 04af3858d..c8c5dbb06 100644 --- a/conf/e3/config.xml +++ b/conf/e3/config.xml @@ -46,14 +46,14 @@ - eressea-server@eressea.de - eressea-server@eressea.de + eressea-server@eressea.kn-bremen.de + eressea-server@eressea.kn-bremen.de - + Bitte denke daran, deine Befehle mit dem Betreff - ERESSEA 3 BEFEHLE an eressea-server@eressea.de zu senden. + ERESSEA 3 BEFEHLE an eressea-server@eressea.kn-bremen.de zu senden. Remember to send your orders to - eressea-server@eressea.de with the subject E3 ORDERS. + eressea-server@eressea.kn-bremen.de with the subject E3 ORDERS. ERESSEA 3 BEFEHLE diff --git a/conf/e3/terrains.json b/conf/e3/terrains.json index 7b5ea980d..ee0eb0e37 100644 --- a/conf/e3/terrains.json +++ b/conf/e3/terrains.json @@ -222,14 +222,6 @@ "div": "100" } } - }, - "default": { - "size": 0, - "herbs": [], - "seed": 0, - "road": 0, - "flags": [ "land", "walk", "sail", "fly" ], - "production": {} } } } diff --git a/conf/e4/config.json b/conf/e4/config.json index 7a73de86f..cbe273af6 100644 --- a/conf/e4/config.json +++ b/conf/e4/config.json @@ -1,9 +1,9 @@ { - "include": [ - "keywords.json", + "include": [ + "keywords.json", "prefixes.json", "e3/terrains.json" - ], + ], "disabled": [ "herbalism", "alchemy", diff --git a/conf/e4/config.xml b/conf/e4/config.xml index 2def4f1a8..b188f7d79 100644 --- a/conf/e4/config.xml +++ b/conf/e4/config.xml @@ -47,14 +47,14 @@ - eressea-server@eressea.de - eressea-server@eressea.de + eressea-server@eressea.kn-bremen.de + eressea-server@eressea.kn-bremen.de - + Bitte denke daran, deine Befehle mit dem Betreff - ERESSEA 4 BEFEHLE an eressea-server@eressea.de zu senden. + ERESSEA 4 BEFEHLE an eressea-server@eressea.kn-bremen.de zu senden. Remember to send your orders to - eressea-server@eressea.de with the subject ERESSEA 4 ORDERS. + eressea-server@eressea.kn-bremen.de with the subject ERESSEA 4 ORDERS. ERESSEA 4 BEFEHLE diff --git a/conf/keywords.json b/conf/keywords.json index 88ee6c2bd..7117217d7 100644 --- a/conf/keywords.json +++ b/conf/keywords.json @@ -1,69 +1,69 @@ { - "keywords": { - "en" : { - "grow": [ "GROW", "BREED", "PLANT" ], - "combat": [ "COMBAT", "FIGHT" ] - }, - "de": { - "//" : "//", - "banner": "BANNER", - "work": [ "ARBEITE", "ARBEITEN" ], - "attack": ["ATTACKIERE", "ATTACKIEREN"], - "steal": [ "BEKLAUE", "BEKLAUEN" ], - "besiege": ["BELAGERE", "BELAGERN" ], - "name": [ "BENENNE", "BENENNEN" ], - "use": [ "BENUTZE", "BENUTZEN" ], - "describe": [ "BESCHREIBE", "BESCHREIBEN" ], - "enter": ["BETRETE", "BETRETEN"], - "guard": ["BEWACHE", "BEWACHEN"], - "message": "BOTSCHAFT", - "end": "ENDE", - "ride": ["FAHRE", "FAHREN"], - "number": "NUMMER", - "follow": ["FOLGE","FOLGEN"], - "research": ["FORSCHE", "FORSCHEN"], - "give": "GIB", - "help": [ "HELFE", "HELFEN" ], - "combat": [ "KÄMPFE", "KÄMPFEN" ], - "ready" : "KAMPFZAUBER", - "buy" : [ "KAUFE", "KAUFEN"], - "contact": [ "KONTAKT", "KONTAKTIEREN"], - "teach": ["LEHRE", "LEHREN"], - "study": ["LERNE", "LERNEN"], - "make": ["MACHE", "MACHEN"], - "maketemp": ["MACHE TEMP", "MACHETEMP"], - "move" : "NACH", - "password" : "PASSWORT", - "loot" : ["PLÃœNDERE", "PLÃœNDERN"], - "recruit": ["REKRUTIERE", "REKRUTIEREN"], - "reserve": ["RESERVIERE", "RESERVIEREN"], - "route": "ROUTE", - "sabotage": ["SABOTIERE", "SABOTIEREN"], - "option": "OPTION", - "spy": ["SPIONIERE", "SPIONIEREN"], - "quit": "STIRB", - "hide": ["TARNE", "TARNEN"], - "carry": ["TRANSPORTIERE", "TRANSPORTIEREN"], - "tax": ["TREIBE", "TREIBEN", "STEUERN"], - "entertain": ["UNTERHALTE", "UNTERHALTEN"], - "sell": ["VERKAUFE", "VERKAUFEN"], - "leave": ["VERLASSE", "VERLASSEN"], - "forget": ["VERGISS", "VERGESSEN"], - "cast": ["ZAUBERE", "ZAUBERN"], - "show": ["ZEIGE", "ZEIGEN"], - "destroy": ["ZERSTÖRE", "ZERSTÖREN"], - "grow": ["ZÃœCHTE", "PFLANZE", "ZÃœCHTEN", "PFLANZEN"], - "default": "DEFAULT", - "origin": "URSPRUNG", - "email": "EMAIL", - "piracy": "PIRATERIE", - "group": "GRUPPE", - "sort": ["SORTIERE", "SORTIEREN"], - "prefix": "PRÄFIX", - "alliance": "ALLIANZ", - "claim": ["BEANSPRUCHE", "BEANSPRUCHEN"], - "promote": ["BEFÖRDERE", "BEFÖRDERUNG"], - "pay": ["BEZAHLE", "BEZAHLEN"] - } - } + "keywords": { + "en" : { + "grow": [ "GROW", "BREED", "PLANT" ], + "combat": [ "COMBAT", "FIGHT" ] + }, + "de": { + "//" : "//", + "banner": "BANNER", + "work": [ "ARBEITE", "ARBEITEN" ], + "attack": ["ATTACKIERE", "ATTACKIEREN"], + "steal": [ "BEKLAUE", "BEKLAUEN" ], + "besiege": ["BELAGERE", "BELAGERN" ], + "name": [ "BENENNE", "BENENNEN" ], + "use": [ "BENUTZE", "BENUTZEN" ], + "describe": [ "BESCHREIBE", "BESCHREIBEN" ], + "enter": ["BETRETE", "BETRETEN"], + "guard": ["BEWACHE", "BEWACHEN"], + "message": "BOTSCHAFT", + "end": "ENDE", + "ride": ["FAHRE", "FAHREN"], + "number": "NUMMER", + "follow": ["FOLGE","FOLGEN"], + "research": ["FORSCHE", "FORSCHEN"], + "give": "GIB", + "help": [ "HELFE", "HELFEN" ], + "combat": [ "KÄMPFE", "KÄMPFEN" ], + "ready" : "KAMPFZAUBER", + "buy" : [ "KAUFE", "KAUFEN"], + "contact": [ "KONTAKT", "KONTAKTIEREN"], + "teach": ["LEHRE", "LEHREN"], + "study": ["LERNE", "LERNEN"], + "make": ["MACHE", "MACHEN"], + "maketemp": ["MACHE TEMP", "MACHETEMP"], + "move" : "NACH", + "password" : "PASSWORT", + "loot" : ["PLÃœNDERE", "PLÃœNDERN"], + "recruit": ["REKRUTIERE", "REKRUTIEREN"], + "reserve": ["RESERVIERE", "RESERVIEREN"], + "route": "ROUTE", + "sabotage": ["SABOTIERE", "SABOTIEREN"], + "option": "OPTION", + "spy": ["SPIONIERE", "SPIONIEREN"], + "quit": "STIRB", + "hide": ["TARNE", "TARNEN"], + "carry": ["TRANSPORTIERE", "TRANSPORTIEREN"], + "tax": ["TREIBE", "TREIBEN", "STEUERN"], + "entertain": ["UNTERHALTE", "UNTERHALTEN"], + "sell": ["VERKAUFE", "VERKAUFEN"], + "leave": ["VERLASSE", "VERLASSEN"], + "forget": ["VERGISS", "VERGESSEN"], + "cast": ["ZAUBERE", "ZAUBERN"], + "show": ["ZEIGE", "ZEIGEN"], + "destroy": ["ZERSTÖRE", "ZERSTÖREN"], + "grow": ["ZÃœCHTE", "PFLANZE", "ZÃœCHTEN", "PFLANZEN"], + "default": "DEFAULT", + "origin": "URSPRUNG", + "email": "EMAIL", + "piracy": "PIRATERIE", + "group": "GRUPPE", + "sort": ["SORTIERE", "SORTIEREN"], + "prefix": "PRÄFIX", + "alliance": "ALLIANZ", + "claim": ["BEANSPRUCHE", "BEANSPRUCHEN"], + "promote": ["BEFÖRDERE", "BEFÖRDERUNG"], + "pay": ["BEZAHLE", "BEZAHLEN"] + } + } } diff --git a/critbit b/critbit index 934c2dd94..971836241 160000 --- a/critbit +++ b/critbit @@ -1 +1 @@ -Subproject commit 934c2dd94d41da19637a76a1a8b3dfeb7aa8524d +Subproject commit 971836241277e37274aa3110344836499816ff21 diff --git a/crypto b/crypto deleted file mode 160000 index 913358a8d..000000000 --- a/crypto +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 913358a8d7d961ffc35b238c744ca6ce823ffdd9 diff --git a/doc/gprof-v3.10.0-163-gdfab45d.txt b/doc/gprof-v3.10.0-163-gdfab45d.txt new file mode 100644 index 000000000..aa148a1fd --- /dev/null +++ b/doc/gprof-v3.10.0-163-gdfab45d.txt @@ -0,0 +1,18335 @@ +# eressea -re2 -t961 run-turn.lua +Flat profile: + +Each sample counts as 0.01 seconds. + % cumulative self self total + time seconds seconds calls s/call s/call name + 11.26 3.91 3.91 232 0.02 0.02 prepare_report + 6.94 6.32 2.41 cb_find_top_i + 6.28 8.50 2.18 68430271 0.00 0.00 rc_find_i + 3.43 9.69 1.19 2742237 0.00 0.00 paragraph + 2.76 10.65 0.96 230 0.00 0.02 report_computer + 2.76 11.61 0.96 232 0.00 0.01 get_addresses + 2.68 12.54 0.93 1437425 0.00 0.00 cansee + 2.53 13.42 0.88 232 0.00 0.00 finish_reports + 2.22 14.19 0.77 230 0.00 0.03 report_plaintext + 2.19 14.95 0.76 32337529 0.00 0.00 hashstring + 1.84 15.59 0.64 10375491 0.00 0.00 alliedgroup + 1.81 16.22 0.63 34611296 0.00 0.00 strlcpy + 1.76 16.83 0.61 24887945 0.00 0.00 locale_string + 1.64 17.40 0.57 1766225 0.00 0.00 nr_curses + 1.50 17.92 0.52 55492327 0.00 0.00 getkeyword + 1.35 18.39 0.47 1 0.47 5.47 process + 1.35 18.86 0.47 decode_pointer + 1.30 19.31 0.45 51974272 0.00 0.00 a_find + 1.15 19.71 0.40 1310373 0.00 0.00 cr_output_curses + 0.92 20.03 0.32 129167539 0.00 0.00 u_race + 0.89 20.34 0.31 71815034 0.00 0.00 get_race + 0.82 20.63 0.29 18856320 0.00 0.00 cb_add_seen + 0.81 20.91 0.28 cb_find_prefix_i + 0.81 21.19 0.28 from_external_node + 0.78 21.46 0.27 99 0.00 0.00 report_template + 0.72 21.71 0.25 10030400 0.00 0.00 effskill + 0.69 21.95 0.24 9544331 0.00 0.00 parse_symbol + 0.69 22.19 0.24 1158076 0.00 0.00 getbuf_utf8 + 0.66 22.42 0.23 5985780 0.00 0.00 itoab + 0.63 22.64 0.22 1118718 0.00 0.00 ufindhash + 0.63 22.86 0.22 ql_advance + 0.60 23.07 0.21 12246335 0.00 0.00 ct_find + 0.60 23.28 0.21 2725583 0.00 0.00 parse_string + 0.60 23.49 0.21 11241829 0.00 0.00 i_change + 0.55 23.68 0.19 2480226 0.00 0.00 old_race + 0.55 23.87 0.19 2248440 0.00 0.00 get_borders_i + 0.55 24.06 0.19 bin_r_int_pak + 0.52 24.24 0.18 fs_write + 0.49 24.41 0.17 6010308 0.00 0.00 i_find + 0.49 24.58 0.17 860263 0.00 0.00 use_pooled + 0.43 24.73 0.15 5168717 0.00 0.00 nrt_find + 0.43 24.88 0.15 178254 0.00 0.00 get_food + 0.40 25.02 0.14 4434556 0.00 0.00 translate + 0.40 25.16 0.14 fstream_done + 0.40 25.30 0.14 ql_get + 0.40 25.44 0.14 1375380 0.00 0.00 remove_empty_units_in_region + 0.37 25.57 0.13 10190660 0.00 0.00 get_curse + 0.37 25.70 0.13 5387327 0.00 0.00 parse_token + 0.35 25.82 0.12 11253756 0.00 0.00 genrand_int32 + 0.35 25.94 0.12 923671 0.00 0.00 cr_output_unit + 0.35 26.06 0.12 713016 0.00 0.00 do_enter + 0.35 26.18 0.12 596221 0.00 0.00 write_unit + 0.32 26.29 0.11 9953180 0.00 0.00 alliedunit + 0.32 26.40 0.11 1380398 0.00 0.00 translate + 0.32 26.51 0.11 10103290 0.00 0.00 stream_printf + 0.32 26.62 0.11 fs_writeln + 0.29 26.72 0.10 46391457 0.00 0.00 unicode_utf8_to_ucs4 + 0.29 26.82 0.10 36653945 0.00 0.00 wrptr + 0.29 26.92 0.10 13102790 0.00 0.00 opstack_pop + 0.26 27.01 0.09 50553492 0.00 0.00 stealth_modifier + 0.26 27.10 0.09 3398582 0.00 0.00 travelthru_map + 0.26 27.19 0.09 2624955 0.00 0.00 has_skill + 0.26 27.28 0.09 1390078 0.00 0.00 get_row + 0.26 27.37 0.09 1248014 0.00 0.00 listlen + 0.26 27.46 0.09 297222 0.00 0.00 fwritestr + 0.26 27.55 0.09 qli_more + 0.24 27.63 0.09 56052475 0.00 0.00 get_resourcetype + 0.23 27.71 0.08 20834979 0.00 0.00 autoalliance + 0.23 27.79 0.08 13102790 0.00 0.00 opstack_push + 0.23 27.87 0.08 12353561 0.00 0.00 report_item + 0.23 27.95 0.08 7252744 0.00 0.00 cmp_transfer + 0.23 28.03 0.08 7120688 0.00 0.00 get_money + 0.23 28.11 0.08 2 0.04 0.73 make_summary + 0.20 28.18 0.07 17451017 0.00 0.00 strlcpy_w + 0.20 28.25 0.07 47902 0.00 0.00 getshipweight + 0.20 28.32 0.07 bin_r_str_buf + 0.20 28.39 0.07 68430117 0.00 0.00 rc_find + 0.20 28.46 0.07 760673 0.00 0.00 addlist + 0.20 28.53 0.07 bin_w_int_pak + 0.17 28.59 0.06 26776263 0.00 0.00 get_param + 0.17 28.65 0.06 13259934 0.00 0.00 resourcename + 0.17 28.71 0.06 1826688 0.00 0.00 adjust_coordinates + 0.17 28.77 0.06 560965 0.00 0.00 bt_find_i + 0.17 28.83 0.06 209572 0.00 0.00 cr_borders + 0.17 28.89 0.06 108211 0.00 0.00 report_resources + 0.17 28.95 0.06 2 0.03 0.66 score + 0.17 29.01 0.06 2247 0.00 0.00 count_faction + 0.14 29.06 0.05 12560453 0.00 0.00 rc_changed + 0.14 29.11 0.05 7910500 0.00 0.00 r_isforest + 0.14 29.16 0.05 7179079 0.00 0.00 att_modification + 0.14 29.21 0.05 5329742 0.00 0.00 eatwhitespace_c + 0.14 29.26 0.05 2868601 0.00 0.00 u_irace + 0.14 29.31 0.05 2006524 0.00 0.00 get_command + 0.14 29.36 0.05 1929215 0.00 0.00 create_order_i + 0.14 29.41 0.05 1405457 0.00 0.00 report_items + 0.14 29.46 0.05 209572 0.00 0.00 building_owner_ex + 0.14 29.51 0.05 127676 0.00 0.00 describe + 0.14 29.56 0.05 96482 0.00 0.00 get_followers + 0.14 29.61 0.05 qli_init + 0.12 29.65 0.04 10053919 0.00 0.00 rtrees + 0.12 29.69 0.04 7851812 0.00 0.00 write_spaces + 0.12 29.73 0.04 6241702 0.00 0.00 eatwhite + 0.12 29.77 0.04 4625636 0.00 0.00 ffindhash + 0.12 29.81 0.04 4568249 0.00 0.00 find_variable + 0.12 29.85 0.04 4136059 0.00 0.00 mkname_buf + 0.12 29.89 0.04 3573165 0.00 0.00 cmp_faction + 0.12 29.93 0.04 2858912 0.00 0.00 get_effect + 0.12 29.97 0.04 1953682 0.00 0.00 spskill + 0.12 30.01 0.04 1644867 0.00 0.00 free_orders + 0.12 30.05 0.04 1010116 0.00 0.00 mt_find + 0.12 30.09 0.04 1006923 0.00 0.00 rfindhash + 0.12 30.13 0.04 841675 0.00 0.00 a_write + 0.12 30.17 0.04 178254 0.00 0.00 do_contact + 0.12 30.21 0.04 160206 0.00 0.00 monster_attacks + 0.12 30.25 0.04 3016 0.00 0.00 dfindhash + 0.12 30.29 0.04 1 0.04 0.09 ageing + 0.12 30.33 0.04 1 0.04 0.61 movement + 0.12 30.37 0.04 1 0.04 0.31 randomevents + 0.12 30.41 0.04 cb_find_prefix + 0.12 30.45 0.04 class_index_event + 0.12 30.49 0.04 fs_read + 0.12 30.53 0.04 pack_int + 0.12 30.57 0.04 ql_find + 0.12 30.61 0.04 tolua_unitlist_next + 0.12 30.65 0.04 unicode_ucs4_to_utf8 + 0.10 30.69 0.04 6907106 0.00 0.00 eff_skill + 0.10 30.72 0.04 7179154 0.00 0.00 get_modifier + 0.10 30.76 0.04 cb_get_kv + 0.09 30.79 0.03 21345834 0.00 0.00 skill_enabled + 0.09 30.82 0.03 13399069 0.00 0.00 balloc + 0.09 30.85 0.03 10375461 0.00 0.00 AllianceRestricted + 0.09 30.88 0.03 9232125 0.00 0.00 res_changeitem + 0.09 30.91 0.03 9170795 0.00 0.00 parse + 0.09 30.94 0.03 8302761 0.00 0.00 get_resource + 0.09 30.97 0.03 4851739 0.00 0.00 get_reservation + 0.09 31.00 0.03 4457785 0.00 0.00 transliterate + 0.09 31.03 0.03 2818494 0.00 0.00 rc_name + 0.09 31.06 0.03 2599554 0.00 0.00 change_money + 0.09 31.09 0.03 2277350 0.00 0.00 get_prefix + 0.09 31.12 0.03 1956810 0.00 0.00 add_skill + 0.09 31.15 0.03 1747682 0.00 0.00 cansee_durchgezogen + 0.09 31.18 0.03 1481616 0.00 0.00 get_keyword + 0.09 31.21 0.03 1348743 0.00 0.00 bufunit + 0.09 31.24 0.03 967784 0.00 0.00 msg_message + 0.09 31.27 0.03 779486 0.00 0.00 locale_getstring + 0.09 31.30 0.03 541982 0.00 0.00 get_pooled + 0.09 31.33 0.03 490896 0.00 0.00 default_wage + 0.09 31.36 0.03 417808 0.00 0.00 study_cmd + 0.09 31.39 0.03 372173 0.00 0.00 select_enemy + 0.09 31.42 0.03 301257 0.00 0.00 crt_find + 0.09 31.45 0.03 297010 0.00 0.00 bt_effsize + 0.09 31.48 0.03 195108 0.00 0.00 rps_nowrap + 0.09 31.51 0.03 130250 0.00 0.00 r_getmessages + 0.09 31.54 0.03 79180 0.00 0.00 rp_messages + 0.09 31.57 0.03 35287 0.00 0.00 prices + 0.09 31.60 0.03 13500 0.00 0.00 crew_skill + 0.09 31.63 0.03 10852 0.00 0.00 expandorders + 0.09 31.66 0.03 10846 0.00 0.00 scramble + 0.09 31.69 0.03 1 0.03 0.05 defaultorders + 0.09 31.72 0.03 1 0.03 0.05 demon_skillchanges + 0.09 31.75 0.03 1 0.03 0.06 dissolve_units + 0.09 31.78 0.03 1 0.03 0.03 move_hunters + 0.09 31.81 0.03 1 0.03 0.04 move_pirates + 0.09 31.84 0.03 1 0.03 0.03 reset_game + 0.09 31.87 0.03 a_select + 0.09 31.90 0.03 ql_foreachx + 0.06 31.92 0.02 24935046 0.00 0.00 faction_alive + 0.06 31.94 0.02 20836359 0.00 0.00 f_get_alliance + 0.06 31.96 0.02 20777534 0.00 0.00 config_get + 0.06 31.98 0.02 10375461 0.00 0.00 ally_mode + 0.06 32.00 0.02 9163148 0.00 0.00 golem_factor + 0.06 32.02 0.02 8452306 0.00 0.00 is_guardian_r + 0.06 32.04 0.02 7641081 0.00 0.00 genrand_int31 + 0.06 32.06 0.02 7417541 0.00 0.00 urace + 0.06 32.08 0.02 7179079 0.00 0.00 skill_mod + 0.06 32.10 0.02 4666665 0.00 0.00 rmoney + 0.06 32.12 0.02 4558423 0.00 0.00 get_translations + 0.06 32.14 0.02 3780355 0.00 0.00 nr_section + 0.06 32.16 0.02 3358315 0.00 0.00 ship_owner + 0.06 32.18 0.02 2903884 0.00 0.00 jenkins_hash + 0.06 32.20 0.02 2818494 0.00 0.00 rc_name_s + 0.06 32.22 0.02 2605004 0.00 0.00 rpeasants + 0.06 32.24 0.02 1996097 0.00 0.00 travelthru_cansee + 0.06 32.26 0.02 1929215 0.00 0.00 create_data + 0.06 32.28 0.02 1662377 0.00 0.00 get_unitrow + 0.06 32.30 0.02 1552289 0.00 0.00 rname + 0.06 32.32 0.02 1481407 0.00 0.00 parse_order + 0.06 32.34 0.02 1470505 0.00 0.00 write_order + 0.06 32.36 0.02 1344397 0.00 0.00 nr_unit + 0.06 32.38 0.02 1206547 0.00 0.00 findplane + 0.06 32.40 0.02 1188532 0.00 0.00 eff_stealth + 0.06 32.42 0.02 1177511 0.00 0.00 it_alias + 0.06 32.44 0.02 1121103 0.00 0.00 monster_is_waiting + 0.06 32.46 0.02 1054200 0.00 0.00 count_cb + 0.06 32.48 0.02 967902 0.00 0.00 cb_cr_travelthru_ship + 0.06 32.50 0.02 860166 0.00 0.00 weapon_effskill + 0.06 32.52 0.02 839202 0.00 0.00 a_age + 0.06 32.54 0.02 771861 0.00 0.00 armedmen + 0.06 32.56 0.02 742235 0.00 0.00 room_for_race_in_region + 0.06 32.58 0.02 688711 0.00 0.00 atoi36 + 0.06 32.60 0.02 635885 0.00 0.00 copy_order + 0.06 32.62 0.02 628037 0.00 0.00 read_items + 0.06 32.64 0.02 595898 0.00 0.00 follow_unit + 0.06 32.66 0.02 472366 0.00 0.00 produceexp_days + 0.06 32.68 0.02 418134 0.00 0.00 study_cost + 0.06 32.70 0.02 392959 0.00 0.00 add_message + 0.06 32.72 0.02 313244 0.00 0.00 check_overpopulated + 0.06 32.74 0.02 221802 0.00 0.00 unitorders + 0.06 32.76 0.02 178254 0.00 0.00 economics + 0.06 32.78 0.02 178254 0.00 0.00 hash_uid + 0.06 32.80 0.02 178254 0.00 0.00 reorder_units + 0.06 32.82 0.02 162996 0.00 0.00 inhabitable + 0.06 32.84 0.02 147217 0.00 0.00 normalvariate + 0.06 32.86 0.02 146997 0.00 0.00 term_eval + 0.06 32.88 0.02 62581 0.00 0.00 guards + 0.06 32.90 0.02 33139 0.00 0.00 statistics + 0.06 32.92 0.02 7964 0.00 0.00 nrt_string + 0.06 32.94 0.02 6963 0.00 0.00 move_ship + 0.06 32.96 0.02 3438 0.00 0.00 get_regions_distance + 0.06 32.98 0.02 388 0.00 0.00 internal_path_find + 0.06 33.00 0.02 231 0.00 0.00 faction_getmages + 0.06 33.02 0.02 30 0.00 0.00 config_set + 0.06 33.04 0.02 1 0.02 0.03 destroyfaction + 0.06 33.06 0.02 1 0.02 0.02 godcurse + 0.06 33.08 0.02 1 0.02 0.03 orc_growth + 0.06 33.10 0.02 1 0.02 0.03 restack_units + 0.06 33.12 0.02 1 0.02 0.02 spawn_dragons + 0.06 33.14 0.02 1 0.02 0.02 update_guards + 0.06 33.16 0.02 bin_w_brk + 0.06 33.18 0.02 bin_w_str + 0.06 33.20 0.02 fs_readln + 0.06 33.22 0.02 ql_push + 0.06 33.24 0.02 ql_set_insert_ex + 0.06 33.26 0.02 tolua_unit_get_faction + 0.06 33.28 0.02 wang_hash + 0.04 33.29 0.02 51003 0.00 0.00 give_money + 0.04 33.31 0.02 464 0.00 0.00 firstregion + 0.03 33.32 0.01 18647447 0.00 0.00 getplane + 0.03 33.33 0.01 10383360 0.00 0.00 HelpMask + 0.03 33.34 0.01 9298667 0.00 0.00 resource2item + 0.03 33.35 0.01 8506411 0.00 0.00 besieged + 0.03 33.36 0.01 7298034 0.00 0.00 skillmod + 0.03 33.37 0.01 5461936 0.00 0.00 slprintf + 0.03 33.38 0.01 5395063 0.00 0.00 i_get + 0.03 33.39 0.01 5152236 0.00 0.00 ct_changed + 0.03 33.40 0.01 5065285 0.00 0.00 get_param_int + 0.03 33.41 0.01 4984610 0.00 0.00 config_get_int + 0.03 33.42 0.01 4976082 0.00 0.00 find_function + 0.03 33.43 0.01 4835422 0.00 0.00 usiege + 0.03 33.44 0.01 4625636 0.00 0.00 findfaction + 0.03 33.45 0.01 4488684 0.00 0.00 crtag + 0.03 33.46 0.01 4374788 0.00 0.00 visible_faction + 0.03 33.47 0.01 4301501 0.00 0.00 statusrow + 0.03 33.48 0.01 4201030 0.00 0.00 curse_active + 0.03 33.49 0.01 4198692 0.00 0.00 lifestyle + 0.03 33.50 0.01 4133717 0.00 0.00 mkname + 0.03 33.51 0.01 3383689 0.00 0.00 update_interval + 0.03 33.52 0.01 2985733 0.00 0.00 is_repeated + 0.03 33.53 0.01 2934859 0.00 0.00 skillname + 0.03 33.54 0.01 2765718 0.00 0.00 maintenance_cost + 0.03 33.55 0.01 2494242 0.00 0.00 newline + 0.03 33.56 0.01 2481220 0.00 0.00 copy_arg + 0.03 33.57 0.01 2383101 0.00 0.00 unitname + 0.03 33.58 0.01 2281756 0.00 0.00 gettoken + 0.03 33.59 0.01 2275967 0.00 0.00 get_racename + 0.03 33.60 0.01 2275429 0.00 0.00 raceprefix + 0.03 33.61 0.01 2186159 0.00 0.00 rsetmoney + 0.03 33.62 0.01 2032164 0.00 0.00 rt_find + 0.03 33.63 0.01 1874928 0.00 0.00 terrain_name + 0.03 33.64 0.01 1751202 0.00 0.00 item_invis + 0.03 33.65 0.01 1629412 0.00 0.00 LongHunger + 0.03 33.66 0.01 1381157 0.00 0.00 unit_max_hp + 0.03 33.67 0.01 1351796 0.00 0.00 racename + 0.03 33.68 0.01 1336242 0.00 0.00 genrand_real2 + 0.03 33.69 0.01 1311302 0.00 0.00 init_tokens_str + 0.03 33.70 0.01 1205451 0.00 0.00 alliedfaction + 0.03 33.71 0.01 1106528 0.00 0.00 is_building_type + 0.03 33.72 0.01 1087065 0.00 0.00 get_neighbours + 0.03 33.73 0.01 1009159 0.00 0.00 log_orders + 0.03 33.74 0.01 996009 0.00 0.00 get_skill + 0.03 33.75 0.01 987612 0.00 0.00 getplanebyname + 0.03 33.76 0.01 967902 0.00 0.00 cb_cr_travelthru_unit + 0.03 33.77 0.01 950595 0.00 0.00 f_regionid + 0.03 33.78 0.01 923671 0.00 0.00 cr_output_unit_compat + 0.03 33.79 0.01 799427 0.00 0.00 eval_unit + 0.03 33.80 0.01 745269 0.00 0.00 add_seen_nb + 0.03 33.81 0.01 655564 0.00 0.00 eval_eq + 0.03 33.82 0.01 629123 0.00 0.00 write_items + 0.03 33.83 0.01 618305 0.00 0.00 escape_string + 0.03 33.84 0.01 610341 0.00 0.00 stream_order + 0.03 33.85 0.01 604861 0.00 0.00 write_unit_reference + 0.03 33.86 0.01 595896 0.00 0.00 update_long_order + 0.03 33.87 0.01 595125 0.00 0.00 read_unit + 0.03 33.88 0.01 593636 0.00 0.00 building_owner + 0.03 33.89 0.01 546579 0.00 0.00 weapon_skill + 0.03 33.90 0.01 454395 0.00 0.00 a_free + 0.03 33.91 0.01 451774 0.00 0.00 a_remove + 0.03 33.92 0.01 451774 0.00 0.00 a_unlink + 0.03 33.93 0.01 424669 0.00 0.00 active_building + 0.03 33.94 0.01 363135 0.00 0.00 select_opponent + 0.03 33.95 0.01 325825 0.00 0.00 scared_by_monster + 0.03 33.96 0.01 325282 0.00 0.00 eaten_by_monster + 0.03 33.97 0.01 302482 0.00 0.00 findtoken + 0.03 33.98 0.01 301257 0.00 0.00 cr_render + 0.03 33.99 0.01 300501 0.00 0.00 move_blocked + 0.03 34.00 0.01 283711 0.00 0.00 item2resource + 0.03 34.01 0.01 279395 0.00 0.00 weight + 0.03 34.02 0.01 264251 0.00 0.00 rsetpeasants + 0.03 34.03 0.01 263302 0.00 0.00 koor_reldirection + 0.03 34.04 0.01 251814 0.00 0.00 at_find + 0.03 34.05 0.01 218425 0.00 0.00 buildingtype + 0.03 34.06 0.01 209572 0.00 0.00 cr_output_region + 0.03 34.07 0.01 184870 0.00 0.00 buildingeffsize + 0.03 34.08 0.01 180598 0.00 0.00 nr_ship + 0.03 34.09 0.01 178263 0.00 0.00 drown + 0.03 34.10 0.01 178254 0.00 0.00 do_siege + 0.03 34.11 0.01 178254 0.00 0.00 maintain_buildings + 0.03 34.12 0.01 178254 0.00 0.00 sinkships + 0.03 34.13 0.01 178254 0.00 0.00 start_battle + 0.03 34.14 0.01 162862 0.00 0.00 allowed_dragon + 0.03 34.15 0.01 127676 0.00 0.00 write_travelthru + 0.03 34.16 0.01 116804 0.00 0.00 eval_isnull + 0.03 34.17 0.01 113845 0.00 0.00 choplist + 0.03 34.18 0.01 113592 0.00 0.00 nr_building + 0.03 34.19 0.01 105106 0.00 0.00 monster_move + 0.03 34.20 0.01 94420 0.00 0.00 add_give + 0.03 34.21 0.01 67213 0.00 0.00 eval_building + 0.03 34.22 0.01 65155 0.00 0.00 sm_familiar + 0.03 34.23 0.01 54530 0.00 0.00 a_insert + 0.03 34.24 0.01 47887 0.00 0.00 shipcapacity + 0.03 34.25 0.01 41095 0.00 0.00 cr_order + 0.03 34.26 0.01 40046 0.00 0.00 rule_stealth_other + 0.03 34.27 0.01 34486 0.00 0.00 effskill_study + 0.03 34.28 0.01 32727 0.00 0.00 rsetherbtype + 0.03 34.29 0.01 32670 0.00 0.00 horses + 0.03 34.30 0.01 27694 0.00 0.00 all_money + 0.03 34.31 0.01 25088 0.00 0.00 rmtroop + 0.03 34.32 0.01 20176 0.00 0.00 render_messages + 0.03 34.33 0.01 16132 0.00 0.00 teach_unit + 0.03 34.34 0.01 14326 0.00 0.00 replace_order + 0.03 34.35 0.01 11719 0.00 0.00 locale_name + 0.03 34.36 0.01 7255 0.00 0.00 sail + 0.03 34.37 0.01 5494 0.00 0.00 expandbuying + 0.03 34.38 0.01 3147 0.00 0.00 i_canuse + 0.03 34.39 0.01 2887 0.00 0.00 leave + 0.03 34.40 0.01 2838 0.00 0.00 do_attack + 0.03 34.41 0.01 1302 0.00 0.00 academy_can_teach + 0.03 34.42 0.01 1297 0.00 0.00 AllianceAuto + 0.03 34.43 0.01 1018 0.00 0.00 is_exclusive + 0.03 34.44 0.01 780 0.00 0.00 battle_report + 0.03 34.45 0.01 457 0.00 0.00 countheroes + 0.03 34.46 0.01 163 0.00 0.00 eval_lt + 0.03 34.47 0.01 150 0.00 0.00 set_factionstealth + 0.03 34.48 0.01 18 0.00 0.00 ship_update_owner + 0.03 34.49 0.01 6 0.00 0.02 remove_empty_units + 0.03 34.50 0.01 1 0.01 0.01 chaos_update + 0.03 34.51 0.01 1 0.01 0.01 create_icebergs + 0.03 34.52 0.01 1 0.01 0.01 free_params + 0.03 34.53 0.01 1 0.01 0.03 init_transportation + 0.03 34.54 0.01 1 0.01 0.11 magic + 0.03 34.55 0.01 1 0.01 0.01 move_icebergs + 0.03 34.56 0.01 1 0.01 0.03 regenerate_aura + 0.03 34.57 0.01 1 0.01 0.01 remove_empty_factions + 0.03 34.58 0.01 1 0.01 0.04 rotting_herbs + 0.03 34.59 0.01 1 0.01 0.35 write_game + 0.03 34.60 0.01 cb_insert + 0.03 34.61 0.01 cmp_curse + 0.03 34.62 0.01 create_backup + 0.03 34.63 0.01 ct_remove + 0.03 34.64 0.01 get_homeplane + 0.03 34.65 0.01 i10toi36 + 0.03 34.66 0.01 json_export + 0.03 34.67 0.01 make_external_node + 0.03 34.68 0.01 qli_next + 0.03 34.69 0.01 read_movement + 0.03 34.70 0.01 remove_plane + 0.03 34.71 0.01 set_string + 0.03 34.72 0.01 tolua_buildinglist_next + 0.03 34.73 0.01 tolua_regionlist_next + 0.03 34.74 0.01 tolua_tousertype + 0.01 34.74 0.01 cb_new_kv + 0.00 34.74 0.00 11194781 0.00 0.00 keyword_disabled + 0.00 34.74 0.00 7179079 0.00 0.00 rc_skillmod + 0.00 34.74 0.00 6656973 0.00 0.00 bfree + 0.00 34.74 0.00 6610983 0.00 0.00 is_guard + 0.00 34.74 0.00 5100840 0.00 0.00 itoa36 + 0.00 34.74 0.00 4503145 0.00 0.00 omniscient + 0.00 34.74 0.00 3902879 0.00 0.00 get_or_create_monsters + 0.00 34.74 0.00 3902878 0.00 0.00 get_monsters + 0.00 34.74 0.00 3656767 0.00 0.00 add_variable + 0.00 34.74 0.00 3587241 0.00 0.00 pnormalize + 0.00 34.74 0.00 3351853 0.00 0.00 unit_getname + 0.00 34.74 0.00 3166898 0.00 0.00 rherbs + 0.00 34.74 0.00 2426021 0.00 0.00 get_mage + 0.00 34.74 0.00 2386892 0.00 0.00 config_changed + 0.00 34.74 0.00 2383101 0.00 0.00 write_unitname + 0.00 34.74 0.00 2379316 0.00 0.00 resource2weapon + 0.00 34.74 0.00 2272376 0.00 0.00 u_description + 0.00 34.74 0.00 2225796 0.00 0.00 get_borders + 0.00 34.74 0.00 2155959 0.00 0.00 is_persistent + 0.00 34.74 0.00 2124526 0.00 0.00 locale_index + 0.00 34.74 0.00 2066777 0.00 0.00 parse_token_depr + 0.00 34.74 0.00 2009097 0.00 0.00 keyword + 0.00 34.74 0.00 1936876 0.00 0.00 free_order + 0.00 34.74 0.00 1787006 0.00 0.00 findparam + 0.00 34.74 0.00 1785077 0.00 0.00 faction_getorigin + 0.00 34.74 0.00 1771752 0.00 0.00 help_money + 0.00 34.74 0.00 1766225 0.00 0.00 nr_curses_i + 0.00 34.74 0.00 1753922 0.00 0.00 invisible + 0.00 34.74 0.00 1726748 0.00 0.00 is_riding + 0.00 34.74 0.00 1613387 0.00 0.00 rule_region_owners + 0.00 34.74 0.00 1523708 0.00 0.00 uprivate + 0.00 34.74 0.00 1511812 0.00 0.00 newterrain + 0.00 34.74 0.00 1474687 0.00 0.00 leftship + 0.00 34.74 0.00 1441945 0.00 0.00 is_mage + 0.00 34.74 0.00 1380398 0.00 0.00 brelease + 0.00 34.74 0.00 1380398 0.00 0.00 free_variables + 0.00 34.74 0.00 1380398 0.00 0.00 nr_render + 0.00 34.74 0.00 1380007 0.00 0.00 get_otherfaction + 0.00 34.74 0.00 1342832 0.00 0.00 handle_event + 0.00 34.74 0.00 1342381 0.00 0.00 release_data + 0.00 34.74 0.00 1336242 0.00 0.00 rng_injectable_double + 0.00 34.74 0.00 1295787 0.00 0.00 factionname + 0.00 34.74 0.00 1291427 0.00 0.00 set_order + 0.00 34.74 0.00 1252028 0.00 0.00 mkdata + 0.00 34.74 0.00 1218663 0.00 0.00 select_weapon + 0.00 34.74 0.00 1214628 0.00 0.00 is_allied + 0.00 34.74 0.00 1177511 0.00 0.00 it_find + 0.00 34.74 0.00 1160345 0.00 0.00 rhorses + 0.00 34.74 0.00 1158076 0.00 0.00 getbuf + 0.00 34.74 0.00 1132609 0.00 0.00 is_long + 0.00 34.74 0.00 1067195 0.00 0.00 free_arg + 0.00 34.74 0.00 1065211 0.00 0.00 shipname + 0.00 34.74 0.00 1065211 0.00 0.00 write_shipname + 0.00 34.74 0.00 1048274 0.00 0.00 cb_write_travelthru + 0.00 34.74 0.00 1027665 0.00 0.00 init_order + 0.00 34.74 0.00 1014205 0.00 0.00 add_seen + 0.00 34.74 0.00 1009159 0.00 0.00 msg_create + 0.00 34.74 0.00 1009028 0.00 0.00 msg_release + 0.00 34.74 0.00 987612 0.00 0.00 get_astralplane + 0.00 34.74 0.00 987488 0.00 0.00 is_astral + 0.00 34.74 0.00 987128 0.00 0.00 strlcat + 0.00 34.74 0.00 931076 0.00 0.00 change_resource + 0.00 34.74 0.00 892307 0.00 0.00 learn_skill + 0.00 34.74 0.00 888603 0.00 0.00 findunit + 0.00 34.74 0.00 884940 0.00 0.00 itoa10 + 0.00 34.74 0.00 883617 0.00 0.00 eval_int + 0.00 34.74 0.00 876979 0.00 0.00 count_enemies + 0.00 34.74 0.00 868104 0.00 0.00 select_armor + 0.00 34.74 0.00 843545 0.00 0.00 eval_if + 0.00 34.74 0.00 840577 0.00 0.00 a_read_orig + 0.00 34.74 0.00 840577 0.00 0.00 read_attribs + 0.00 34.74 0.00 839970 0.00 0.00 write_attribs + 0.00 34.74 0.00 832876 0.00 0.00 parse_int + 0.00 34.74 0.00 822780 0.00 0.00 i_new + 0.00 34.74 0.00 797288 0.00 0.00 can_survive + 0.00 34.74 0.00 785221 0.00 0.00 trailinto + 0.00 34.74 0.00 779868 0.00 0.00 a_new + 0.00 34.74 0.00 779419 0.00 0.00 a_add + 0.00 34.74 0.00 778818 0.00 0.00 describe_race + 0.00 34.74 0.00 773191 0.00 0.00 hp_status + 0.00 34.74 0.00 755575 0.00 0.00 cb_add_address + 0.00 34.74 0.00 754589 0.00 0.00 preferred_weapon + 0.00 34.74 0.00 752645 0.00 0.00 chance + 0.00 34.74 0.00 748527 0.00 0.00 unit_can_study + 0.00 34.74 0.00 744202 0.00 0.00 has_horses + 0.00 34.74 0.00 734392 0.00 0.00 plane_height + 0.00 34.74 0.00 734392 0.00 0.00 plane_width + 0.00 34.74 0.00 717287 0.00 0.00 get_param_flt + 0.00 34.74 0.00 717218 0.00 0.00 config_get_flt + 0.00 34.74 0.00 669051 0.00 0.00 production + 0.00 34.74 0.00 651711 0.00 0.00 oldcursename + 0.00 34.74 0.00 647569 0.00 0.00 write_faction_reference + 0.00 34.74 0.00 642406 0.00 0.00 write_building_reference + 0.00 34.74 0.00 633429 0.00 0.00 msg_free + 0.00 34.74 0.00 619425 0.00 0.00 getreload + 0.00 34.74 0.00 617313 0.00 0.00 attack + 0.00 34.74 0.00 615299 0.00 0.00 write_ship_reference + 0.00 34.74 0.00 607926 0.00 0.00 writeorder + 0.00 34.74 0.00 603524 0.00 0.00 set_number + 0.00 34.74 0.00 603246 0.00 0.00 level_days + 0.00 34.74 0.00 600145 0.00 0.00 u_setrace + 0.00 34.74 0.00 599650 0.00 0.00 setstatus + 0.00 34.74 0.00 598234 0.00 0.00 report_status + 0.00 34.74 0.00 598129 0.00 0.00 u_setfaction + 0.00 34.74 0.00 598069 0.00 0.00 uhash + 0.00 34.74 0.00 597806 0.00 0.00 unit_get_spellbook + 0.00 34.74 0.00 595705 0.00 0.00 unit_skill + 0.00 34.74 0.00 595478 0.00 0.00 monster_kills_peasants + 0.00 34.74 0.00 595472 0.00 0.00 age_unit + 0.00 34.74 0.00 578591 0.00 0.00 heal_factor + 0.00 34.74 0.00 560926 0.00 0.00 bt_find + 0.00 34.74 0.00 534930 0.00 0.00 isparam + 0.00 34.74 0.00 534762 0.00 0.00 enter_1 + 0.00 34.74 0.00 515911 0.00 0.00 write_regionname + 0.00 34.74 0.00 515550 0.00 0.00 eval_region + 0.00 34.74 0.00 515192 0.00 0.00 is_mourning + 0.00 34.74 0.00 515192 0.00 0.00 owner_change + 0.00 34.74 0.00 514146 0.00 0.00 koor_distance + 0.00 34.74 0.00 512663 0.00 0.00 koor_distance_orig + 0.00 34.74 0.00 508632 0.00 0.00 rule_blessed_harvest + 0.00 34.74 0.00 494960 0.00 0.00 buforder + 0.00 34.74 0.00 490901 0.00 0.00 largestbuilding + 0.00 34.74 0.00 490896 0.00 0.00 wage + 0.00 34.74 0.00 472418 0.00 0.00 produceexp + 0.00 34.74 0.00 472418 0.00 0.00 produceexp_ex + 0.00 34.74 0.00 470529 0.00 0.00 eval_resource + 0.00 34.74 0.00 459083 0.00 0.00 findregion + 0.00 34.74 0.00 447808 0.00 0.00 create_order + 0.00 34.74 0.00 438629 0.00 0.00 maxworkingpeasants + 0.00 34.74 0.00 435022 0.00 0.00 getskill + 0.00 34.74 0.00 432940 0.00 0.00 curse_geteffect + 0.00 34.74 0.00 417580 0.00 0.00 init_learning + 0.00 34.74 0.00 417577 0.00 0.00 done_learning + 0.00 34.74 0.00 417577 0.00 0.00 study_days + 0.00 34.74 0.00 417577 0.00 0.00 study_speedup + 0.00 34.74 0.00 417554 0.00 0.00 random_move_chance + 0.00 34.74 0.00 396305 0.00 0.00 cmp_wage + 0.00 34.74 0.00 392959 0.00 0.00 msg_addref + 0.00 34.74 0.00 386740 0.00 0.00 cr_output_curses_compat + 0.00 34.74 0.00 377253 0.00 0.00 guard_flags + 0.00 34.74 0.00 374425 0.00 0.00 i_free + 0.00 34.74 0.00 369586 0.00 0.00 r_connect + 0.00 34.74 0.00 363071 0.00 0.00 hits + 0.00 34.74 0.00 355423 0.00 0.00 deathcount + 0.00 34.74 0.00 353788 0.00 0.00 add_seen_faction_i + 0.00 34.74 0.00 353422 0.00 0.00 contest + 0.00 34.74 0.00 353422 0.00 0.00 contest_classic + 0.00 34.74 0.00 353422 0.00 0.00 skilldiff + 0.00 34.74 0.00 348444 0.00 0.00 report_resource + 0.00 34.74 0.00 337987 0.00 0.00 setguard + 0.00 34.74 0.00 330438 0.00 0.00 cr_unit + 0.00 34.74 0.00 329691 0.00 0.00 getguard + 0.00 34.74 0.00 317735 0.00 0.00 monster_learn + 0.00 34.74 0.00 317239 0.00 0.00 count_side + 0.00 34.74 0.00 308950 0.00 0.00 r_demand + 0.00 34.74 0.00 300810 0.00 0.00 count_enemies_i + 0.00 34.74 0.00 298951 0.00 0.00 distance + 0.00 34.74 0.00 297222 0.00 0.00 messagehash + 0.00 34.74 0.00 293362 0.00 0.00 get_direction + 0.00 34.74 0.00 285923 0.00 0.00 ualias + 0.00 34.74 0.00 284005 0.00 0.00 read_unitid + 0.00 34.74 0.00 282847 0.00 0.00 getunit + 0.00 34.74 0.00 279072 0.00 0.00 cr_int + 0.00 34.74 0.00 263302 0.00 0.00 reldirection + 0.00 34.74 0.00 257723 0.00 0.00 i_remove + 0.00 34.74 0.00 257693 0.00 0.00 rsethorses + 0.00 34.74 0.00 252446 0.00 0.00 movewhere + 0.00 34.74 0.00 251874 0.00 0.00 __at_hashkey + 0.00 34.74 0.00 251867 0.00 0.00 attacks_per_round + 0.00 34.74 0.00 251814 0.00 0.00 a_read_i + 0.00 34.74 0.00 229715 0.00 0.00 rsettrees + 0.00 34.74 0.00 228907 0.00 0.00 getid + 0.00 34.74 0.00 221899 0.00 0.00 findunitg + 0.00 34.74 0.00 221723 0.00 0.00 plane_center_x + 0.00 34.74 0.00 221723 0.00 0.00 plane_center_y + 0.00 34.74 0.00 218422 0.00 0.00 report_building + 0.00 34.74 0.00 217696 0.00 0.00 can_give + 0.00 34.74 0.00 217405 0.00 0.00 r_setdemand + 0.00 34.74 0.00 216069 0.00 0.00 check_param + 0.00 34.74 0.00 216069 0.00 0.00 config_token + 0.00 34.74 0.00 209572 0.00 0.00 cr_region_header + 0.00 34.74 0.00 204314 0.00 0.00 bt_changed + 0.00 34.74 0.00 203117 0.00 0.00 atoip + 0.00 34.74 0.00 201744 0.00 0.00 lovar + 0.00 34.74 0.00 196476 0.00 0.00 b_finvisible + 0.00 34.74 0.00 196476 0.00 0.00 b_rvisibleroad + 0.00 34.74 0.00 192815 0.00 0.00 add_regionlist + 0.00 34.74 0.00 192556 0.00 0.00 canride + 0.00 34.74 0.00 191379 0.00 0.00 finditemtype + 0.00 34.74 0.00 190469 0.00 0.00 border_name + 0.00 34.74 0.00 190467 0.00 0.00 b_nameroad + 0.00 34.74 0.00 190467 0.00 0.00 b_transparent + 0.00 34.74 0.00 189341 0.00 0.00 rule_autowork + 0.00 34.74 0.00 180818 0.00 0.00 buildingname + 0.00 34.74 0.00 180818 0.00 0.00 write_buildingname + 0.00 34.74 0.00 179761 0.00 0.00 cr_output_ship + 0.00 34.74 0.00 179235 0.00 0.00 get_chaoscount + 0.00 34.74 0.00 178429 0.00 0.00 a_removeall + 0.00 34.74 0.00 178322 0.00 0.00 terrain_find_i + 0.00 34.74 0.00 178311 0.00 0.00 region_setinfo + 0.00 34.74 0.00 178290 0.00 0.00 rhash + 0.00 34.74 0.00 178270 0.00 0.00 get_terrain + 0.00 34.74 0.00 178257 0.00 0.00 key_get + 0.00 34.74 0.00 178255 0.00 0.00 good_region + 0.00 34.74 0.00 178254 0.00 0.00 age_piracy + 0.00 34.74 0.00 178254 0.00 0.00 age_region + 0.00 34.74 0.00 178254 0.00 0.00 age_traveldir + 0.00 34.74 0.00 178254 0.00 0.00 do_battle + 0.00 34.74 0.00 178254 0.00 0.00 drifting_ships + 0.00 34.74 0.00 178254 0.00 0.00 enter_2 + 0.00 34.74 0.00 178254 0.00 0.00 expandwork + 0.00 34.74 0.00 178254 0.00 0.00 live + 0.00 34.74 0.00 178254 0.00 0.00 new_region + 0.00 34.74 0.00 178254 0.00 0.00 produce + 0.00 34.74 0.00 178254 0.00 0.00 readregion + 0.00 34.74 0.00 178254 0.00 0.00 region_getinfo + 0.00 34.74 0.00 178254 0.00 0.00 split_allocations + 0.00 34.74 0.00 178254 0.00 0.00 writeregion + 0.00 34.74 0.00 174968 0.00 0.00 get_familiar_mage + 0.00 34.74 0.00 174677 0.00 0.00 cr_output_resource + 0.00 34.74 0.00 169733 0.00 0.00 travelthru_add + 0.00 34.74 0.00 163027 0.00 0.00 markets_module + 0.00 34.74 0.00 157830 0.00 0.00 allowed_fly + 0.00 34.74 0.00 154110 0.00 0.00 rule_stealth_anon + 0.00 34.74 0.00 152803 0.00 0.00 free_node + 0.00 34.74 0.00 152803 0.00 0.00 new_node + 0.00 34.74 0.00 152504 0.00 0.00 plain_name + 0.00 34.74 0.00 147171 0.00 0.00 building_finished + 0.00 34.74 0.00 146997 0.00 0.00 dice_rand + 0.00 34.74 0.00 146950 0.00 0.00 f_regionid_s + 0.00 34.74 0.00 143730 0.00 0.00 rroad + 0.00 34.74 0.00 141675 0.00 0.00 mknode + 0.00 34.74 0.00 140305 0.00 0.00 set_resvalue + 0.00 34.74 0.00 137709 0.00 0.00 CavalryBonus + 0.00 34.74 0.00 133873 0.00 0.00 cr_region + 0.00 34.74 0.00 131765 0.00 0.00 give_control_cmd + 0.00 34.74 0.00 131722 0.00 0.00 give_cmd + 0.00 34.74 0.00 130867 0.00 0.00 get_transporters + 0.00 34.74 0.00 128596 0.00 0.00 check_errno + 0.00 34.74 0.00 128135 0.00 0.00 rpline + 0.00 34.74 0.00 127788 0.00 0.00 eval_direction + 0.00 34.74 0.00 127674 0.00 0.00 eval_trailto + 0.00 34.74 0.00 123744 0.00 0.00 arg_set + 0.00 34.74 0.00 123513 0.00 0.00 eval_order + 0.00 34.74 0.00 116914 0.00 0.00 fleechance + 0.00 34.74 0.00 116914 0.00 0.00 horse_fleeing_bonus + 0.00 34.74 0.00 116002 0.00 0.00 get_movement + 0.00 34.74 0.00 115276 0.00 0.00 can_move + 0.00 34.74 0.00 113844 0.00 0.00 translist + 0.00 34.74 0.00 113487 0.00 0.00 next_region + 0.00 34.74 0.00 112140 0.00 0.00 castle_name + 0.00 34.74 0.00 112140 0.00 0.00 castle_name_i + 0.00 34.74 0.00 110533 0.00 0.00 weapon_weight + 0.00 34.74 0.00 110167 0.00 0.00 cr_resource + 0.00 34.74 0.00 109785 0.00 0.00 move_unit + 0.00 34.74 0.00 109377 0.00 0.00 free_regionlist + 0.00 34.74 0.00 108560 0.00 0.00 eval_trail + 0.00 34.74 0.00 108335 0.00 0.00 roadto + 0.00 34.74 0.00 106919 0.00 0.00 mark_travelthru + 0.00 34.74 0.00 106798 0.00 0.00 help_feed + 0.00 34.74 0.00 105958 0.00 0.00 entrance_allowed + 0.00 34.74 0.00 104830 0.00 0.00 cr_output_building + 0.00 34.74 0.00 103784 0.00 0.00 move_cmd + 0.00 34.74 0.00 103187 0.00 0.00 cycle_route + 0.00 34.74 0.00 103079 0.00 0.00 rule_give + 0.00 34.74 0.00 102761 0.00 0.00 check_give + 0.00 34.74 0.00 102705 0.00 0.00 can_give_to + 0.00 34.74 0.00 102149 0.00 0.00 cr_output_travelthru + 0.00 34.74 0.00 101322 0.00 0.00 rsetherbs + 0.00 34.74 0.00 96637 0.00 0.00 personcapacity + 0.00 34.74 0.00 96637 0.00 0.00 walkingcapacity + 0.00 34.74 0.00 96555 0.00 0.00 canwalk + 0.00 34.74 0.00 96555 0.00 0.00 travel_i + 0.00 34.74 0.00 96529 0.00 0.00 travel + 0.00 34.74 0.00 96527 0.00 0.00 make_route + 0.00 34.74 0.00 96482 0.00 0.00 travel_route + 0.00 34.74 0.00 96450 0.00 0.00 cap_route + 0.00 34.74 0.00 96450 0.00 0.00 movement_speed + 0.00 34.74 0.00 96208 0.00 0.00 var_copy_regions + 0.00 34.74 0.00 95593 0.00 0.00 can_leave + 0.00 34.74 0.00 95533 0.00 0.00 give_item + 0.00 34.74 0.00 93452 0.00 0.00 see_border + 0.00 34.74 0.00 93120 0.00 0.00 change_reservation + 0.00 34.74 0.00 93119 0.00 0.00 give_quota + 0.00 34.74 0.00 93119 0.00 0.00 limited_give + 0.00 34.74 0.00 87004 0.00 0.00 i_add + 0.00 34.74 0.00 86400 0.00 0.00 spell_name + 0.00 34.74 0.00 84017 0.00 0.00 random_neighbour + 0.00 34.74 0.00 83859 0.00 0.00 reduce_weight + 0.00 34.74 0.00 83224 0.00 0.00 trollbelts + 0.00 34.74 0.00 80630 0.00 0.00 armor_bonus + 0.00 34.74 0.00 80630 0.00 0.00 calculate_armor + 0.00 34.74 0.00 80630 0.00 0.00 natural_armor + 0.00 34.74 0.00 80630 0.00 0.00 select_magicarmor + 0.00 34.74 0.00 80630 0.00 0.00 terminate + 0.00 34.74 0.00 79772 0.00 0.00 entertainmoney + 0.00 34.74 0.00 75797 0.00 0.00 buildingtype_exists + 0.00 34.74 0.00 72692 0.00 0.00 rc_specialdamage + 0.00 34.74 0.00 71416 0.00 0.00 reserve_i + 0.00 34.74 0.00 70836 0.00 0.00 is_guardian_u + 0.00 34.74 0.00 69432 0.00 0.00 getparam + 0.00 34.74 0.00 66134 0.00 0.00 shipspeed + 0.00 34.74 0.00 66058 0.00 0.00 ShipSpeedBonus + 0.00 34.74 0.00 65345 0.00 0.00 region_get_morale + 0.00 34.74 0.00 62267 0.00 0.00 get_migrants + 0.00 34.74 0.00 61961 0.00 0.00 cr_output_messages + 0.00 34.74 0.00 59694 0.00 0.00 r_insectstalled + 0.00 34.74 0.00 58524 0.00 0.00 a_writeint + 0.00 34.74 0.00 58518 0.00 0.00 a_readint + 0.00 34.74 0.00 57367 0.00 0.00 count_travelthru + 0.00 34.74 0.00 57138 0.00 0.00 getint + 0.00 34.74 0.00 56646 0.00 0.00 write_group + 0.00 34.74 0.00 56643 0.00 0.00 groupid + 0.00 34.74 0.00 56503 0.00 0.00 find_group + 0.00 34.74 0.00 56503 0.00 0.00 read_group + 0.00 34.74 0.00 55547 0.00 0.00 ally_add + 0.00 34.74 0.00 55350 0.00 0.00 can_start_guarding + 0.00 34.74 0.00 54735 0.00 0.00 init_cb + 0.00 34.74 0.00 54351 0.00 0.00 get_familiar + 0.00 34.74 0.00 54318 0.00 0.00 getstrtoken + 0.00 34.74 0.00 54163 0.00 0.00 var_copy_string + 0.00 34.74 0.00 51239 0.00 0.00 read_faction_reference + 0.00 34.74 0.00 51060 0.00 0.00 remove_skill + 0.00 34.74 0.00 50673 0.00 0.00 update_resources + 0.00 34.74 0.00 49331 0.00 0.00 _log_write + 0.00 34.74 0.00 49331 0.00 0.00 log_prefix + 0.00 34.74 0.00 49331 0.00 0.00 log_stdio + 0.00 34.74 0.00 49317 0.00 0.00 log_write + 0.00 34.74 0.00 49235 0.00 0.00 log_debug + 0.00 34.74 0.00 48565 0.00 0.00 u_set_building + 0.00 34.74 0.00 48457 0.00 0.00 bfindhash + 0.00 34.74 0.00 48455 0.00 0.00 findbuilding + 0.00 34.74 0.00 47562 0.00 0.00 rule_random_progress + 0.00 34.74 0.00 47562 0.00 0.00 skill_weeks + 0.00 34.74 0.00 47535 0.00 0.00 sk_set + 0.00 34.74 0.00 47287 0.00 0.00 canswim + 0.00 34.74 0.00 46742 0.00 0.00 findregionbyid + 0.00 34.74 0.00 46224 0.00 0.00 eval_faction + 0.00 34.74 0.00 46196 0.00 0.00 bhash + 0.00 34.74 0.00 46184 0.00 0.00 age_building + 0.00 34.74 0.00 45891 0.00 0.00 get_level + 0.00 34.74 0.00 45860 0.00 0.00 print_items + 0.00 34.74 0.00 45630 0.00 0.00 cr_output_resources + 0.00 34.74 0.00 44216 0.00 0.00 flying_ship + 0.00 34.74 0.00 44190 0.00 0.00 maintain + 0.00 34.74 0.00 41882 0.00 0.00 GiveRestriction + 0.00 34.74 0.00 41255 0.00 0.00 var_copy_order + 0.00 34.74 0.00 41248 0.00 0.00 msg_feedback + 0.00 34.74 0.00 40692 0.00 0.00 get_gamedate + 0.00 34.74 0.00 40099 0.00 0.00 eval_skill + 0.00 34.74 0.00 39955 0.00 0.00 write_of + 0.00 34.74 0.00 39926 0.00 0.00 check_leuchtturm + 0.00 34.74 0.00 39836 0.00 0.00 read_of + 0.00 34.74 0.00 39810 0.00 0.00 check_ship_allowed + 0.00 34.74 0.00 37974 0.00 0.00 deathcounts + 0.00 34.74 0.00 37931 0.00 0.00 centre + 0.00 34.74 0.00 37453 0.00 0.00 shiptrail_age + 0.00 34.74 0.00 37453 0.00 0.00 shiptrail_init + 0.00 34.74 0.00 37202 0.00 0.00 var_free_string + 0.00 34.74 0.00 37024 0.00 0.00 b_blocknone + 0.00 34.74 0.00 35708 0.00 0.00 reserve_cmd + 0.00 34.74 0.00 35708 0.00 0.00 reserve_self + 0.00 34.74 0.00 34565 0.00 0.00 ur_add + 0.00 34.74 0.00 34420 0.00 0.00 a_writeshorts + 0.00 34.74 0.00 34409 0.00 0.00 add_income + 0.00 34.74 0.00 34382 0.00 0.00 a_readshorts + 0.00 34.74 0.00 34221 0.00 0.00 eff_weight + 0.00 34.74 0.00 34220 0.00 0.00 shiptrail_read + 0.00 34.74 0.00 32727 0.00 0.00 region_set_morale + 0.00 34.74 0.00 32679 0.00 0.00 read_owner + 0.00 34.74 0.00 32679 0.00 0.00 rule_auto_taxation + 0.00 34.74 0.00 32670 0.00 0.00 calculate_emigration + 0.00 34.74 0.00 32670 0.00 0.00 growing_herbs + 0.00 34.74 0.00 32670 0.00 0.00 growing_trees + 0.00 34.74 0.00 32670 0.00 0.00 migrate + 0.00 34.74 0.00 32670 0.00 0.00 morale_update + 0.00 34.74 0.00 32670 0.00 0.00 peasants + 0.00 34.74 0.00 32670 0.00 0.00 write_owner + 0.00 34.74 0.00 31688 0.00 0.00 cr_building + 0.00 34.74 0.00 31214 0.00 0.00 message_faction + 0.00 34.74 0.00 30872 0.00 0.00 resolve_faction + 0.00 34.74 0.00 30634 0.00 0.00 guard_off_cmd + 0.00 34.74 0.00 30554 0.00 0.00 guard_on_cmd + 0.00 34.74 0.00 30308 0.00 0.00 peasant_growth_factor + 0.00 34.74 0.00 30250 0.00 0.00 peasant_luck_effect + 0.00 34.74 0.00 30150 0.00 0.00 ship_damage_percent + 0.00 34.74 0.00 28818 0.00 0.00 findship + 0.00 34.74 0.00 28818 0.00 0.00 sfindhash + 0.00 34.74 0.00 27694 0.00 0.00 dice + 0.00 34.74 0.00 27694 0.00 0.00 dragon_affinity_value + 0.00 34.74 0.00 27640 0.00 0.00 u_set_ship + 0.00 34.74 0.00 26995 0.00 0.00 inside_building + 0.00 34.74 0.00 26515 0.00 0.00 b_uinvisible + 0.00 34.74 0.00 26164 0.00 0.00 building_is_active + 0.00 34.74 0.00 26045 0.00 0.00 curse_cansee + 0.00 34.74 0.00 26045 0.00 0.00 msg_curse + 0.00 34.74 0.00 25857 0.00 0.00 eval_int36 + 0.00 34.74 0.00 25441 0.00 0.00 rmt_find + 0.00 34.74 0.00 25088 0.00 0.00 kill_troop + 0.00 34.74 0.00 25088 0.00 0.00 rmfighter + 0.00 34.74 0.00 24449 0.00 0.00 seematrix + 0.00 34.74 0.00 23781 0.00 0.00 guard + 0.00 34.74 0.00 23342 0.00 0.00 shiptrail_finalize + 0.00 34.74 0.00 23233 0.00 0.00 cr_faction + 0.00 34.74 0.00 22843 0.00 0.00 parser_end + 0.00 34.74 0.00 22644 0.00 0.00 new_border + 0.00 34.74 0.00 22643 0.00 0.00 b_validroad + 0.00 34.74 0.00 22643 0.00 0.00 b_writeroad + 0.00 34.74 0.00 22638 0.00 0.00 find_bordertype + 0.00 34.74 0.00 22637 0.00 0.00 b_readroad + 0.00 34.74 0.00 22301 0.00 0.00 army_index + 0.00 34.74 0.00 21517 0.00 0.00 chaosfactor + 0.00 34.74 0.00 21500 0.00 0.00 resource2luxury + 0.00 34.74 0.00 21443 0.00 0.00 ridingcapacity + 0.00 34.74 0.00 20072 0.00 0.00 cr_skill + 0.00 34.74 0.00 19671 0.00 0.00 buildingcapacity + 0.00 34.74 0.00 19545 0.00 0.00 eval_ship + 0.00 34.74 0.00 19089 0.00 0.00 st_find_i + 0.00 34.74 0.00 19085 0.00 0.00 shash + 0.00 34.74 0.00 19082 0.00 0.00 st_find + 0.00 34.74 0.00 18971 0.00 0.00 building_set_owner + 0.00 34.74 0.00 18963 0.00 0.00 ship_set_owner + 0.00 34.74 0.00 18788 0.00 0.00 sideabkz + 0.00 34.74 0.00 18059 0.00 0.00 add_chaoscount + 0.00 34.74 0.00 17289 0.00 0.00 parser_popstate + 0.00 34.74 0.00 17289 0.00 0.00 parser_pushstate + 0.00 34.74 0.00 16751 0.00 0.00 getuint + 0.00 34.74 0.00 16737 0.00 0.00 dir_invert + 0.00 34.74 0.00 16669 0.00 0.00 IsImmune + 0.00 34.74 0.00 16596 0.00 0.00 entertain_cmd + 0.00 34.74 0.00 16493 0.00 0.00 NewbieImmunity + 0.00 34.74 0.00 16191 0.00 0.00 add_donation + 0.00 34.74 0.00 16132 0.00 0.00 magic_lowskill + 0.00 34.74 0.00 15797 0.00 0.00 sell + 0.00 34.74 0.00 15708 0.00 0.00 add_travelthru_addresses + 0.00 34.74 0.00 15361 0.00 0.00 is_guarded + 0.00 34.74 0.00 15359 0.00 0.00 cinfo_building + 0.00 34.74 0.00 15240 0.00 0.00 msg_error + 0.00 34.74 0.00 15102 0.00 0.00 cmistake + 0.00 34.74 0.00 14994 0.00 0.00 cr_string + 0.00 34.74 0.00 14191 0.00 0.00 flee + 0.00 34.74 0.00 14111 0.00 0.00 shiptrail_write + 0.00 34.74 0.00 13500 0.00 0.00 enoughsailors + 0.00 34.74 0.00 12933 0.00 0.00 owner_buildingtyp + 0.00 34.74 0.00 12407 0.00 0.00 cr_regions + 0.00 34.74 0.00 12398 0.00 0.00 fbattlerecord + 0.00 34.74 0.00 12265 0.00 0.00 r_addmessage + 0.00 34.74 0.00 11989 0.00 0.00 resolve_unit + 0.00 34.74 0.00 11880 0.00 0.00 cansee_unit + 0.00 34.74 0.00 11599 0.00 0.00 building_protection + 0.00 34.74 0.00 11540 0.00 0.00 absorbed_by_monster + 0.00 34.74 0.00 11159 0.00 0.00 expandentertainment + 0.00 34.74 0.00 11087 0.00 0.00 do_work + 0.00 34.74 0.00 11052 0.00 0.00 find_spell + 0.00 34.74 0.00 11052 0.00 0.00 sp_alias + 0.00 34.74 0.00 10600 0.00 0.00 make_cmd + 0.00 34.74 0.00 10475 0.00 0.00 i_freeall + 0.00 34.74 0.00 10417 0.00 0.00 free_luxuries + 0.00 34.74 0.00 10344 0.00 0.00 cansail + 0.00 34.74 0.00 10232 0.00 0.00 update_lighthouse + 0.00 34.74 0.00 9763 0.00 0.00 read_reference + 0.00 34.74 0.00 9680 0.00 0.00 bewegung_blockiert_von + 0.00 34.74 0.00 9352 0.00 0.00 write_spell_modifier + 0.00 34.74 0.00 9147 0.00 0.00 merge_messages + 0.00 34.74 0.00 9147 0.00 0.00 split_messages + 0.00 34.74 0.00 8993 0.00 0.00 addtoken + 0.00 34.74 0.00 8962 0.00 0.00 hpflee + 0.00 34.74 0.00 8898 0.00 0.00 ucontact + 0.00 34.74 0.00 8892 0.00 0.00 astralregions + 0.00 34.74 0.00 8892 0.00 0.00 r_astral_to_standard + 0.00 34.74 0.00 8788 0.00 0.00 xml_cleanup_string + 0.00 34.74 0.00 8622 0.00 0.00 read_unit_reference + 0.00 34.74 0.00 8191 0.00 0.00 read_seenspell + 0.00 34.74 0.00 8187 0.00 0.00 write_seenspell + 0.00 34.74 0.00 8034 0.00 0.00 u_geteffstealth + 0.00 34.74 0.00 7964 0.00 0.00 nrt_section + 0.00 34.74 0.00 7957 0.00 0.00 magic_resistance + 0.00 34.74 0.00 7915 0.00 0.00 visible_default + 0.00 34.74 0.00 7889 0.00 0.00 special_resources + 0.00 34.74 0.00 7815 0.00 0.00 already_seen + 0.00 34.74 0.00 7630 0.00 0.00 addstrlist + 0.00 34.74 0.00 7493 0.00 0.00 required + 0.00 34.74 0.00 7336 0.00 0.00 get_alive + 0.00 34.74 0.00 7254 0.00 0.00 ship_ready + 0.00 34.74 0.00 7220 0.00 0.00 a_writestring + 0.00 34.74 0.00 7153 0.00 0.00 cr_ship + 0.00 34.74 0.00 7085 0.00 0.00 a_readprivate + 0.00 34.74 0.00 6962 0.00 0.00 leave_trail + 0.00 34.74 0.00 6962 0.00 0.00 set_coast + 0.00 34.74 0.00 6787 0.00 0.00 unicode_utf8_strcasecmp + 0.00 34.74 0.00 6576 0.00 0.00 xml_bvalue + 0.00 34.74 0.00 6530 0.00 0.00 findparam_ex + 0.00 34.74 0.00 5988 0.00 0.00 herbsearch + 0.00 34.74 0.00 5966 0.00 0.00 ntimespprob + 0.00 34.74 0.00 5925 0.00 0.00 addally + 0.00 34.74 0.00 5916 0.00 0.00 buy + 0.00 34.74 0.00 5907 0.00 0.00 cinfo_simple + 0.00 34.74 0.00 5810 0.00 0.00 report_transfer + 0.00 34.74 0.00 5596 0.00 0.00 drain_exp + 0.00 34.74 0.00 5588 0.00 0.00 get_locale + 0.00 34.74 0.00 5453 0.00 0.00 xml_ivalue + 0.00 34.74 0.00 5384 0.00 0.00 teach_cmd + 0.00 34.74 0.00 5358 0.00 0.00 get_spchange + 0.00 34.74 0.00 5358 0.00 0.00 max_spellpoints + 0.00 34.74 0.00 5354 0.00 0.00 xml_readtext + 0.00 34.74 0.00 5330 0.00 0.00 freestrlist + 0.00 34.74 0.00 5049 0.00 0.00 find_piracy_target + 0.00 34.74 0.00 5049 0.00 0.00 parse_ids + 0.00 34.74 0.00 5049 0.00 0.00 piracy_cmd + 0.00 34.74 0.00 5049 0.00 0.00 validate_pirate + 0.00 34.74 0.00 4915 0.00 0.00 get_spellpoints + 0.00 34.74 0.00 4875 0.00 0.00 get_combatspell + 0.00 34.74 0.00 4782 0.00 0.00 select_recruitment + 0.00 34.74 0.00 4629 0.00 0.00 expandselling + 0.00 34.74 0.00 4475 0.00 0.00 matmod + 0.00 34.74 0.00 4384 0.00 0.00 lparagraph + 0.00 34.74 0.00 4384 0.00 0.00 spunit + 0.00 34.74 0.00 4361 0.00 0.00 can_takeoff + 0.00 34.74 0.00 4261 0.00 0.00 findbuildingtype + 0.00 34.74 0.00 4259 0.00 0.00 findshiptype + 0.00 34.74 0.00 4162 0.00 0.00 spell_info + 0.00 34.74 0.00 4066 0.00 0.00 buildingmaintenance + 0.00 34.74 0.00 4052 0.00 0.00 c_clearflag + 0.00 34.74 0.00 4052 0.00 0.00 chash + 0.00 34.74 0.00 4052 0.00 0.00 curse_age + 0.00 34.74 0.00 4052 0.00 0.00 curse_init + 0.00 34.74 0.00 4024 0.00 0.00 curse_write + 0.00 34.74 0.00 4020 0.00 0.00 curse_read + 0.00 34.74 0.00 3862 0.00 0.00 unit_setname + 0.00 34.74 0.00 3717 0.00 0.00 free_castorders + 0.00 34.74 0.00 3659 0.00 0.00 ExpensiveMigrants + 0.00 34.74 0.00 3659 0.00 0.00 is_migrant + 0.00 34.74 0.00 3639 0.00 0.00 setreload + 0.00 34.74 0.00 3626 0.00 0.00 create_item + 0.00 34.74 0.00 3597 0.00 0.00 chaos + 0.00 34.74 0.00 3496 0.00 0.00 locale_setstring + 0.00 34.74 0.00 3438 0.00 0.00 lighthouse_range + 0.00 34.74 0.00 3438 0.00 0.00 prepare_lighthouse + 0.00 34.74 0.00 3355 0.00 0.00 region_getresource + 0.00 34.74 0.00 3203 0.00 0.00 faction_get_spellbook + 0.00 34.74 0.00 3203 0.00 0.00 join_battle + 0.00 34.74 0.00 3178 0.00 0.00 scale_number + 0.00 34.74 0.00 3171 0.00 0.00 get_spellbook + 0.00 34.74 0.00 3152 0.00 0.00 scareaway + 0.00 34.74 0.00 3123 0.00 0.00 limit_resource + 0.00 34.74 0.00 3117 0.00 0.00 name_cmd + 0.00 34.74 0.00 3114 0.00 0.00 rename_cmd + 0.00 34.74 0.00 3113 0.00 0.00 t_new + 0.00 34.74 0.00 3111 0.00 0.00 sidename + 0.00 34.74 0.00 3110 0.00 0.00 default_order + 0.00 34.74 0.00 3100 0.00 0.00 required + 0.00 34.74 0.00 3096 0.00 0.00 tt_find + 0.00 34.74 0.00 3078 0.00 0.00 allocate_resource + 0.00 34.74 0.00 3003 0.00 0.00 roqf_factor + 0.00 34.74 0.00 3002 0.00 0.00 forbiddenid + 0.00 34.74 0.00 2977 0.00 0.00 change_effect + 0.00 34.74 0.00 2931 0.00 0.00 name_unit + 0.00 34.74 0.00 2913 0.00 0.00 dead_fighters + 0.00 34.74 0.00 2889 0.00 0.00 create_unit + 0.00 34.74 0.00 2889 0.00 0.00 createunitid + 0.00 34.74 0.00 2854 0.00 0.00 is_attacker + 0.00 34.74 0.00 2831 0.00 0.00 countspells + 0.00 34.74 0.00 2818 0.00 0.00 newunitid + 0.00 34.74 0.00 2742 0.00 0.00 get_equipment + 0.00 34.74 0.00 2723 0.00 0.00 get_allocator + 0.00 34.74 0.00 2665 0.00 0.00 findnewunit + 0.00 34.74 0.00 2665 0.00 0.00 read_newunitid + 0.00 34.74 0.00 2650 0.00 0.00 a_initeffect + 0.00 34.74 0.00 2491 0.00 0.00 a_readeffect + 0.00 34.74 0.00 2468 0.00 0.00 find_argtype + 0.00 34.74 0.00 2468 0.00 0.00 tsf_find + 0.00 34.74 0.00 2457 0.00 0.00 set_level + 0.00 34.74 0.00 2421 0.00 0.00 set_racename + 0.00 34.74 0.00 2375 0.00 0.00 equip_unit + 0.00 34.74 0.00 2375 0.00 0.00 equip_unit_mask + 0.00 34.74 0.00 2324 0.00 0.00 read_spellbook + 0.00 34.74 0.00 2321 0.00 0.00 write_spellbook + 0.00 34.74 0.00 2304 0.00 0.00 killunit_write + 0.00 34.74 0.00 2299 0.00 0.00 killunit_read + 0.00 34.74 0.00 2274 0.00 0.00 cinfo_ship + 0.00 34.74 0.00 2148 0.00 0.00 demon_skillchange + 0.00 34.74 0.00 2112 0.00 0.00 spellbook_get + 0.00 34.74 0.00 2096 0.00 0.00 a_writeeffect + 0.00 34.74 0.00 2092 0.00 0.00 init_mage + 0.00 34.74 0.00 2091 0.00 0.00 read_mage + 0.00 34.74 0.00 2089 0.00 0.00 write_mage + 0.00 34.74 0.00 2081 0.00 0.00 a_init_reportspell + 0.00 34.74 0.00 2081 0.00 0.00 cr_reportspell + 0.00 34.74 0.00 2081 0.00 0.00 nr_spell + 0.00 34.74 0.00 2081 0.00 0.00 nr_spell_syntax + 0.00 34.74 0.00 2073 0.00 0.00 set_enemy + 0.00 34.74 0.00 2013 0.00 0.00 display_cmd + 0.00 34.74 0.00 2008 0.00 0.00 default_name + 0.00 34.74 0.00 1936 0.00 0.00 transfermen + 0.00 34.74 0.00 1921 0.00 0.00 show_allies_cr + 0.00 34.74 0.00 1911 0.00 0.00 cinfo_magicresistance + 0.00 34.74 0.00 1909 0.00 0.00 nrt_register + 0.00 34.74 0.00 1909 0.00 0.00 section_find + 0.00 34.74 0.00 1888 0.00 0.00 show_allies + 0.00 34.74 0.00 1873 0.00 0.00 set_spellpoints + 0.00 34.74 0.00 1848 0.00 0.00 uunhash + 0.00 34.74 0.00 1835 0.00 0.00 recruit + 0.00 34.74 0.00 1803 0.00 0.00 gift_items + 0.00 34.74 0.00 1794 0.00 0.00 remove_unit + 0.00 34.74 0.00 1761 0.00 0.00 give_horses + 0.00 34.74 0.00 1725 0.00 0.00 max_magicians + 0.00 34.74 0.00 1716 0.00 0.00 recruit_cost + 0.00 34.74 0.00 1711 0.00 0.00 cr_output_spells + 0.00 34.74 0.00 1700 0.00 0.00 status_cmd + 0.00 34.74 0.00 1697 0.00 0.00 new_group + 0.00 34.74 0.00 1670 0.00 0.00 any_recruiters + 0.00 34.74 0.00 1670 0.00 0.00 horse_recruiters + 0.00 34.74 0.00 1667 0.00 0.00 add_recruits + 0.00 34.74 0.00 1610 0.00 0.00 transfer_curse + 0.00 34.74 0.00 1594 0.00 0.00 do_recruiting + 0.00 34.74 0.00 1594 0.00 0.00 expandrecruit + 0.00 34.74 0.00 1594 0.00 0.00 free_recruitments + 0.00 34.74 0.00 1584 0.00 0.00 produce_resource + 0.00 34.74 0.00 1583 0.00 0.00 allied_skilllimit + 0.00 34.74 0.00 1583 0.00 0.00 reduce_skill + 0.00 34.74 0.00 1583 0.00 0.00 skill_limit + 0.00 34.74 0.00 1582 0.00 0.00 resource2potion + 0.00 34.74 0.00 1582 0.00 0.00 write_triggers + 0.00 34.74 0.00 1573 0.00 0.00 usetprivate + 0.00 34.74 0.00 1572 0.00 0.00 write_score + 0.00 34.74 0.00 1570 0.00 0.00 read_triggers + 0.00 34.74 0.00 1564 0.00 0.00 init_handler + 0.00 34.74 0.00 1564 0.00 0.00 write_handler + 0.00 34.74 0.00 1557 0.00 0.00 read_handler + 0.00 34.74 0.00 1529 0.00 0.00 ship_owner_ex + 0.00 34.74 0.00 1524 0.00 0.00 spellbook_add + 0.00 34.74 0.00 1522 0.00 0.00 a_write_unit + 0.00 34.74 0.00 1522 0.00 0.00 age_unit + 0.00 34.74 0.00 1520 0.00 0.00 eval_race + 0.00 34.74 0.00 1520 0.00 0.00 set_friendly + 0.00 34.74 0.00 1486 0.00 0.00 message_all + 0.00 34.74 0.00 1466 0.00 0.00 resolve_region_id + 0.00 34.74 0.00 1429 0.00 0.00 set_attacker + 0.00 34.74 0.00 1422 0.00 0.00 attrib_allocation + 0.00 34.74 0.00 1363 0.00 0.00 age_skeleton + 0.00 34.74 0.00 1361 0.00 0.00 unit_has_cursed_item + 0.00 34.74 0.00 1339 0.00 0.00 get_combatspelllevel + 0.00 34.74 0.00 1301 0.00 0.00 leveled_allocation + 0.00 34.74 0.00 1301 0.00 0.00 rm_get + 0.00 34.74 0.00 1297 0.00 0.00 add_tactics + 0.00 34.74 0.00 1297 0.00 0.00 battle_punit + 0.00 34.74 0.00 1297 0.00 0.00 free_fighter + 0.00 34.74 0.00 1297 0.00 0.00 hunted_dir + 0.00 34.74 0.00 1297 0.00 0.00 make_fighter + 0.00 34.74 0.00 1295 0.00 0.00 find_side + 0.00 34.74 0.00 1270 0.00 0.00 set_group + 0.00 34.74 0.00 1245 0.00 0.00 use_default + 0.00 34.74 0.00 1239 0.00 0.00 build + 0.00 34.74 0.00 1214 0.00 0.00 rule_faction_limit + 0.00 34.74 0.00 1202 0.00 0.00 resolve_familiar + 0.00 34.74 0.00 1201 0.00 0.00 change_spellpoints + 0.00 34.74 0.00 1199 0.00 0.00 res_changeaura + 0.00 34.74 0.00 1196 0.00 0.00 eval_localize + 0.00 34.74 0.00 1140 0.00 0.00 read_region_reference + 0.00 34.74 0.00 1139 0.00 0.00 region_setresource + 0.00 34.74 0.00 1138 0.00 0.00 read_targetregion + 0.00 34.74 0.00 1125 0.00 0.00 leave_building + 0.00 34.74 0.00 1119 0.00 0.00 write_region_reference + 0.00 34.74 0.00 1117 0.00 0.00 write_targetregion + 0.00 34.74 0.00 1091 0.00 0.00 loot_quota + 0.00 34.74 0.00 1078 0.00 0.00 resolve_mage + 0.00 34.74 0.00 1042 0.00 0.00 in_safe_building + 0.00 34.74 0.00 1041 0.00 0.00 findskill + 0.00 34.74 0.00 967 0.00 0.00 count_all + 0.00 34.74 0.00 960 0.00 0.00 tax_cmd + 0.00 34.74 0.00 957 0.00 0.00 crt_register + 0.00 34.74 0.00 957 0.00 0.00 mt_id + 0.00 34.74 0.00 957 0.00 0.00 mt_new + 0.00 34.74 0.00 957 0.00 0.00 mt_register + 0.00 34.74 0.00 955 0.00 0.00 movement_error + 0.00 34.74 0.00 946 0.00 0.00 sparagraph + 0.00 34.74 0.00 946 0.00 0.00 split_paragraph + 0.00 34.74 0.00 923 0.00 0.00 race_namegen + 0.00 34.74 0.00 894 0.00 0.00 make_follow + 0.00 34.74 0.00 834 0.00 0.00 eval_resources + 0.00 34.74 0.00 820 0.00 0.00 curse_geteffect_int + 0.00 34.74 0.00 799 0.00 0.00 setstealth_cmd + 0.00 34.74 0.00 793 0.00 0.00 is_familiar + 0.00 34.74 0.00 791 0.00 0.00 ally_cmd + 0.00 34.74 0.00 791 0.00 0.00 getfaction + 0.00 34.74 0.00 786 0.00 0.00 average_score_of_age + 0.00 34.74 0.00 785 0.00 0.00 lua_canuse_item + 0.00 34.74 0.00 769 0.00 0.00 shock_write + 0.00 34.74 0.00 768 0.00 0.00 shock_read + 0.00 34.74 0.00 767 0.00 0.00 spellcost + 0.00 34.74 0.00 763 0.00 0.00 init_skillmod + 0.00 34.74 0.00 760 0.00 0.00 read_familiar + 0.00 34.74 0.00 760 0.00 0.00 read_magician + 0.00 34.74 0.00 760 0.00 0.00 set_familiar + 0.00 34.74 0.00 754 0.00 0.00 checkunitnumber + 0.00 34.74 0.00 754 0.00 0.00 rule_alliance_limit + 0.00 34.74 0.00 752 0.00 0.00 monster_attack + 0.00 34.74 0.00 735 0.00 0.00 join_group + 0.00 34.74 0.00 708 0.00 0.00 age_ghoul + 0.00 34.74 0.00 702 0.00 0.00 max_transfers + 0.00 34.74 0.00 688 0.00 0.00 age_zombie + 0.00 34.74 0.00 677 0.00 0.00 slipthru + 0.00 34.74 0.00 666 0.00 0.00 generic_name + 0.00 34.74 0.00 663 0.00 0.00 expandtax + 0.00 34.74 0.00 659 0.00 0.00 can_give_men + 0.00 34.74 0.00 621 0.00 0.00 build_building + 0.00 34.74 0.00 621 0.00 0.00 group_cmd + 0.00 34.74 0.00 608 0.00 0.00 co_get_region + 0.00 34.74 0.00 604 0.00 0.00 eval_spell + 0.00 34.74 0.00 590 0.00 0.00 use_cmd + 0.00 34.74 0.00 590 0.00 0.00 use_item + 0.00 34.74 0.00 588 0.00 0.00 give_men + 0.00 34.74 0.00 574 0.00 0.00 battle_attacks + 0.00 34.74 0.00 574 0.00 0.00 battle_flee + 0.00 34.74 0.00 574 0.00 0.00 battle_update + 0.00 34.74 0.00 573 0.00 0.00 join_path + 0.00 34.74 0.00 569 0.00 0.00 relpath + 0.00 34.74 0.00 569 0.00 0.00 u_seteffstealth + 0.00 34.74 0.00 564 0.00 0.00 reportpath + 0.00 34.74 0.00 560 0.00 0.00 oldterrain + 0.00 34.74 0.00 554 0.00 0.00 a_finalizeeffect + 0.00 34.74 0.00 552 0.00 0.00 free_side + 0.00 34.74 0.00 552 0.00 0.00 make_side + 0.00 34.74 0.00 552 0.00 0.00 print_fighters + 0.00 34.74 0.00 524 0.00 0.00 remove_exclusive + 0.00 34.74 0.00 508 0.00 0.00 MagicRegeneration + 0.00 34.74 0.00 508 0.00 0.00 regeneration + 0.00 34.74 0.00 505 0.00 0.00 mm_smithy + 0.00 34.74 0.00 501 0.00 0.00 xml_fvalue + 0.00 34.74 0.00 499 0.00 0.00 MagicPower + 0.00 34.74 0.00 492 0.00 0.00 u_hasspell + 0.00 34.74 0.00 482 0.00 0.00 knowsspell + 0.00 34.74 0.00 481 0.00 0.00 count_units + 0.00 34.74 0.00 475 0.00 0.00 follow_ship + 0.00 34.74 0.00 465 0.00 0.00 get_function + 0.00 34.74 0.00 464 0.00 0.00 lastregion + 0.00 34.74 0.00 462 0.00 0.00 game_name + 0.00 34.74 0.00 461 0.00 0.00 maxheroes + 0.00 34.74 0.00 457 0.00 0.00 FactionSpells + 0.00 34.74 0.00 453 0.00 0.00 find_groupbyname + 0.00 34.74 0.00 451 0.00 0.00 mtype_get_param + 0.00 34.74 0.00 443 0.00 0.00 change_maxspellpoints + 0.00 34.74 0.00 443 0.00 0.00 res_changepermaura + 0.00 34.74 0.00 433 0.00 0.00 make_otherfaction + 0.00 34.74 0.00 432 0.00 0.00 helping + 0.00 34.74 0.00 428 0.00 0.00 free_nodes + 0.00 34.74 0.00 425 0.00 0.00 reportcasualties + 0.00 34.74 0.00 412 0.00 0.00 do_combatmagic + 0.00 34.74 0.00 406 0.00 0.00 PopulationDamage + 0.00 34.74 0.00 406 0.00 0.00 faction_setorigin + 0.00 34.74 0.00 405 0.00 0.00 enter_building + 0.00 34.74 0.00 404 0.00 0.00 usetpotionuse + 0.00 34.74 0.00 401 0.00 0.00 mayenter + 0.00 34.74 0.00 396 0.00 0.00 show_new_spells + 0.00 34.74 0.00 383 0.00 0.00 rt_get_or_create + 0.00 34.74 0.00 380 0.00 0.00 create_spellbook + 0.00 34.74 0.00 378 0.00 0.00 get_tactics + 0.00 34.74 0.00 377 0.00 0.00 manufacture + 0.00 34.74 0.00 371 0.00 0.00 add_translation + 0.00 34.74 0.00 365 0.00 0.00 unit_getspell + 0.00 34.74 0.00 361 0.00 0.00 regionname + 0.00 34.74 0.00 356 0.00 0.00 cr_race + 0.00 34.74 0.00 349 0.00 0.00 research_cmd + 0.00 34.74 0.00 348 0.00 0.00 begin_potion + 0.00 34.74 0.00 348 0.00 0.00 mail_cmd + 0.00 34.74 0.00 348 0.00 0.00 ugetpotionuse + 0.00 34.74 0.00 348 0.00 0.00 use_potion + 0.00 34.74 0.00 345 0.00 0.00 do_potion + 0.00 34.74 0.00 345 0.00 0.00 end_potion + 0.00 34.74 0.00 343 0.00 0.00 rough_amount + 0.00 34.74 0.00 338 0.00 0.00 findrace + 0.00 34.74 0.00 328 0.00 0.00 display_potion + 0.00 34.74 0.00 324 0.00 0.00 add_itemname_cb + 0.00 34.74 0.00 324 0.00 0.00 add_resourcename_cb + 0.00 34.74 0.00 324 0.00 0.00 caught_target + 0.00 34.74 0.00 319 0.00 0.00 loot_items + 0.00 34.74 0.00 314 0.00 0.00 CavalrySkill + 0.00 34.74 0.00 312 0.00 0.00 continue_ship + 0.00 34.74 0.00 307 0.00 0.00 getship + 0.00 34.74 0.00 303 0.00 0.00 create_castorder + 0.00 34.74 0.00 303 0.00 0.00 free_castorder + 0.00 34.74 0.00 298 0.00 0.00 plan_dragon + 0.00 34.74 0.00 295 0.00 0.00 age_dragon + 0.00 34.74 0.00 287 0.00 0.00 factionorders + 0.00 34.74 0.00 286 0.00 0.00 checkpasswd + 0.00 34.74 0.00 286 0.00 0.00 password_verify + 0.00 34.74 0.00 279 0.00 0.00 cr_spell + 0.00 34.74 0.00 273 0.00 0.00 pay_spell + 0.00 34.74 0.00 267 0.00 0.00 freetokens + 0.00 34.74 0.00 266 0.00 0.00 age_undead + 0.00 34.74 0.00 255 0.00 0.00 select_spellbook + 0.00 34.74 0.00 252 0.00 0.00 path_exists + 0.00 34.74 0.00 251 0.00 0.00 cancast + 0.00 34.74 0.00 251 0.00 0.00 eff_spelllevel + 0.00 34.74 0.00 251 0.00 0.00 out_faction + 0.00 34.74 0.00 250 0.00 0.00 real2tp + 0.00 34.74 0.00 249 0.00 0.00 make_movement_order + 0.00 34.74 0.00 248 0.00 0.00 sm_smithy + 0.00 34.74 0.00 242 0.00 0.00 canfly + 0.00 34.74 0.00 241 0.00 0.00 reshow + 0.00 34.74 0.00 241 0.00 0.00 reshow_cmd + 0.00 34.74 0.00 240 0.00 0.00 register_function + 0.00 34.74 0.00 236 0.00 0.00 leave_cmd + 0.00 34.74 0.00 234 0.00 0.00 make_leftship + 0.00 34.74 0.00 234 0.00 0.00 set_leftship + 0.00 34.74 0.00 233 0.00 0.00 faction_setpassword + 0.00 34.74 0.00 233 0.00 0.00 fhash + 0.00 34.74 0.00 233 0.00 0.00 password_encode + 0.00 34.74 0.00 233 0.00 0.00 read_groups + 0.00 34.74 0.00 233 0.00 0.00 read_password + 0.00 34.74 0.00 233 0.00 0.00 readfaction + 0.00 34.74 0.00 233 0.00 0.00 set_email + 0.00 34.74 0.00 232 0.00 0.00 spc_email_isvalid + 0.00 34.74 0.00 232 0.00 0.00 transfer_seen + 0.00 34.74 0.00 232 0.00 0.00 write_groups + 0.00 34.74 0.00 232 0.00 0.00 write_password + 0.00 34.74 0.00 232 0.00 0.08 write_reports + 0.00 34.74 0.00 232 0.00 0.00 write_script + 0.00 34.74 0.00 232 0.00 0.00 writefaction + 0.00 34.74 0.00 231 0.00 0.00 RemoveNMRNewbie + 0.00 34.74 0.00 231 0.00 0.00 eressea_version + 0.00 34.74 0.00 230 0.00 0.00 allies + 0.00 34.74 0.00 230 0.00 0.00 cr_find_address + 0.00 34.74 0.00 230 0.00 0.00 gamedate_season + 0.00 34.74 0.00 230 0.00 0.00 report_crtypes + 0.00 34.74 0.00 230 0.00 0.00 reset_translations + 0.00 34.74 0.00 230 0.00 0.00 rp_battles + 0.00 34.74 0.00 230 0.00 0.00 show_alliances_cr + 0.00 34.74 0.00 230 0.00 0.00 write_translations + 0.00 34.74 0.00 229 0.00 0.00 add_castorder + 0.00 34.74 0.00 229 0.00 0.00 list_address + 0.00 34.74 0.00 226 0.00 0.00 fumble + 0.00 34.74 0.00 225 0.00 0.00 spellpower + 0.00 34.74 0.00 224 0.00 0.00 leave_ship + 0.00 34.74 0.00 222 0.00 0.00 cast_cmd + 0.00 34.74 0.00 222 0.00 0.00 enter_ship + 0.00 34.74 0.00 220 0.00 0.00 farcasting + 0.00 34.74 0.00 214 0.00 0.00 var_copy_items + 0.00 34.74 0.00 210 0.00 0.00 cr_resources + 0.00 34.74 0.00 209 0.00 0.00 var_free_resources + 0.00 34.74 0.00 207 0.00 0.00 rule_force_leave + 0.00 34.74 0.00 206 0.00 0.00 aftermath + 0.00 34.74 0.00 206 0.00 0.00 battle_effects + 0.00 34.74 0.00 206 0.00 0.00 battle_free + 0.00 34.74 0.00 206 0.00 0.00 free_battle + 0.00 34.74 0.00 206 0.00 0.00 join_allies + 0.00 34.74 0.00 206 0.00 0.00 make_battle + 0.00 34.74 0.00 206 0.00 0.00 make_heroes + 0.00 34.74 0.00 206 0.00 0.00 print_header + 0.00 34.74 0.00 206 0.00 0.00 print_stats + 0.00 34.74 0.00 206 0.00 0.00 reorder_fleeing + 0.00 34.74 0.00 206 0.00 0.00 var_copy_resources + 0.00 34.74 0.00 203 0.00 0.00 msg_set_int + 0.00 34.74 0.00 196 0.00 0.00 make_name + 0.00 34.74 0.00 196 0.00 0.00 verify_targets + 0.00 34.74 0.00 195 0.00 0.00 mayboard + 0.00 34.74 0.00 192 0.00 0.00 can_contact + 0.00 34.74 0.00 191 0.00 0.00 CheckOverload + 0.00 34.74 0.00 191 0.00 0.00 xml_readconstruction + 0.00 34.74 0.00 188 0.00 0.00 is_freezing + 0.00 34.74 0.00 186 0.00 0.00 leftship_age + 0.00 34.74 0.00 185 0.00 0.00 it_get_or_create + 0.00 34.74 0.00 185 0.00 0.00 it_register + 0.00 34.74 0.00 183 0.00 0.00 cinfo_magicrunes + 0.00 34.74 0.00 182 0.00 0.00 age_firedragon + 0.00 34.74 0.00 182 0.00 0.00 msg_materials_required + 0.00 34.74 0.00 178 0.00 0.00 parse_function + 0.00 34.74 0.00 177 0.00 0.00 breed_cmd + 0.00 34.74 0.00 176 0.00 0.00 default_spoil + 0.00 34.74 0.00 174 0.00 0.00 breedhorses + 0.00 34.74 0.00 174 0.00 0.00 findresourcetype + 0.00 34.74 0.00 167 0.00 0.00 academy_teaching_bonus + 0.00 34.74 0.00 166 0.00 0.00 add_spell + 0.00 34.74 0.00 166 0.00 0.00 create_spell + 0.00 34.74 0.00 163 0.00 0.00 cinfo_shipnodrift + 0.00 34.74 0.00 162 0.00 0.00 rt_register + 0.00 34.74 0.00 160 0.00 0.00 damage_ship + 0.00 34.74 0.00 157 0.00 0.00 xml_readitem + 0.00 34.74 0.00 150 0.00 0.00 rc_get_or_create + 0.00 34.74 0.00 149 0.00 0.00 create_potion + 0.00 34.74 0.00 147 0.00 0.00 contact_cmd + 0.00 34.74 0.00 145 0.00 0.00 findunitr + 0.00 34.74 0.00 143 0.00 0.00 ResourceFactor + 0.00 34.74 0.00 143 0.00 0.00 update_resource + 0.00 34.74 0.00 138 0.00 0.00 renumber_cmd + 0.00 34.74 0.00 136 0.00 0.00 a_readstring + 0.00 34.74 0.00 136 0.00 0.00 path_find + 0.00 34.74 0.00 134 0.00 0.00 cinfo_slave + 0.00 34.74 0.00 133 0.00 0.00 income + 0.00 34.74 0.00 133 0.00 0.00 present + 0.00 34.74 0.00 133 0.00 0.00 reroute + 0.00 34.74 0.00 127 0.00 0.00 msg_create_message + 0.00 34.74 0.00 125 0.00 0.00 r_standard_to_astral + 0.00 34.74 0.00 125 0.00 0.00 random_unit + 0.00 34.74 0.00 125 0.00 0.00 tpregion + 0.00 34.74 0.00 124 0.00 0.00 age_stonecircle + 0.00 34.74 0.00 124 0.00 0.00 eval_unit_dative + 0.00 34.74 0.00 122 0.00 0.00 maxbuild + 0.00 34.74 0.00 121 0.00 0.00 co_get_caster + 0.00 34.74 0.00 121 0.00 0.00 lua_callspell + 0.00 34.74 0.00 121 0.00 0.00 msg_send_faction + 0.00 34.74 0.00 121 0.00 0.00 msg_set_unit + 0.00 34.74 0.00 120 0.00 0.00 plagues + 0.00 34.74 0.00 119 0.00 0.00 syntax_error + 0.00 34.74 0.00 118 0.00 0.00 keyword_key + 0.00 34.74 0.00 118 0.00 0.00 rule_transfermen + 0.00 34.74 0.00 115 0.00 0.00 build_ship + 0.00 34.74 0.00 115 0.00 0.00 usetcontact + 0.00 34.74 0.00 114 0.00 0.00 give_unit + 0.00 34.74 0.00 112 0.00 0.00 attack_firesword + 0.00 34.74 0.00 112 0.00 0.00 get_friends + 0.00 34.74 0.00 111 0.00 0.00 check_steal + 0.00 34.74 0.00 111 0.00 0.00 steal_cmd + 0.00 34.74 0.00 107 0.00 0.00 init_keyword + 0.00 34.74 0.00 106 0.00 0.00 a_readkey + 0.00 34.74 0.00 106 0.00 0.00 age_reduceproduction + 0.00 34.74 0.00 106 0.00 0.00 equipment_setskill + 0.00 34.74 0.00 105 0.00 0.00 terraform_region + 0.00 34.74 0.00 105 0.00 0.00 terraform_resources + 0.00 34.74 0.00 104 0.00 0.00 reshow_other + 0.00 34.74 0.00 99 0.00 0.00 spl_costtyp + 0.00 34.74 0.00 97 0.00 0.00 i_merge + 0.00 34.74 0.00 97 0.00 0.00 mk_piracy + 0.00 34.74 0.00 97 0.00 0.00 piracy_done + 0.00 34.74 0.00 97 0.00 0.00 piracy_init + 0.00 34.74 0.00 92 0.00 0.00 building_update_owner + 0.00 34.74 0.00 88 0.00 0.00 hunger + 0.00 34.74 0.00 88 0.00 0.00 hunger_damage + 0.00 34.74 0.00 88 0.00 0.00 parameter_key + 0.00 34.74 0.00 84 0.00 0.00 xml_readrequirements + 0.00 34.74 0.00 83 0.00 0.00 create_castorder_combat + 0.00 34.74 0.00 81 0.00 0.00 can_guard + 0.00 34.74 0.00 80 0.00 0.00 combatspell_cmd + 0.00 34.74 0.00 80 0.00 0.00 msg_set_resource + 0.00 34.74 0.00 78 0.00 0.00 eval_weight + 0.00 34.74 0.00 74 0.00 0.00 cast_combatspell + 0.00 34.74 0.00 74 0.00 0.00 get_force + 0.00 34.74 0.00 74 0.00 0.00 ghoul_name + 0.00 34.74 0.00 74 0.00 0.00 spell_damage + 0.00 34.74 0.00 73 0.00 0.00 create_equipment + 0.00 34.74 0.00 72 0.00 0.00 default_score + 0.00 34.74 0.00 71 0.00 0.00 disband_men + 0.00 34.74 0.00 70 0.00 0.00 skeleton_name + 0.00 34.74 0.00 68 0.00 0.00 a_readchars + 0.00 34.74 0.00 68 0.00 0.00 rc_create + 0.00 34.74 0.00 67 0.00 0.00 parse_ai + 0.00 34.74 0.00 66 0.00 0.00 a_writechars + 0.00 34.74 0.00 65 0.00 0.00 equipment_setitem + 0.00 34.74 0.00 65 0.00 0.00 findkeyword + 0.00 34.74 0.00 65 0.00 0.00 max_skill + 0.00 34.74 0.00 64 0.00 0.00 log_info + 0.00 34.74 0.00 62 0.00 0.00 cinfo_speed + 0.00 34.74 0.00 62 0.00 0.00 potion_luck + 0.00 34.74 0.00 61 0.00 0.00 add_callbacks + 0.00 34.74 0.00 61 0.00 0.00 add_items + 0.00 34.74 0.00 61 0.00 0.00 add_skills + 0.00 34.74 0.00 61 0.00 0.00 add_spells + 0.00 34.74 0.00 61 0.00 0.00 add_subsets + 0.00 34.74 0.00 60 0.00 0.00 equip_items + 0.00 34.74 0.00 60 0.00 0.00 nb_armor + 0.00 34.74 0.00 58 0.00 0.00 add_resource + 0.00 34.74 0.00 58 0.00 0.00 dict_get + 0.00 34.74 0.00 58 0.00 0.00 dict_name + 0.00 34.74 0.00 58 0.00 0.00 peasant_luck_factor + 0.00 34.74 0.00 58 0.00 0.00 rmt_get + 0.00 34.74 0.00 58 0.00 0.00 skill_key + 0.00 34.74 0.00 58 0.00 0.00 terraform_default + 0.00 34.74 0.00 57 0.00 0.00 free_land + 0.00 34.74 0.00 56 0.00 0.00 add_proc + 0.00 34.74 0.00 56 0.00 0.00 dict_init + 0.00 34.74 0.00 56 0.00 0.00 dict_read + 0.00 34.74 0.00 56 0.00 0.00 dict_write + 0.00 34.74 0.00 56 0.00 0.00 use_bloodpotion + 0.00 34.74 0.00 55 0.00 0.00 at_register + 0.00 34.74 0.00 55 0.00 0.00 renumber_unit + 0.00 34.74 0.00 54 0.00 0.00 eval_add + 0.00 34.74 0.00 54 0.00 0.00 it_set_appearance + 0.00 34.74 0.00 53 0.00 0.00 do_extra_spell + 0.00 34.74 0.00 53 0.00 0.00 lua_getresource + 0.00 34.74 0.00 53 0.00 0.00 sp_dragonodem + 0.00 34.74 0.00 52 0.00 0.00 cinfo_skillmod + 0.00 34.74 0.00 52 0.00 0.00 get_or_create_terrain + 0.00 34.74 0.00 52 0.00 0.00 zombie_name + 0.00 34.74 0.00 51 0.00 0.00 potion_water_of_life + 0.00 34.74 0.00 51 0.00 0.00 rcomp + 0.00 34.74 0.00 49 0.00 0.00 get_money_for_dragon + 0.00 34.74 0.00 48 0.00 0.00 addmessage + 0.00 34.74 0.00 48 0.00 0.00 allysfm + 0.00 34.74 0.00 48 0.00 0.00 caddmessage + 0.00 34.74 0.00 48 0.00 0.00 chaosterrain + 0.00 34.74 0.00 48 0.00 0.00 get_maxluxuries + 0.00 34.74 0.00 48 0.00 0.00 makename + 0.00 34.74 0.00 48 0.00 0.00 region_setname + 0.00 34.74 0.00 48 0.00 0.00 unit_addorder + 0.00 34.74 0.00 47 0.00 0.00 display_race + 0.00 34.74 0.00 47 0.00 0.00 give_peasants + 0.00 34.74 0.00 47 0.00 0.00 msg_set_region + 0.00 34.74 0.00 45 0.00 0.00 count_maxmigrants + 0.00 34.74 0.00 45 0.00 0.00 count_migrants + 0.00 34.74 0.00 45 0.00 0.00 create_curse + 0.00 34.74 0.00 44 0.00 0.00 ct_register + 0.00 34.74 0.00 44 0.00 0.00 curse_name + 0.00 34.74 0.00 43 0.00 0.00 unset_combatspell + 0.00 34.74 0.00 42 0.00 0.00 loot_cmd + 0.00 34.74 0.00 42 0.00 0.00 pcomp + 0.00 34.74 0.00 41 0.00 0.00 build_road + 0.00 34.74 0.00 41 0.00 0.00 expandstealing + 0.00 34.74 0.00 40 0.00 0.00 regions_in_range + 0.00 34.74 0.00 40 0.00 0.00 set_new_dragon_target + 0.00 34.74 0.00 39 0.00 0.00 bt_get_or_create + 0.00 34.74 0.00 39 0.00 0.00 deliverMail + 0.00 34.74 0.00 39 0.00 0.00 display_item + 0.00 34.74 0.00 39 0.00 0.00 random_growl + 0.00 34.74 0.00 38 0.00 0.00 count_allies + 0.00 34.74 0.00 38 0.00 0.00 do_combatspell + 0.00 34.74 0.00 38 0.00 0.00 report_action + 0.00 34.74 0.00 38 0.00 0.00 select_ally + 0.00 34.74 0.00 37 0.00 0.00 transport + 0.00 34.74 0.00 36 0.00 0.00 expandloot + 0.00 34.74 0.00 36 0.00 0.00 runhash + 0.00 34.74 0.00 35 0.00 0.00 mailunit + 0.00 34.74 0.00 34 0.00 0.00 dracoid_name + 0.00 34.74 0.00 33 0.00 0.00 pack_keyval + 0.00 34.74 0.00 33 0.00 0.00 set_param + 0.00 34.74 0.00 32 0.00 0.00 add_function + 0.00 34.74 0.00 32 0.00 0.00 make_curse + 0.00 34.74 0.00 30 0.00 0.00 limit_seeds + 0.00 34.74 0.00 30 0.00 0.00 overload_start + 0.00 34.74 0.00 30 0.00 0.00 treeman_neighbour + 0.00 34.74 0.00 29 0.00 0.00 add_proc_order + 0.00 34.74 0.00 29 0.00 0.00 add_raceprefix + 0.00 34.74 0.00 29 0.00 0.00 json_terrain_production + 0.00 34.74 0.00 28 0.00 0.00 cunhash + 0.00 34.74 0.00 28 0.00 0.00 curse_done + 0.00 34.74 0.00 28 0.00 0.00 destroy_curse + 0.00 34.74 0.00 28 0.00 0.00 report_effect + 0.00 34.74 0.00 27 0.00 0.00 NMRTimeout + 0.00 34.74 0.00 27 0.00 0.00 bt_register + 0.00 34.74 0.00 27 0.00 0.00 dragon_name + 0.00 34.74 0.00 27 0.00 0.00 move_iceberg + 0.00 34.74 0.00 27 0.00 0.00 register_item_use + 0.00 34.74 0.00 26 0.00 0.00 add_spellparameter + 0.00 34.74 0.00 26 0.00 0.00 free_spellparameter + 0.00 34.74 0.00 25 0.00 0.00 allysf + 0.00 34.74 0.00 25 0.00 0.00 make_targetregion + 0.00 34.74 0.00 24 0.00 0.00 equipment_addspell + 0.00 34.74 0.00 24 0.00 0.00 is_moving_ship + 0.00 34.74 0.00 23 0.00 0.00 destroy_cmd + 0.00 34.74 0.00 23 0.00 0.00 new_weapontype + 0.00 34.74 0.00 23 0.00 0.00 xml_readweapon + 0.00 34.74 0.00 22 0.00 0.00 addparam_ship + 0.00 34.74 0.00 22 0.00 0.00 rsetroad + 0.00 34.74 0.00 22 0.00 0.00 verify_ship + 0.00 34.74 0.00 21 0.00 0.00 sp_kampfzauber + 0.00 34.74 0.00 20 0.00 0.00 spawn_seaserpent + 0.00 34.74 0.00 19 0.00 0.00 tsf_register + 0.00 34.74 0.00 18 0.00 0.00 check_dupe + 0.00 34.74 0.00 18 0.00 0.00 handle_triggers + 0.00 34.74 0.00 18 0.00 0.00 json_flags + 0.00 34.74 0.00 18 0.00 0.00 json_terrain + 0.00 34.74 0.00 18 0.00 0.00 register_argtype + 0.00 34.74 0.00 18 0.00 0.00 timeout_handle + 0.00 34.74 0.00 18 0.00 0.00 timeout_init + 0.00 34.74 0.00 18 0.00 0.00 timeout_write + 0.00 34.74 0.00 17 0.00 0.00 recruit_dracoids + 0.00 34.74 0.00 16 0.00 0.00 addparam_unit + 0.00 34.74 0.00 16 0.00 0.00 damage_unit + 0.00 34.74 0.00 16 0.00 0.00 spy_cmd + 0.00 34.74 0.00 16 0.00 0.00 verify_unit + 0.00 34.74 0.00 15 0.00 0.00 drift_target + 0.00 34.74 0.00 15 0.00 0.00 new_potiontype + 0.00 34.74 0.00 15 0.00 0.00 overload + 0.00 34.74 0.00 15 0.00 0.00 pt_register + 0.00 34.74 0.00 15 0.00 0.00 res_changepeasants + 0.00 34.74 0.00 15 0.00 0.00 xml_readpotion + 0.00 34.74 0.00 14 0.00 0.00 heal_fighters + 0.00 34.74 0.00 14 0.00 0.00 tt_register + 0.00 34.74 0.00 13 0.00 0.00 add_proc_global + 0.00 34.74 0.00 13 0.00 0.00 getplanebyid + 0.00 34.74 0.00 13 0.00 0.00 log_error + 0.00 34.74 0.00 13 0.00 0.00 make_iceberg + 0.00 34.74 0.00 13 0.00 0.00 newcontainerid + 0.00 34.74 0.00 13 0.00 0.00 set_curseingmagician + 0.00 34.74 0.00 13 0.00 0.00 sp_blessedharvest + 0.00 34.74 0.00 13 0.00 0.00 timeout_read + 0.00 34.74 0.00 13 0.00 0.00 tolua_toid + 0.00 34.74 0.00 12 0.00 0.00 bunhash + 0.00 34.74 0.00 12 0.00 0.00 changefaction_init + 0.00 34.74 0.00 12 0.00 0.00 changefaction_write + 0.00 34.74 0.00 12 0.00 0.00 forget_cmd + 0.00 34.74 0.00 12 0.00 0.00 make_reduceproduction + 0.00 34.74 0.00 12 0.00 0.00 msg_to_ship_inmates + 0.00 34.74 0.00 12 0.00 0.00 volcano_destruction + 0.00 34.74 0.00 12 0.00 0.00 write_race_reference + 0.00 34.74 0.00 11 0.00 0.00 add_trigger + 0.00 34.74 0.00 11 0.00 0.00 koor_distance_wrap_xy + 0.00 34.74 0.00 11 0.00 0.00 new_building + 0.00 34.74 0.00 11 0.00 0.00 produce_seeds + 0.00 34.74 0.00 11 0.00 0.00 xml_register_callback + 0.00 34.74 0.00 11 0.00 0.00 xml_spell + 0.00 34.74 0.00 10 0.00 0.00 changefaction_read + 0.00 34.74 0.00 10 0.00 0.00 nrand + 0.00 34.74 0.00 10 0.00 0.00 rel_to_abs + 0.00 34.74 0.00 10 0.00 0.00 section_add + 0.00 34.74 0.00 10 0.00 0.00 set_combatspell + 0.00 34.74 0.00 10 0.00 0.00 sp_hain + 0.00 34.74 0.00 9 0.00 0.00 basepath + 0.00 34.74 0.00 9 0.00 0.00 init_resourcelimit + 0.00 34.74 0.00 9 0.00 0.00 melt_iceberg + 0.00 34.74 0.00 9 0.00 0.00 register_bordertype + 0.00 34.74 0.00 9 0.00 0.00 sp_stormwinds + 0.00 34.74 0.00 8 0.00 0.00 add_proc_region + 0.00 34.74 0.00 8 0.00 0.00 do_fumble + 0.00 34.74 0.00 8 0.00 0.00 mod_elves_only + 0.00 34.74 0.00 8 0.00 0.00 new_armortype + 0.00 34.74 0.00 8 0.00 0.00 spy_message + 0.00 34.74 0.00 8 0.00 0.00 unit_gethp + 0.00 34.74 0.00 8 0.00 0.00 xml_readarmor + 0.00 34.74 0.00 7 0.00 0.00 fighters + 0.00 34.74 0.00 7 0.00 0.00 has_ao_healing + 0.00 34.74 0.00 7 0.00 0.00 i_findc + 0.00 34.74 0.00 7 0.00 0.00 lt_register + 0.00 34.74 0.00 7 0.00 0.00 new_luxurytype + 0.00 34.74 0.00 7 0.00 0.00 register_race_name_function + 0.00 34.74 0.00 7 0.00 0.00 rmt_create + 0.00 34.74 0.00 7 0.00 0.00 scramble_fighters + 0.00 34.74 0.00 7 0.00 0.00 sp_healing + 0.00 34.74 0.00 7 0.00 0.00 spellbook_clear + 0.00 34.74 0.00 7 0.00 0.00 st_get_or_create + 0.00 34.74 0.00 7 0.00 0.00 sunhash + 0.00 34.74 0.00 7 0.00 0.00 xml_readluxury + 0.00 34.74 0.00 6 0.00 0.00 addparam_building + 0.00 34.74 0.00 6 0.00 0.00 changerace_init + 0.00 34.74 0.00 6 0.00 0.00 changerace_write + 0.00 34.74 0.00 6 0.00 0.00 equipment_setcallback + 0.00 34.74 0.00 6 0.00 0.00 findoption + 0.00 34.74 0.00 6 0.00 0.00 get_or_create_locale + 0.00 34.74 0.00 6 0.00 0.00 init_translations + 0.00 34.74 0.00 6 0.00 0.00 make_undead_unit + 0.00 34.74 0.00 6 0.00 0.00 msg_send_region + 0.00 34.74 0.00 6 0.00 0.00 read_race_reference + 0.00 34.74 0.00 6 0.00 0.00 remove_ship + 0.00 34.74 0.00 6 0.00 0.00 rrandneighbour + 0.00 34.74 0.00 6 0.00 0.00 send_cmd + 0.00 34.74 0.00 6 0.00 0.00 skill_summoned + 0.00 34.74 0.00 6 0.00 0.00 sp_mallornhain + 0.00 34.74 0.00 6 0.00 0.00 sp_summonundead + 0.00 34.74 0.00 6 0.00 0.00 volcano_outbreak + 0.00 34.74 0.00 5 0.00 0.00 at_deprecate + 0.00 34.74 0.00 5 0.00 0.00 datapath + 0.00 34.74 0.00 5 0.00 0.00 free_group + 0.00 34.74 0.00 5 0.00 0.00 get_cmp_region_owner + 0.00 34.74 0.00 5 0.00 0.00 log_warning + 0.00 34.74 0.00 5 0.00 0.00 reset_locales + 0.00 34.74 0.00 5 0.00 0.00 set_money + 0.00 34.74 0.00 5 0.00 0.00 trigger_killunit + 0.00 34.74 0.00 5 0.00 0.00 trigger_timeout + 0.00 34.74 0.00 5 0.00 0.00 ursprung_x + 0.00 34.74 0.00 5 0.00 0.00 ursprung_y + 0.00 34.74 0.00 4 0.00 0.00 count_skill + 0.00 34.74 0.00 4 0.00 0.00 heal + 0.00 34.74 0.00 4 0.00 0.00 intlist_add + 0.00 34.74 0.00 4 0.00 0.00 intlist_init + 0.00 34.74 0.00 4 0.00 0.00 json_config + 0.00 34.74 0.00 4 0.00 0.00 mailfaction + 0.00 34.74 0.00 4 0.00 0.00 nextlocale + 0.00 34.74 0.00 4 0.00 0.00 read_skill + 0.00 34.74 0.00 4 0.00 0.00 seefaction + 0.00 34.74 0.00 4 0.00 0.00 sp_goodwinds + 0.00 34.74 0.00 4 0.00 0.00 terrains + 0.00 34.74 0.00 4 0.00 0.00 try_rename + 0.00 34.74 0.00 4 0.00 0.00 verify_building + 0.00 34.74 0.00 3 0.00 0.00 add_proc_postregion + 0.00 34.74 0.00 3 0.00 0.00 add_proc_unit + 0.00 34.74 0.00 3 0.00 0.00 can_charm + 0.00 34.74 0.00 3 0.00 0.00 changerace_read + 0.00 34.74 0.00 3 0.00 0.00 count_particles + 0.00 34.74 0.00 3 0.00 0.00 gamedate2 + 0.00 34.74 0.00 3 0.00 0.00 getplaneid + 0.00 34.74 0.00 3 0.00 0.00 give_control + 0.00 34.74 0.00 3 0.00 0.00 init_group + 0.00 34.74 0.00 3 0.00 0.00 init_locales + 0.00 34.74 0.00 3 0.00 0.00 parse_param + 0.00 34.74 0.00 3 0.00 0.00 racelist_insert + 0.00 34.74 0.00 3 0.00 0.00 register_item_give + 0.00 34.74 0.00 3 0.00 0.00 register_reporttype + 0.00 34.74 0.00 3 0.00 0.00 report_failed_spell + 0.00 34.74 0.00 3 0.00 0.00 sp_charmingsong + 0.00 34.74 0.00 3 0.00 0.00 sp_eternizewall + 0.00 34.74 0.00 3 0.00 0.00 sp_song_of_peace + 0.00 34.74 0.00 3 0.00 0.00 target_resists_magic + 0.00 34.74 0.00 3 0.00 0.00 trigger_changerace + 0.00 34.74 0.00 3 0.00 0.00 update_nmrs + 0.00 34.74 0.00 3 0.00 0.00 use_healingpotion + 0.00 34.74 0.00 3 0.00 0.00 write_skill + 0.00 34.74 0.00 2 0.00 0.00 b_blockquestportal + 0.00 34.74 0.00 2 0.00 0.00 b_fvisible + 0.00 34.74 0.00 2 0.00 0.00 b_namequestportal + 0.00 34.74 0.00 2 0.00 0.00 b_opaque + 0.00 34.74 0.00 2 0.00 0.00 breedtrees + 0.00 34.74 0.00 2 0.00 0.00 claim_cmd + 0.00 34.74 0.00 2 0.00 0.00 create_directories + 0.00 34.74 0.00 2 0.00 0.00 create_ship + 0.00 34.74 0.00 2 0.00 0.00 disable_feature + 0.00 34.74 0.00 2 0.00 0.00 free_summary + 0.00 34.74 0.00 2 0.00 0.00 game_id + 0.00 34.74 0.00 2 0.00 0.00 giveitem_init + 0.00 34.74 0.00 2 0.00 0.00 giveitem_write + 0.00 34.74 0.00 2 0.00 0.00 init_directions + 0.00 34.74 0.00 2 0.00 0.00 init_keywords + 0.00 34.74 0.00 2 0.00 0.00 init_locale + 0.00 34.74 0.00 2 0.00 0.00 init_options_translation + 0.00 34.74 0.00 2 0.00 0.00 init_parameters + 0.00 34.74 0.00 2 0.00 0.00 init_skills + 0.00 34.74 0.00 2 0.00 0.00 init_terrains_translation + 0.00 34.74 0.00 2 0.00 0.00 json_keyword + 0.00 34.74 0.00 2 0.00 0.00 limit_mallornseeds + 0.00 34.74 0.00 2 0.00 0.00 log_create + 0.00 34.74 0.00 2 0.00 0.00 make_skillmod + 0.00 34.74 0.00 2 0.00 0.00 new_ship + 0.00 34.74 0.00 2 0.00 0.00 register_item_useonother + 0.00 34.74 0.00 2 0.00 0.00 register_special_direction + 0.00 34.74 0.00 2 0.00 0.00 remove_building + 0.00 34.74 0.00 2 0.00 0.00 report_summary + 0.00 34.74 0.00 2 0.00 0.00 res_changehp + 0.00 34.74 0.00 2 0.00 0.00 sp_bloodsacrifice + 0.00 34.74 0.00 2 0.00 0.00 sp_igjarjuk + 0.00 34.74 0.00 2 0.00 0.00 sp_summon_familiar + 0.00 34.74 0.00 2 0.00 0.00 sp_viewreality + 0.00 34.74 0.00 2 0.00 0.00 summon_allies + 0.00 34.74 0.00 2 0.00 0.00 tolua_eressea_open + 0.00 34.74 0.00 2 0.00 0.00 tolua_reg_types_eressea + 0.00 34.74 0.00 2 0.00 0.00 tolua_unit_open + 0.00 34.74 0.00 2 0.00 0.00 trigger_changefaction + 0.00 34.74 0.00 2 0.00 0.00 verbosity_to_flags + 0.00 34.74 0.00 2 0.00 0.00 wormhole_age + 0.00 34.74 0.00 2 0.00 0.00 wormhole_read + 0.00 34.74 0.00 2 0.00 0.00 wormhole_write + 0.00 34.74 0.00 2 0.00 0.00 xml_readstrings + 0.00 34.74 0.00 1 0.00 0.00 a_finalizestring + 0.00 34.74 0.00 1 0.00 0.00 a_upgradekeys + 0.00 34.74 0.00 1 0.00 0.00 a_writekeys + 0.00 34.74 0.00 1 0.00 0.00 add_seen_faction + 0.00 34.74 0.00 1 0.00 0.00 age_borders + 0.00 34.74 0.00 1 0.00 0.00 age_illusion + 0.00 34.74 0.00 1 0.00 0.00 attrib_done + 0.00 34.74 0.00 1 0.00 0.00 b_read + 0.00 34.74 0.00 1 0.00 0.00 b_write + 0.00 34.74 0.00 1 0.00 0.00 bind_monsters + 0.00 34.74 0.00 1 0.00 0.00 caldera_handle + 0.00 34.74 0.00 1 0.00 0.00 caldera_read + 0.00 34.74 0.00 1 0.00 0.00 caldera_write + 0.00 34.74 0.00 1 0.00 0.00 calendar_cleanup + 0.00 34.74 0.00 1 0.00 0.00 chaos_register + 0.00 34.74 0.00 1 0.00 0.00 check_messages_exist + 0.00 34.74 0.00 1 0.00 0.01 clear_npc_orders + 0.00 34.74 0.00 1 0.00 0.00 clonedied_read + 0.00 34.74 0.00 1 0.00 0.00 clonedied_write + 0.00 34.74 0.00 1 0.00 0.02 config_parse + 0.00 34.74 0.00 1 0.00 0.02 config_read + 0.00 34.74 0.00 1 0.00 0.00 create_mage + 0.00 34.74 0.00 1 0.00 0.00 create_newfamiliar + 0.00 34.74 0.00 1 0.00 0.00 crmessage_done + 0.00 34.74 0.00 1 0.00 0.00 ct_checknames + 0.00 34.74 0.00 1 0.00 0.00 curses_done + 0.00 34.74 0.00 1 0.00 0.00 dazzle + 0.00 34.74 0.00 1 0.00 0.54 demographics + 0.00 34.74 0.00 1 0.00 0.00 destroy_road + 0.00 34.74 0.00 1 0.00 0.45 do_battles + 0.00 34.74 0.00 1 0.00 0.00 enable_keyword + 0.00 34.74 0.00 1 0.00 0.00 equipment_done + 0.00 34.74 0.00 1 0.00 0.46 eressea_read_game + 0.00 34.74 0.00 1 0.00 0.00 eressea_run + 0.00 34.74 0.00 1 0.00 0.36 eressea_write_game + 0.00 34.74 0.00 1 0.00 0.00 flyingship_age + 0.00 34.74 0.00 1 0.00 0.01 free_config + 0.00 34.74 0.00 1 0.00 0.00 free_functions + 0.00 34.74 0.00 1 0.00 0.00 free_functions + 0.00 34.74 0.00 1 0.00 0.00 free_locales + 0.00 34.74 0.00 1 0.00 0.00 fumble_default + 0.00 34.74 0.00 1 0.00 0.00 funhash + 0.00 34.74 0.00 1 0.00 0.01 game_done + 0.00 34.74 0.00 1 0.00 0.00 game_init + 0.00 34.74 0.00 1 0.00 0.00 get_arg + 0.00 34.74 0.00 1 0.00 0.00 get_translation + 0.00 34.74 0.00 1 0.00 0.00 giveitem_read + 0.00 34.74 0.00 1 0.00 0.00 has_limited_skills + 0.00 34.74 0.00 1 0.00 0.04 icebergs + 0.00 34.74 0.00 1 0.00 0.04 immigration + 0.00 34.74 0.00 1 0.00 0.00 init_data + 0.00 34.74 0.00 1 0.00 0.00 init_genrand + 0.00 34.74 0.00 1 0.00 0.00 init_itemtypes + 0.00 34.74 0.00 1 0.00 0.00 init_mallornseed + 0.00 34.74 0.00 1 0.00 0.00 init_oldpotions + 0.00 34.74 0.00 1 0.00 0.00 init_processor + 0.00 34.74 0.00 1 0.00 0.02 init_reports + 0.00 34.74 0.00 1 0.00 0.00 init_resources + 0.00 34.74 0.00 1 0.00 0.00 init_rules + 0.00 34.74 0.00 1 0.00 0.00 init_seed + 0.00 34.74 0.00 1 0.00 0.00 init_smithy + 0.00 34.74 0.00 1 0.00 0.00 init_terrains + 0.00 34.74 0.00 1 0.00 0.00 item_done + 0.00 34.74 0.00 1 0.00 0.00 json_disable_features + 0.00 34.74 0.00 1 0.00 0.00 json_include + 0.00 34.74 0.00 1 0.00 0.00 json_keywords + 0.00 34.74 0.00 1 0.00 0.00 json_prefixes + 0.00 34.74 0.00 1 0.00 0.02 json_settings + 0.00 34.74 0.00 1 0.00 0.00 json_terrains + 0.00 34.74 0.00 1 0.00 0.00 kernel_done + 0.00 34.74 0.00 1 0.00 0.00 kernel_init + 0.00 34.74 0.00 1 0.00 0.00 levitate_ship + 0.00 34.74 0.00 1 0.00 0.00 load_inifile + 0.00 34.74 0.00 1 0.00 0.00 locale_init + 0.00 34.74 0.00 1 0.00 0.00 log_close + 0.00 34.74 0.00 1 0.00 0.00 log_open + 0.00 34.74 0.00 1 0.00 0.00 log_rotate + 0.00 34.74 0.00 1 0.00 0.00 log_to_file + 0.00 34.74 0.00 1 0.00 0.00 lua_done + 0.00 34.74 0.00 1 0.00 0.00 lua_init + 0.00 34.74 0.00 1 0.00 0.00 make_familiar + 0.00 34.74 0.00 1 0.00 0.00 make_locales + 0.00 34.74 0.00 1 0.00 0.00 make_matmod + 0.00 34.74 0.00 1 0.00 0.00 make_wormhole + 0.00 34.74 0.00 1 0.00 0.00 make_wormholes + 0.00 34.74 0.00 1 0.00 0.00 make_zombie + 0.00 34.74 0.00 1 0.00 0.00 message_done + 0.00 34.74 0.00 1 0.00 0.07 monthly_healing + 0.00 34.74 0.00 1 0.00 0.00 mt_clear + 0.00 34.74 0.00 1 0.00 0.04 new_units + 0.00 34.74 0.00 1 0.00 0.00 nmr_death + 0.00 34.74 0.00 1 0.00 0.00 nmr_warnings + 0.00 34.74 0.00 1 0.00 0.00 oldfamiliars + 0.00 34.74 0.00 1 0.00 0.00 openlibs + 0.00 34.74 0.00 1 0.00 0.00 parse_args + 0.00 34.74 0.00 1 0.00 0.00 parse_buildings + 0.00 34.74 0.00 1 0.00 0.00 parse_calendar + 0.00 34.74 0.00 1 0.00 0.00 parse_config + 0.00 34.74 0.00 1 0.00 0.00 parse_equipment + 0.00 34.74 0.00 1 0.00 0.00 parse_inifile + 0.00 34.74 0.00 1 0.00 0.00 parse_messages + 0.00 34.74 0.00 1 0.00 0.00 parse_races + 0.00 34.74 0.00 1 0.00 0.00 parse_resources + 0.00 34.74 0.00 1 0.00 0.00 parse_rules + 0.00 34.74 0.00 1 0.00 0.00 parse_ships + 0.00 34.74 0.00 1 0.00 0.00 parse_spellbooks + 0.00 34.74 0.00 1 0.00 0.00 parse_spells + 0.00 34.74 0.00 1 0.00 0.00 parse_strings + 0.00 34.74 0.00 1 0.00 0.00 pathfinder_cleanup + 0.00 34.74 0.00 1 0.00 0.53 plan_monsters + 0.00 34.74 0.00 1 0.00 0.00 plant + 0.00 34.74 0.00 1 0.00 0.00 planttrees + 0.00 34.74 0.00 1 0.00 5.61 processorders + 0.00 34.74 0.00 1 0.00 0.00 produce_mallornseeds + 0.00 34.74 0.00 1 0.00 0.00 promotion_cmd + 0.00 34.74 0.00 1 0.00 0.05 quit + 0.00 34.74 0.00 1 0.00 0.00 read_alliances + 0.00 34.74 0.00 1 0.00 0.00 read_borders + 0.00 34.74 0.00 1 0.00 0.00 read_building_reference + 0.00 34.74 0.00 1 0.00 0.46 read_game + 0.00 34.74 0.00 1 0.00 0.00 read_planes + 0.00 34.74 0.00 1 0.00 0.00 read_xml + 0.00 34.74 0.00 1 0.00 0.46 readgame + 0.00 34.74 0.00 1 0.00 0.65 readorders + 0.00 34.74 0.00 1 0.00 0.00 recruit_init + 0.00 34.74 0.00 1 0.00 0.00 register_arena + 0.00 34.74 0.00 1 0.00 0.00 register_artrewards + 0.00 34.74 0.00 1 0.00 0.00 register_attributes + 0.00 34.74 0.00 1 0.00 0.00 register_borders + 0.00 34.74 0.00 1 0.00 0.00 register_buildingcurse + 0.00 34.74 0.00 1 0.00 0.00 register_buildings + 0.00 34.74 0.00 1 0.00 0.00 register_cr + 0.00 34.74 0.00 1 0.00 0.00 register_demonseye + 0.00 34.74 0.00 1 0.00 0.00 register_flyingship + 0.00 34.74 0.00 1 0.00 0.00 register_gmcmd + 0.00 34.74 0.00 1 0.00 0.00 register_itemfunctions + 0.00 34.74 0.00 1 0.00 0.00 register_itemtypes + 0.00 34.74 0.00 1 0.00 0.00 register_magicresistance + 0.00 34.74 0.00 1 0.00 0.00 register_museum + 0.00 34.74 0.00 1 0.00 0.00 register_names + 0.00 34.74 0.00 1 0.00 0.00 register_nr + 0.00 34.74 0.00 1 0.00 0.00 register_race_description_function + 0.00 34.74 0.00 1 0.00 0.00 register_races + 0.00 34.74 0.00 1 0.00 0.00 register_regioncurse + 0.00 34.74 0.00 1 0.00 0.00 register_reports + 0.00 34.74 0.00 1 0.00 0.00 register_resources + 0.00 34.74 0.00 1 0.00 0.00 register_shipcurse + 0.00 34.74 0.00 1 0.00 0.00 register_spelldata + 0.00 34.74 0.00 1 0.00 0.00 register_spells + 0.00 34.74 0.00 1 0.00 0.00 register_tolua_helpers + 0.00 34.74 0.00 1 0.00 0.00 register_triggers + 0.00 34.74 0.00 1 0.00 0.00 register_unitcurse + 0.00 34.74 0.00 1 0.00 0.00 register_weapons + 0.00 34.74 0.00 1 0.00 0.00 register_xerewards + 0.00 34.74 0.00 1 0.00 0.00 register_xmas + 0.00 34.74 0.00 1 0.00 0.00 register_xmlreader + 0.00 34.74 0.00 1 0.00 0.03 remove_idle_players + 0.00 34.74 0.00 1 0.00 0.00 removelist + 0.00 34.74 0.00 1 0.00 0.00 renumber_factions + 0.00 34.74 0.00 1 0.00 0.00 report_donations + 0.00 34.74 0.00 1 0.00 0.00 report_failure + 0.00 34.74 0.00 1 0.00 0.00 report_spell + 0.00 34.74 0.00 1 0.00 18.69 reports + 0.00 34.74 0.00 1 0.00 0.00 reports_done + 0.00 34.74 0.00 1 0.00 0.00 resolve + 0.00 34.74 0.00 1 0.00 0.00 resolve_building + 0.00 34.74 0.00 1 0.00 0.00 select_familiar + 0.00 34.74 0.00 1 0.00 0.00 select_wormhole_regions + 0.00 34.74 0.00 1 0.00 0.00 setup_signal_handler + 0.00 34.74 0.00 1 0.00 0.00 shipcurse_flyingship + 0.00 34.74 0.00 1 0.00 0.00 sort_wormhole_regions + 0.00 34.74 0.00 1 0.00 0.00 sp_enterastral + 0.00 34.74 0.00 1 0.00 0.00 sp_flying_ship + 0.00 34.74 0.00 1 0.00 0.00 sp_generous + 0.00 34.74 0.00 1 0.00 0.00 sp_holyground + 0.00 34.74 0.00 1 0.00 0.00 sp_seduce + 0.00 34.74 0.00 1 0.00 0.00 sp_summonshadowlords + 0.00 34.74 0.00 1 0.00 0.01 spawn_braineaters + 0.00 34.74 0.00 1 0.00 0.01 spawn_undead + 0.00 34.74 0.00 1 0.00 0.00 t_add + 0.00 34.74 0.00 1 0.00 0.00 tolua_bind_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_bindings_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_building_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_config_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_dict_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_faction_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_game_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_gmtool_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_locale_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_log_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_message_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_order_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_process_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_reg_types_config + 0.00 34.74 0.00 1 0.00 0.00 tolua_reg_types_game + 0.00 34.74 0.00 1 0.00 0.00 tolua_reg_types_locale + 0.00 34.74 0.00 1 0.00 0.00 tolua_reg_types_log + 0.00 34.74 0.00 1 0.00 0.00 tolua_reg_types_process + 0.00 34.74 0.00 1 0.00 0.00 tolua_reg_types_settings + 0.00 34.74 0.00 1 0.00 0.00 tolua_region_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_settings_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_ship_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_sqlite_open + 0.00 34.74 0.00 1 0.00 0.00 tolua_storage_open + 0.00 34.74 0.00 1 0.00 0.00 translation_done + 0.00 34.74 0.00 1 0.00 0.00 translation_init + 0.00 34.74 0.00 1 0.00 0.00 trigger_giveitem + 0.00 34.74 0.00 1 0.00 0.00 trigger_shock + 0.00 34.74 0.00 1 0.00 0.03 update_spells + 0.00 34.74 0.00 1 0.00 0.00 use_skillpotion + 0.00 34.74 0.00 1 0.00 0.00 valid_race + 0.00 34.74 0.00 1 0.00 0.00 version_no + 0.00 34.74 0.00 1 0.00 0.00 volcano_update + 0.00 34.74 0.00 1 0.00 0.00 wormholes_register + 0.00 34.74 0.00 1 0.00 0.00 wormholes_update + 0.00 34.74 0.00 1 0.00 0.00 write_alliances + 0.00 34.74 0.00 1 0.00 0.00 write_borders + 0.00 34.74 0.00 1 0.00 0.00 write_planes + 0.00 34.74 0.00 1 0.00 0.35 writegame + 0.00 34.74 0.00 1 0.00 0.00 writepasswd + 0.00 34.74 0.00 1 0.00 0.00 writeturn + 0.00 34.74 0.00 1 0.00 0.00 xml_done + + % the percentage of the total running time of the +time program used by this function. + +cumulative a running sum of the number of seconds accounted + seconds for by this function and those listed above it. + + self the number of seconds accounted for by this +seconds function alone. This is the major sort for this + listing. + +calls the number of times this function was invoked, if + this function is profiled, else blank. + + self the average number of milliseconds spent in this +ms/call function per call, if this function is profiled, + else blank. + + total the average number of milliseconds spent in this +ms/call function and its descendents per call, if this + function is profiled, else blank. + +name the name of the function. This is the minor sort + for this listing. The index shows the location of + the function in the gprof listing. If the index is + in parenthesis it shows where it would appear in + the gprof listing if it were to be printed. + + Call graph (explanation follows) + + +granularity: each sample hit covers 2 byte(s) for 0.03% of 34.74 seconds + +index % time self children called name + +[1] 53.9 0.00 18.72 tolua_write_reports [1] + 0.00 18.69 1/1 reports [2] + 0.00 0.02 1/1 init_reports [399] +----------------------------------------------- + 0.00 18.69 1/1 tolua_write_reports [1] +[2] 53.8 0.00 18.69 1 reports [2] + 0.00 18.67 232/232 write_reports [3] + 0.00 0.02 1/6 remove_empty_units [146] + 0.00 0.00 1/1 report_donations [725] + 0.00 0.00 232/232 write_script [853] + 0.00 0.00 1/573 join_path [1016] + 0.00 0.00 1/564 reportpath [1063] + 0.00 0.00 1/64 log_info [1339] +----------------------------------------------- + 0.00 18.67 232/232 reports [2] +[3] 53.7 0.00 18.67 232 write_reports [3] + 0.77 6.37 230/230 report_plaintext [4] + 3.91 0.70 232/232 prepare_report [8] + 0.96 3.25 230/230 report_computer [9] + 0.96 0.53 232/232 get_addresses [20] + 0.88 0.00 232/232 finish_reports [33] + 0.27 0.06 99/99 report_template [87] + 0.00 0.00 559/5100840 itoa36 [116] + 0.00 0.00 559/573 join_path [1016] + 0.00 0.00 559/564 reportpath [1063] + 0.00 0.00 232/1295787 factionname [247] + 0.00 0.00 232/49235 log_debug [1245] +----------------------------------------------- + 0.77 6.37 230/230 write_reports [3] +[4] 20.6 0.77 6.37 230 report_plaintext [4] + 0.02 2.96 1344397/1344397 nr_unit [11] + 0.05 0.77 127676/127676 describe [35] + 0.03 0.77 78504/79180 rp_messages [36] + 0.29 0.13 453309/1437425 cansee [22] + 0.02 0.40 33139/33139 statistics [70] + 0.03 0.31 35287/35287 prices [85] + 0.01 0.21 180598/180598 nr_ship [111] + 0.01 0.12 113592/113592 nr_building [141] + 0.02 0.04 62581/62581 guards [229] + 0.04 0.00 21341107/50553492 stealth_modifier [188] + 0.01 0.03 127676/127676 write_travelthru [327] + 0.00 0.02 230/230 allies [419] + 0.02 0.00 78274/130250 r_getmessages [360] + 0.00 0.01 2081/2081 nr_spell [507] + 0.00 0.01 230/230 rp_battles [618] + 0.00 0.01 230/481 count_units [487] + 0.00 0.01 230/967 count_all [357] + 0.00 0.01 230/461 maxheroes [492] + 0.00 0.01 229/229 list_address [635] + 0.00 0.00 226/457 countheroes [572] + 0.00 0.00 293098/2494242 newline [594] + 0.00 0.00 1080/1380398 nr_render [25] + 0.00 0.00 23/45 count_maxmigrants [730] + 0.00 0.00 23/45 count_migrants [731] + 0.00 0.00 54055/2605004 rpeasants [435] + 0.00 0.00 62581/163027 markets_module [748] + 0.00 0.00 5009/24887945 locale_string [27] + 0.00 0.00 1080/967784 msg_message [132] + 0.00 0.00 162/786 average_score_of_age [777] + 0.00 0.00 4967/34611296 strlcpy [45] + 0.00 0.00 230/230 gamedate_season [944] + 0.00 0.00 3437/37931 centre [789] + 0.00 0.00 460/71815034 get_race [12] + 0.00 0.00 5871/36653945 wrptr [178] + 0.00 0.00 230/1295787 factionname [247] + 0.00 0.00 1539/13259934 resourcename [233] + 0.00 0.00 567/4133717 mkname [261] + 0.00 0.00 230/2818494 rc_name_s [260] + 0.00 0.00 460/51974272 a_find [65] + 0.00 0.00 230/462 game_name [1168] + 0.00 0.00 324/1572 write_score [1135] + 0.00 0.00 460/20836359 f_get_alliance [455] + 0.00 0.00 1/3902878 get_monsters [293] + 0.00 0.00 230/1214 rule_faction_limit [1331] + 0.00 0.00 128596/128596 check_errno [1432] + 0.00 0.00 127906/128135 rpline [1433] + 0.00 0.00 9147/9147 merge_messages [1517] + 0.00 0.00 9147/9147 split_messages [1518] + 0.00 0.00 1080/1009028 msg_release [1373] + 0.00 0.00 460/40692 get_gamedate [1466] + 0.00 0.00 337/1582 resource2potion [1569] +----------------------------------------------- + +[5] 16.2 0.00 5.64 tolua_process_orders [5] + 0.00 5.61 1/1 processorders [6] + 0.03 0.00 1/1 reset_game [356] +----------------------------------------------- + 0.00 5.61 1/1 tolua_process_orders [5] +[6] 16.2 0.00 5.61 1 processorders [6] + 0.47 5.00 1/1 process [7] + 0.04 0.05 1/1 ageing [185] + 0.00 0.03 1/1 update_spells [381] + 0.00 0.02 1/6 remove_empty_units [146] + 0.00 0.00 1/1 wormholes_update [906] + 0.00 0.00 1/1 init_processor [1310] + 0.00 0.00 2/4984610 config_get_int [348] + 0.00 0.00 1/64 log_info [1339] +----------------------------------------------- + 0.47 5.00 1/1 processorders [6] +[7] 15.7 0.47 5.00 1 process [7] + 0.00 1.07 178254/178254 produce [29] + 0.04 0.57 1/1 movement [47] + 0.00 0.54 1/1 demographics [50] + 0.00 0.45 1/1 do_battles [63] + 0.02 0.34 178254/178254 economics [78] + 0.04 0.27 1/1 randomevents [91] + 0.29 0.00 31172689/55492327 getkeyword [54] + 0.03 0.21 417808/417808 study_cmd [105] + 0.00 0.12 534762/534762 enter_1 [145] + 0.01 0.10 1/1 magic [157] + 0.00 0.09 799/799 setstealth_cmd [182] + 0.00 0.07 1/1 monthly_healing [215] + 0.00 0.06 595478/595478 monster_kills_peasants [230] + 0.03 0.02 1/1 defaultorders [249] + 0.04 0.01 178254/178254 do_contact [250] + 0.01 0.04 595896/595896 update_long_order [270] + 0.00 0.05 5384/5384 teach_cmd [272] + 0.00 0.05 1/1 quit [276] + 0.00 0.04 1/1 new_units [282] + 0.00 0.04 131765/131765 give_control_cmd [287] + 0.00 0.04 178254/178254 enter_2 [295] + 0.00 0.04 35708/35708 reserve_cmd [324] + 0.00 0.04 35708/35708 reserve_self [325] + 0.02 0.02 595898/595898 follow_unit [331] + 0.01 0.02 178254/178254 maintain_buildings [339] + 0.01 0.02 1/1 regenerate_aura [346] + 0.02 0.01 1/1 restack_units [353] + 0.00 0.03 10600/10600 make_cmd [383] + 0.01 0.01 178254/178254 sinkships [475] + 0.00 0.01 438223/71815034 get_race [12] + 0.01 0.00 178254/178254 do_siege [515] + 0.00 0.00 30554/30554 guard_on_cmd [656] + 0.00 0.00 435900/1629412 LongHunger [536] + 0.00 0.00 30634/30634 guard_off_cmd [711] + 0.00 0.00 236/236 leave_cmd [721] + 0.00 0.00 178254/178254 split_allocations [743] + 0.00 0.00 439954/129167539 u_race [89] + 0.00 0.00 590/590 use_cmd [763] + 0.00 0.00 138/138 renumber_cmd [780] + 0.00 0.00 241/241 reshow_cmd [818] + 0.00 0.00 3117/3117 name_cmd [835] + 0.00 0.00 348/348 mail_cmd [844] + 0.00 0.00 2013/2013 display_cmd [859] + 0.00 0.00 791/791 ally_cmd [877] + 0.00 0.00 1/1 nmr_warnings [878] + 0.00 0.00 80/80 combatspell_cmd [898] + 0.00 0.00 1700/1700 status_cmd [904] + 0.00 0.00 1/1 promotion_cmd [917] + 0.00 0.00 621/621 group_cmd [985] + 0.00 0.00 1/1 renumber_factions [1156] + 0.00 0.00 6/6 send_cmd [1202] + 0.00 0.00 17/12246335 ct_find [114] + 0.00 0.00 2/2 claim_cmd [1242] + 0.00 0.00 17/10190660 get_curse [143] + 0.00 0.00 17/4201030 curse_active [543] + 0.00 0.00 68/49235 log_debug [1245] + 0.00 0.00 5588/59694 r_insectstalled [1446] + 0.00 0.00 17/651711 oldcursename [1381] + 0.00 0.00 5/5 free_group [1750] +----------------------------------------------- + 3.91 0.70 232/232 write_reports [3] +[8] 13.3 3.91 0.70 232 prepare_report [8] + 0.08 0.53 3066474/3398582 travelthru_map [41] + 0.00 0.03 3438/3438 prepare_lighthouse [340] + 0.00 0.02 596221/71815034 get_race [12] + 0.01 0.01 596221/745269 add_seen_nb [386] + 0.02 0.00 464/464 firstregion [485] + 0.00 0.00 596221/129167539 u_race [89] + 0.00 0.00 232/560926 bt_find [237] + 0.00 0.00 1/216069 config_token [794] + 0.00 0.00 3563/26995 inside_building [1486] + 0.00 0.00 464/464 lastregion [1601] + 0.00 0.00 232/2386892 config_changed [1352] +----------------------------------------------- + 0.96 3.25 230/230 write_reports [3] +[9] 12.1 0.96 3.25 230 report_computer [9] + 0.01 3.18 209572/209572 cr_output_region [10] + 0.00 0.02 230/230 report_crtypes [428] + 0.00 0.01 230/230 cr_find_address [602] + 0.00 0.01 230/967 count_all [357] + 0.00 0.01 230/461 maxheroes [492] + 0.00 0.01 723/61961 cr_output_messages [57] + 0.01 0.00 230/457 countheroes [572] + 0.00 0.00 1921/1921 show_allies_cr [661] + 0.00 0.00 230/230 write_translations [689] + 0.00 0.00 2081/2081 cr_reportspell [756] + 0.00 0.00 22/45 count_maxmigrants [730] + 0.00 0.00 22/45 count_migrants [731] + 0.00 0.00 460/11719 locale_name [568] + 0.00 0.00 1896/4434556 translate [75] + 0.00 0.00 162/786 average_score_of_age [777] + 0.00 0.00 2693/24887945 locale_string [27] + 0.00 0.00 1921/2277350 get_prefix [263] + 0.00 0.00 493/1826688 adjust_coordinates [234] + 0.00 0.00 1876/13259934 resourcename [233] + 0.00 0.00 337/32337529 hashstring [37] + 0.00 0.00 464/4133717 mkname [261] + 0.00 0.00 230/2818494 rc_name_s [260] + 0.00 0.00 460/51974272 a_find [65] + 0.00 0.00 230/12560453 rc_changed [256] + 0.00 0.00 230/462 game_name [1168] + 0.00 0.00 324/1572 write_score [1135] + 0.00 0.00 230/45860 print_items [938] + 0.00 0.00 493/18647447 getplane [596] + 0.00 0.00 230/230 show_alliances_cr [1248] + 0.00 0.00 230/20836359 f_get_alliance [455] + 0.00 0.00 1/68430117 rc_find [15] + 0.00 0.00 1/4984610 config_get_int [348] + 0.00 0.00 230/1214 rule_faction_limit [1331] + 0.00 0.00 493/3587241 pnormalize [1350] + 0.00 0.00 337/1582 resource2potion [1569] + 0.00 0.00 230/231 eressea_version [1624] + 0.00 0.00 230/230 reset_translations [1625] +----------------------------------------------- + 0.01 3.18 209572/209572 report_computer [9] +[10] 9.2 0.01 3.18 209572 cr_output_region [10] + 0.01 1.60 923671/923671 cr_output_unit_compat [18] + 0.36 0.16 550775/1437425 cansee [22] + 0.00 0.46 61238/61961 cr_output_messages [57] + 0.06 0.09 209572/209572 cr_borders [135] + 0.00 0.12 179761/179761 cr_output_ship [152] + 0.00 0.06 45630/45630 cr_output_resources [238] + 0.00 0.06 104830/104830 cr_output_building [239] + 0.00 0.04 102149/102149 cr_output_travelthru [298] + 0.01 0.02 427650/4434556 translate [75] + 0.00 0.03 102149/386740 cr_output_curses_compat [144] + 0.00 0.02 249624/4374788 visible_faction [68] + 0.01 0.01 427650/24887945 locale_string [27] + 0.01 0.00 51976/130250 r_getmessages [360] + 0.00 0.01 104830/593636 building_owner [232] + 0.00 0.01 36929/490896 wage [174] + 0.00 0.01 209572/1874928 terrain_name [226] + 0.01 0.00 211668/1826688 adjust_coordinates [234] + 0.00 0.00 77909/1552289 rname [200] + 0.00 0.00 36937/79772 entertainmoney [643] + 0.00 0.00 365/8892 astralregions [329] + 0.00 0.00 36937/669051 production [417] + 0.00 0.00 179761/3358315 ship_owner [438] + 0.00 0.00 218078/13259934 resourcename [233] + 0.00 0.00 119504/2605004 rpeasants [435] + 0.00 0.00 38612/987488 is_astral [479] + 0.00 0.00 37300/12246335 ct_find [114] + 0.00 0.00 37300/10190660 get_curse [143] + 0.00 0.00 36937/163027 markets_module [748] + 0.00 0.00 102149/50553492 stealth_modifier [188] + 0.00 0.00 36937/4666665 rmoney [452] + 0.00 0.00 211668/18647447 getplane [596] + 0.00 0.00 37300/4201030 curse_active [543] + 0.00 0.00 45630/45860 print_items [938] + 0.00 0.00 36937/21345834 skill_enabled [365] + 0.00 0.00 36937/1613387 rule_region_owners [1323] + 0.00 0.00 211668/3587241 pnormalize [1350] + 0.00 0.00 209572/209572 cr_region_header [1414] + 0.00 0.00 45630/1160345 rhorses [1369] + 0.00 0.00 37300/651711 oldcursename [1381] + 0.00 0.00 36929/515192 is_mourning [1392] + 0.00 0.00 311/109377 free_regionlist [1436] +----------------------------------------------- + 0.02 2.96 1344397/1344397 report_plaintext [4] +[11] 8.6 0.02 2.96 1344397 nr_unit [11] + 0.03 1.85 1344359/1348743 bufunit [17] + 0.58 0.02 1344359/2742237 paragraph [26] + 0.43 0.03 1344359/1766225 nr_curses [48] + 0.01 0.00 1344359/51974272 a_find [65] + 0.01 0.00 1344359/2494242 newline [594] + 0.00 0.00 1344397/129167539 u_race [89] + 0.00 0.00 750517/1214628 is_allied [1368] + 0.00 0.00 373997/1380007 get_otherfaction [1362] +----------------------------------------------- + 0.00 0.00 1/71815034 sp_summonshadowlords [1034] + 0.00 0.00 1/71815034 rc_specialdamage [830] + 0.00 0.00 1/71815034 heal_factor [619] + 0.00 0.00 1/71815034 make_zombie [1267] + 0.00 0.00 1/71815034 is_migrant [1047] + 0.00 0.00 1/71815034 magic_lowskill [897] + 0.00 0.00 1/71815034 rc_skillmod [140] + 0.00 0.00 1/71815034 age_illusion [1308] + 0.00 0.00 2/71815034 omniscient [470] + 0.00 0.00 2/71815034 do_fumble [1062] + 0.00 0.00 2/71815034 sp_igjarjuk [923] + 0.00 0.00 2/71815034 skill_mod [264] + 0.00 0.00 3/71815034 guard_flags [690] + 0.00 0.00 3/71815034 cast_cmd [760] + 0.00 0.00 4/71815034 dissolve_units [241] + 0.00 0.00 4/71815034 age_firedragon [1123] + 0.00 0.00 5/71815034 age_dragon [1098] + 0.00 0.00 7/71815034 age_ghoul [1024] + 0.00 0.00 8/71815034 mod_elves_only [1239] + 0.00 0.00 10/71815034 chaos [848] + 0.00 0.00 10/71815034 spawn_dragons [411] + 0.00 0.00 12/71815034 sp_summonundead [896] + 0.00 0.00 15/71815034 steal_cmd [766] + 0.00 0.00 17/71815034 recruit_dracoids [837] + 0.00 0.00 17/71815034 age_zombie [1019] + 0.00 0.00 19/71815034 age_skeleton [1008] + 0.00 0.00 20/71815034 damage_unit [1044] + 0.00 0.00 20/71815034 spawn_seaserpent [831] + 0.00 0.00 31/71815034 random_unit [1174] + 0.00 0.00 38/71815034 sp_viewreality [784] + 0.00 0.00 42/71815034 loot_cmd [873] + 0.00 0.00 44/71815034 plan_dragon [273] + 0.00 0.00 44/71815034 build_road [950] + 0.00 0.00 56/71815034 use_bloodpotion [935] + 0.00 0.00 71/71815034 disband_men [999] + 0.00 0.00 93/71815034 report_summary [614] + 0.00 0.00 138/71815034 LongHunger [536] + 0.00 0.00 188/71815034 is_freezing [1088] + 0.00 0.00 247/71815034 spawn_undead [629] + 0.00 0.00 460/71815034 report_plaintext [4] + 0.00 0.00 489/71815034 make_fighter [424] + 0.00 0.00 639/71815034 spawn_braineaters [505] + 0.00 0.00 659/71815034 can_give_men [940] + 0.00 0.00 960/71815034 tax_cmd [697] + 0.00 0.00 1098/71815034 statistics [70] + 0.00 0.00 1689/71815034 recruit [650] + 0.00 0.00 1725/71815034 max_magicians [915] + 0.00 0.00 3743/71815034 battle_flee [352] + 0.00 0.00 5915/71815034 buy [707] + 0.00 0.00 7279/71815034 remove_empty_units_in_region [134] + 0.00 0.00 7560/71815034 drown [394] + 0.00 0.00 7957/71815034 magic_resistance [727] + 0.00 0.00 12787/71815034 canwalk [633] + 0.00 0.00 15763/71815034 sell [498] + 0.00 0.00 18304/71815034 average_score_of_age [777] + 0.00 0.00 23630/71815034 immigration [294] + 0.00 0.00 23993/71815034 guard_on_cmd [656] + 0.00 0.00 27694/71815034 dragon_affinity_value [516] + 0.00 0.00 84047/71815034 monster_move [129] + 0.00 0.00 96637/71815034 walkingcapacity [403] + 0.00 0.00 102606/71815034 give_cmd [102] + 0.00 0.00 105958/71815034 travel_route [147] + 0.00 0.00 116914/71815034 fleechance [408] + 0.00 0.00 120592/71815034 CavalryBonus [491] + 0.00 0.00 125515/71815034 default_wage [173] + 0.00 0.00 154155/71815034 terminate [242] + 0.00 0.01 221802/71815034 unitorders [46] + 0.00 0.01 236296/71815034 weapon_skill [221] + 0.00 0.01 335497/71815034 plan_monsters [52] + 0.00 0.01 417740/71815034 study_cmd [105] + 0.00 0.01 438223/71815034 process [7] + 0.00 0.01 463903/71815034 skilldiff [166] + 0.00 0.02 595472/71815034 age_unit [336] + 0.00 0.02 595476/71815034 demon_skillchanges [246] + 0.00 0.02 596221/71815034 prepare_report [8] + 0.00 0.02 783946/71815034 produce [29] + 0.00 0.03 1044674/71815034 get_food [88] + 0.01 0.04 1190864/71815034 magic [157] + 0.01 0.07 2383980/71815034 score [23] + 0.27 1.91 61440990/71815034 old_race [14] +[12] 7.3 0.31 2.23 71815034 get_race [12] + 0.07 2.16 67832617/68430117 rc_find [15] +----------------------------------------------- + +[13] 6.9 2.41 0.00 cb_find_top_i [13] +----------------------------------------------- + 0.00 0.00 133/2480226 income [885] + 0.00 0.00 249/2480226 plan_dragon [273] + 0.01 0.08 96316/2480226 movement_speed [155] + 0.09 1.04 1191719/2480226 score [23] + 0.09 1.04 1191809/2480226 make_summary [21] +[14] 6.8 0.19 2.17 2480226 old_race [14] + 0.27 1.91 61440990/71815034 get_race [12] +----------------------------------------------- + 0.00 0.00 1/68430117 report_computer [9] + 0.00 0.00 1/68430117 use_bloodpotion [935] + 0.00 0.00 2/68430117 parse_resources [1086] + 0.00 0.00 3/68430117 xml_readweapon [1266] + 0.00 0.00 6/68430117 tolua_unit_create [916] + 0.00 0.00 233/68430117 readfaction [767] + 0.00 0.02 597254/68430117 read_unit [74] + 0.07 2.16 67832617/68430117 get_race [12] +[15] 6.5 0.07 2.18 68430117 rc_find [15] + 2.18 0.00 68430117/68430271 rc_find_i [16] +----------------------------------------------- + 0.00 0.00 4/68430271 read_race_reference [1278] + 0.00 0.00 150/68430271 rc_get_or_create [1105] + 2.18 0.00 68430117/68430271 rc_find [15] +[16] 6.3 2.18 0.00 68430271 rc_find_i [16] +----------------------------------------------- + 0.00 0.01 4384/1348743 spunit [632] + 0.03 1.85 1344359/1348743 nr_unit [11] +[17] 5.4 0.03 1.85 1348743 bufunit [17] + 0.04 0.49 1953682/1953682 spskill [53] + 0.04 0.20 9318596/17451017 strlcpy_w [67] + 0.01 0.14 1350873/1351796 racename [133] + 0.00 0.13 1348743/4374788 visible_faction [68] + 0.03 0.10 704700/1405457 report_items [103] + 0.01 0.10 1187497/1205451 alliedfaction [162] + 0.00 0.08 494960/494960 buforder [201] + 0.01 0.07 1348743/2383101 unitname [142] + 0.00 0.06 598226/773191 hp_status [206] + 0.00 0.05 1145124/1295787 factionname [247] + 0.02 0.02 834439/24887945 locale_string [27] + 0.00 0.04 598226/598234 report_status [318] + 0.00 0.03 373172/9953180 alliedunit [31] + 0.01 0.02 1783118/12353561 report_item [106] + 0.02 0.00 1348743/2868601 u_irace [257] + 0.00 0.02 595139/597806 unit_get_spellbook [427] + 0.00 0.02 1348743/2272376 u_description [347] + 0.01 0.01 1348743/2275967 get_racename [368] + 0.02 0.00 6078454/36653945 wrptr [178] + 0.00 0.02 1348743/6610983 is_guard [211] + 0.01 0.00 1401002/51974272 a_find [65] + 0.00 0.01 1348743/1523708 uprivate [497] + 0.01 0.00 1045507/55492327 getkeyword [54] + 0.00 0.00 1045507/2985733 is_repeated [552] + 0.00 0.00 761036/4503145 omniscient [470] + 0.00 0.00 1348743/4835422 usiege [593] + 0.00 0.00 56643/56643 groupid [698] + 0.00 0.00 35516/86400 spell_name [646] + 0.00 0.00 597269/129167539 u_race [89] + 0.00 0.00 1187497/18647447 getplane [596] + 0.00 0.00 32943/34611296 strlcpy [45] + 0.00 0.00 1334/5358 max_spellpoints [755] + 0.00 0.00 4786/4875 get_combatspell [874] + 0.00 0.00 1265/1339 get_combatspelllevel [880] + 0.00 0.00 1334/12320804 effskill [100] + 0.00 0.00 1334/4915 get_spellpoints [872] + 0.00 0.00 401604/1380007 get_otherfaction [1362] +----------------------------------------------- + 0.01 1.60 923671/923671 cr_output_region [10] +[18] 4.6 0.01 1.60 923671 cr_output_unit_compat [18] + 0.12 1.48 923671/923671 cr_output_unit [19] +----------------------------------------------- + 0.12 1.48 923671/923671 cr_output_unit_compat [18] +[19] 4.6 0.12 1.48 923671 cr_output_unit [19] + 0.28 0.02 923633/1310373 cr_output_curses [69] + 0.11 0.17 3373083/4434556 translate [75] + 0.07 0.07 2768576/24887945 locale_string [27] + 0.02 0.10 700757/1405457 report_items [103] + 0.01 0.09 610341/610341 stream_order [167] + 0.10 0.00 9429681/10103290 stream_printf [158] + 0.00 0.09 923633/4374788 visible_faction [68] + 0.02 0.03 604957/12320804 effskill [100] + 0.00 0.04 603246/2934859 skillname [122] + 0.00 0.03 371101/9953180 alliedunit [31] + 0.01 0.02 1727391/12353561 report_item [106] + 0.00 0.02 923633/2275429 raceprefix [222] + 0.00 0.02 174965/773191 hp_status [206] + 0.01 0.01 925760/2818494 rc_name_s [260] + 0.02 0.00 923633/2868601 u_irace [257] + 0.00 0.01 923633/2272376 u_description [347] + 0.01 0.01 174965/279395 weight [459] + 0.00 0.01 923633/2275967 get_racename [368] + 0.00 0.01 923633/6610983 is_guard [211] + 0.00 0.01 923633/3351853 unit_getname [332] + 0.00 0.01 2246004/4503145 omniscient [470] + 0.00 0.01 716432/4133717 mkname [261] + 0.01 0.00 973220/51974272 a_find [65] + 0.01 0.00 695201/55492327 getkeyword [54] + 0.00 0.01 174965/1441945 is_mage [262] + 0.00 0.01 174965/2426021 get_mage [198] + 0.00 0.01 1711/1711 cr_output_spells [639] + 0.00 0.00 1100763/129167539 u_race [89] + 0.00 0.00 174965/7120688 get_money [187] + 0.00 0.00 923633/4835422 usiege [593] + 0.00 0.00 174965/174968 get_familiar_mage [722] + 0.00 0.00 174965/285923 ualias [692] + 0.00 0.00 174965/1523708 uprivate [497] + 0.00 0.00 705241/2155959 is_persistent [687] + 0.00 0.00 1711/5358 max_spellpoints [755] + 0.00 0.00 68497/2985733 is_repeated [552] + 0.00 0.00 1261/86400 spell_name [646] + 0.00 0.00 1711/4915 get_spellpoints [872] + 0.00 0.00 1637/8034 u_geteffstealth [919] + 0.00 0.00 2127/21345834 skill_enabled [365] + 0.00 0.00 603246/603246 level_days [1388] + 0.00 0.00 412396/1380007 get_otherfaction [1362] +----------------------------------------------- + 0.96 0.53 232/232 write_reports [3] +[20] 4.3 0.96 0.53 232 get_addresses [20] + 0.27 0.12 418124/1437425 cansee [22] + 0.00 0.08 854692/4374788 visible_faction [68] + 0.05 0.00 29110236/50553492 stealth_modifier [188] + 0.00 0.00 15708/15708 add_travelthru_addresses [673] + 0.00 0.00 464/20836359 f_get_alliance [455] + 0.00 0.00 453546/1214628 is_allied [1368] + 0.00 0.00 350020/353788 add_seen_faction_i [1401] + 0.00 0.00 232/232 transfer_seen [1622] +----------------------------------------------- + 0.04 0.69 1/2 tolua_init_summary [40] + 0.04 0.69 1/2 tolua_write_summary [38] +[21] 4.2 0.08 1.38 2 make_summary [21] + 0.09 1.04 1191809/2480226 old_race [14] + 0.03 0.05 1213526/12320804 effskill [100] + 0.01 0.04 351667/771861 armedmen [151] + 0.05 0.00 713016/1248014 listlen [190] + 0.00 0.02 703334/5395063 i_get [130] + 0.02 0.00 1543013/7120688 get_money [187] + 0.00 0.01 839681/3902878 get_monsters [293] + 0.00 0.00 454160/2605004 rpeasants [435] + 0.00 0.00 1191346/129167539 u_race [89] + 0.00 0.00 97652/4666665 rmoney [452] + 0.00 0.00 2/56052475 get_resourcetype [194] + 0.00 0.00 356508/1160345 rhorses [1369] + 0.00 0.00 201709/1511812 newterrain [1359] +----------------------------------------------- + 0.00 0.00 4/1437425 init_transportation [384] + 0.00 0.00 4/1437425 sp_generous [1040] + 0.00 0.00 4/1437425 seefaction [1117] + 0.00 0.00 8/1437425 caught_target [1003] + 0.00 0.00 12/1437425 sp_enterastral [1045] + 0.00 0.00 14/1437425 verify_unit [1028] + 0.00 0.00 30/1437425 sp_song_of_peace [939] + 0.00 0.00 35/1437425 mailunit [921] + 0.00 0.00 38/1437425 mail_cmd [844] + 0.00 0.00 39/1437425 deliverMail [966] + 0.00 0.00 70/1437425 can_give_to [600] + 0.00 0.00 81/1437425 can_guard [908] + 0.00 0.00 84/1437425 steal_cmd [766] + 0.00 0.00 109/1437425 set_factionstealth [183] + 0.00 0.00 197/1437425 report_action [860] + 0.00 0.00 397/1437425 is_guardian_u [626] + 0.00 0.00 752/1437425 monster_attack [764] + 0.00 0.00 816/1437425 follow_unit [331] + 0.00 0.00 1443/1437425 start_battle [297] + 0.01 0.00 11080/1437425 monster_attacks [248] + 0.27 0.12 418124/1437425 get_addresses [20] + 0.29 0.13 453309/1437425 report_plaintext [4] + 0.36 0.16 550775/1437425 cr_output_region [10] +[22] 3.9 0.93 0.42 1437425 cansee [22] + 0.07 0.10 2363341/12320804 effskill [100] + 0.00 0.12 1513189/1753922 invisible [139] + 0.02 0.07 960413/1188532 eff_stealth [163] + 0.00 0.01 1211531/6610983 is_guard [211] + 0.00 0.01 1335380/1474687 leftship [500] + 0.00 0.01 1335533/4503145 omniscient [470] + 0.00 0.00 2363341/21345834 skill_enabled [365] + 0.00 0.00 1335533/129167539 u_race [89] + 0.00 0.00 1156253/4835422 usiege [593] + 0.00 0.00 48/51974272 a_find [65] +----------------------------------------------- + 0.06 1.25 2/2 tolua_update_scores [24] +[23] 3.8 0.06 1.25 2 score [23] + 0.09 1.04 1191719/2480226 old_race [14] + 0.01 0.07 2383980/71815034 get_race [12] + 0.01 0.00 1191719/7120688 get_money [187] + 0.01 0.00 3903981/129167539 u_race [89] + 0.00 0.01 92368/593636 building_owner [232] + 0.00 0.00 462/786 average_score_of_age [777] + 0.00 0.00 38156/3358315 ship_owner [438] + 0.00 0.00 462/5100840 itoa36 [116] + 0.00 0.00 924/1572 write_score [1135] + 0.00 0.00 2/573 join_path [1016] + 0.00 0.00 356508/1613387 rule_region_owners [1323] + 0.00 0.00 2/9 basepath [1730] +----------------------------------------------- + +[24] 3.8 0.00 1.31 tolua_update_scores [24] + 0.06 1.25 2/2 score [23] +----------------------------------------------- + 0.00 0.00 1/1380398 sp_summon_familiar [1025] + 0.00 0.00 676/1380398 rp_battles [618] + 0.00 0.00 1080/1380398 report_plaintext [4] + 0.00 0.01 12729/1380398 cr_output_curses [69] + 0.00 0.01 15186/1380398 nr_curses_i [401] + 0.00 0.04 41255/1380398 log_orders [251] + 0.00 0.15 163573/1380398 describe [35] + 0.00 0.18 192618/1380398 statistics [70] + 0.00 0.23 247009/1380398 prices [85] + 0.00 0.28 301257/1380398 render_messages [58] + 0.00 0.38 405014/1380398 rp_messages [36] +[25] 3.7 0.00 1.28 1380398 nr_render [25] + 0.11 1.07 1380398/1380398 translate [28] + 0.04 0.03 1380398/5168717 nrt_find [98] + 0.03 0.00 1380398/34611296 strlcpy [45] +----------------------------------------------- + 0.00 0.00 1888/2742237 allies [419] + 0.00 0.00 2081/2742237 nr_spell_syntax [732] + 0.00 0.00 10794/2742237 list_address [635] + 0.01 0.00 15186/2742237 nr_curses_i [401] + 0.01 0.00 19851/2742237 nr_spell [507] + 0.01 0.00 27498/2742237 guards [229] + 0.02 0.00 35287/2742237 prices [85] + 0.02 0.00 55063/2742237 cb_write_travelthru [169] + 0.05 0.00 113592/2742237 nr_building [141] + 0.07 0.00 169255/2742237 describe [35] + 0.08 0.00 180598/2742237 nr_ship [111] + 0.16 0.01 361771/2742237 statistics [70] + 0.18 0.01 405014/2742237 rp_messages [36] + 0.58 0.02 1344359/2742237 nr_unit [11] +[26] 3.5 1.19 0.04 2742237 paragraph [26] + 0.04 0.00 7811581/7851812 write_spaces [303] +----------------------------------------------- + 0.00 0.00 1/24887945 sp_summon_familiar [1025] + 0.00 0.00 2/24887945 register_special_direction [1259] + 0.00 0.00 2/24887945 eval_unit [223] + 0.00 0.00 2/24887945 eval_unit_dative [1076] + 0.00 0.00 2/24887945 b_namequestportal [1279] + 0.00 0.00 2/24887945 create_ship [1014] + 0.00 0.00 2/24887945 new_ship [1229] + 0.00 0.00 8/24887945 display_item [1054] + 0.00 0.00 9/24887945 gamedate2 [1222] + 0.00 0.00 10/24887945 spawn_dragons [411] + 0.00 0.00 11/24887945 new_building [1059] + 0.00 0.00 14/24887945 findshiptype [869] + 0.00 0.00 22/24887945 init_options_translation [1157] + 0.00 0.00 26/24887945 init_directions [1143] + 0.00 0.00 36/24887945 init_terrains_translation [1129] + 0.00 0.00 44/24887945 curse_name [1140] + 0.00 0.00 54/24887945 findbuildingtype [866] + 0.00 0.00 78/24887945 eval_weight [1102] + 0.00 0.00 92/24887945 spawn_undead [629] + 0.00 0.00 93/24887945 report_summary [614] + 0.00 0.00 94/24887945 give_peasants [1060] + 0.00 0.00 99/24887945 piracy_cmd [660] + 0.00 0.00 133/24887945 travel [81] + 0.00 0.00 140/24887945 rp_battles [618] + 0.00 0.00 210/24887945 print_header [838] + 0.00 0.00 229/24887945 list_address [635] + 0.00 0.00 251/24887945 out_faction [615] + 0.00 0.00 264/24887945 init_translations [1033] + 0.00 0.00 282/24887945 init_locale [948] + 0.00 0.00 352/24887945 cr_resources [960] + 0.00 0.00 356/24887945 cr_race [949] + 0.00 0.00 446/24887945 print_items [938] + 0.00 0.00 490/24887945 build_building [696] + 0.00 0.00 495/24887945 display_race [963] + 0.00 0.00 527/24887945 make_movement_order [522] + 0.00 0.00 628/24887945 add_itemname_cb [980] + 0.00 0.00 648/24887945 add_resourcename_cb [977] + 0.00 0.00 666/24887945 generic_name [962] + 0.00 0.00 1150/24887945 gamedate_season [944] + 0.00 0.00 1188/24887945 follow_ship [749] + 0.00 0.00 1196/24887945 eval_localize [922] + 0.00 0.00 1490/24887945 eval_resources [907] + 0.00 0.00 1520/24887945 eval_race [882] + 0.00 0.00 1888/24887945 allies [419] + 0.00 0.00 2008/24887945 default_name [851] + 0.00 0.00 2073/24887945 cr_output_curses [69] + 0.00 0.00 2693/24887945 report_computer [9] + 0.00 0.00 3086/24887945 make_cmd [383] + 0.00 0.00 3203/24887945 cr_reportspell [756] + 0.00 0.00 4162/24887945 spell_info [841] + 0.00 0.00 4257/24887945 eval_trail [634] + 0.00 0.00 4762/24887945 nr_spell_syntax [732] + 0.00 0.00 5009/24887945 report_plaintext [4] + 0.00 0.00 5043/24887945 eval_ship [740] + 0.00 0.00 7336/24887945 battle_report [503] + 0.00 0.00 8758/24887945 print_stats [525] + 0.00 0.00 30518/24887945 nr_spell [507] + 0.00 0.00 31368/24887945 rp_messages [36] + 0.00 0.00 35368/24887945 cb_write_travelthru [169] + 0.00 0.00 54735/24887945 write_travelthru [327] + 0.00 0.00 55807/24887945 report_template [87] + 0.00 0.00 60360/24887945 guards [229] + 0.00 0.00 65837/24887945 show_allies [429] + 0.00 0.00 83723/24887945 monster_move [129] + 0.00 0.00 86400/24887945 spell_name [646] + 0.00 0.00 93450/24887945 b_nameroad [642] + 0.00 0.00 97017/24887945 cr_borders [135] + 0.00 0.00 104830/24887945 cr_output_building [239] + 0.00 0.00 110167/24887945 cr_resource [488] + 0.00 0.00 127788/24887945 eval_direction [608] + 0.00 0.00 133973/24887945 cycle_route [375] + 0.00 0.00 169153/24887945 statistics [70] + 0.00 0.00 174677/24887945 cr_output_resource [378] + 0.00 0.00 179761/24887945 cr_output_ship [152] + 0.01 0.01 227343/24887945 nr_building [141] + 0.01 0.01 247009/24887945 prices [85] + 0.01 0.01 373674/24887945 nr_ship [111] + 0.01 0.01 427650/24887945 cr_output_region [10] + 0.01 0.01 470529/24887945 eval_resource [328] + 0.01 0.01 537193/24887945 unit_getname [332] + 0.01 0.01 592664/24887945 spskill [53] + 0.01 0.01 598292/24887945 report_status [318] + 0.02 0.02 751188/24887945 rname [200] + 0.02 0.02 785221/24887945 trailinto [207] + 0.02 0.02 834439/24887945 bufunit [17] + 0.04 0.03 1460143/24887945 racename [133] + 0.04 0.04 1783118/24887945 report_item [106] + 0.05 0.04 1838265/24887945 describe [35] + 0.05 0.05 2006524/24887945 get_command [108] + 0.07 0.07 2768576/24887945 cr_output_unit [19] + 0.07 0.07 2934859/24887945 skillname [122] + 0.11 0.11 4488684/24887945 crtag [110] +[27] 3.4 0.61 0.58 24887945 locale_string [27] + 0.58 0.00 24887945/32337529 hashstring [37] +----------------------------------------------- + 0.11 1.07 1380398/1380398 nr_render [25] +[28] 3.4 0.11 1.07 1380398 translate [28] + 0.48 0.57 1379793/1380398 parse [333] + 0.01 0.00 1380398/13102790 opstack_pop [176] + 0.01 0.00 3656767/13399069 balloc [363] + 0.00 0.01 3656767/3656767 add_variable [607] + 0.00 0.00 605/1380398 parse_string [86] + 0.00 0.00 1380398/1380398 brelease [1360] + 0.00 0.00 1380398/1380398 free_variables [1361] +----------------------------------------------- + 0.00 1.07 178254/178254 process [7] +[29] 3.1 0.00 1.07 178254 produce [29] + 0.01 0.59 5494/5494 expandbuying [49] + 0.00 0.30 4629/4629 expandselling [93] + 0.00 0.05 178254/178254 expandwork [277] + 0.00 0.05 663/663 expandtax [278] + 0.00 0.02 783946/71815034 get_race [12] + 0.00 0.01 15797/15797 sell [498] + 0.00 0.01 11087/11087 do_work [612] + 0.00 0.01 178254/438629 maxworkingpeasants [473] + 0.00 0.01 11159/11159 expandentertainment [637] + 0.01 0.00 619614/55492327 getkeyword [54] + 0.00 0.00 16596/16596 entertain_cmd [665] + 0.00 0.00 361137/2605004 rpeasants [435] + 0.00 0.00 960/960 tax_cmd [697] + 0.00 0.00 793492/129167539 u_race [89] + 0.00 0.00 5916/5916 buy [707] + 0.00 0.00 356508/4666665 rmoney [452] + 0.00 0.00 189341/189341 rule_autowork [738] + 0.00 0.00 177/177 breed_cmd [741] + 0.00 0.00 111/111 steal_cmd [766] + 0.00 0.00 6133/472418 produceexp [322] + 0.00 0.00 41/41 expandstealing [807] + 0.00 0.00 36/36 expandloot [816] + 0.00 0.00 32679/32679 rule_auto_taxation [855] + 0.00 0.00 42/42 loot_cmd [873] + 0.00 0.00 349/349 research_cmd [886] + 0.00 0.00 6245/51974272 a_find [65] + 0.00 0.00 16/16 spy_cmd [990] + 0.00 0.00 17/12246335 ct_find [114] + 0.00 0.00 17/10190660 get_curse [143] + 0.00 0.00 1/560926 bt_find [237] + 0.00 0.00 17/4201030 curse_active [543] + 0.00 0.00 178254/204314 bt_changed [1415] + 0.00 0.00 4629/1511812 newterrain [1359] + 0.00 0.00 4139/59694 r_insectstalled [1446] + 0.00 0.00 344/75797 buildingtype_exists [1443] + 0.00 0.00 17/651711 oldcursename [1381] +----------------------------------------------- +[30] 3.0 0.48 0.57 1380398+20060311 [30] + 0.24 0.44 9544331 parse_symbol [42] + 0.21 0.12 2725583 parse_string [86] + 0.03 0.01 9170795 parse [333] +----------------------------------------------- + 0.00 0.00 2/9953180 find_piracy_target [967] + 0.00 0.00 79/9953180 can_guard [908] + 0.00 0.00 112/9953180 give_unit [952] + 0.00 0.00 112/9953180 mayboard [1046] + 0.00 0.00 131/9953180 caught_target [1003] + 0.00 0.00 215/9953180 mayenter [936] + 0.00 0.00 315/9953180 piracy_cmd [660] + 0.00 0.00 814/9953180 make_side [876] + 0.00 0.00 1104/9953180 get_friends [895] + 0.00 0.00 1198/9953180 check_ship_allowed [657] + 0.00 0.00 1432/9953180 start_battle [297] + 0.00 0.00 1613/9953180 sail [181] + 0.00 0.00 2033/9953180 join_allies [693] + 0.00 0.00 6140/9953180 bewegung_blockiert_von [631] + 0.00 0.00 6326/9953180 study_cmd [105] + 0.00 0.00 9353/9953180 teach_cmd [272] + 0.00 0.01 63046/9953180 is_guardian_u [626] + 0.00 0.01 102606/9953180 give_cmd [102] + 0.00 0.01 102705/9953180 can_give_to [600] + 0.00 0.01 111338/9953180 get_food [88] + 0.00 0.03 371101/9953180 cr_output_unit [19] + 0.00 0.03 373172/9953180 bufunit [17] + 0.01 0.11 1273750/9953180 get_pooled [104] + 0.03 0.26 3149695/9953180 use_pooled [39] + 0.05 0.36 4374788/9953180 visible_faction [68] +[31] 2.7 0.11 0.83 9953180 alliedunit [31] + 0.56 0.17 9004040/10375491 alliedgroup [34] + 0.05 0.00 5640296/51974272 a_find [65] + 0.03 0.01 9004040/20834979 autoalliance [179] + 0.00 0.00 9004040/18647447 getplane [596] +----------------------------------------------- +[32] 2.5 0.34 0.54 12320804+19159045 [32] + 0.04 0.46 7179154 get_modifier [55] + 0.25 0.01 10030400 effskill [100] + 0.01 0.06 7298034 skillmod [214] + 0.04 0.00 6907106 eff_skill [334] + 0.01 0.00 65155 sm_familiar [520] +----------------------------------------------- + 0.88 0.00 232/232 write_reports [3] +[33] 2.5 0.88 0.00 232 finish_reports [33] +----------------------------------------------- + 0.00 0.00 3/10375491 join_allies [693] + 0.00 0.00 27/10375491 allysfm [1122] + 0.00 0.00 55310/10375491 show_allies_cr [661] + 0.01 0.00 110660/10375491 show_allies [429] + 0.07 0.02 1205451/10375491 alliedfaction [162] + 0.56 0.17 9004040/10375491 alliedunit [31] +[34] 2.4 0.64 0.20 10375491 alliedgroup [34] + 0.03 0.08 10375461/10375461 AllianceRestricted [164] + 0.05 0.01 11830939/20834979 autoalliance [179] + 0.02 0.00 10375461/10375461 ally_mode [456] + 0.02 0.00 20750952/24935046 faction_alive [451] +----------------------------------------------- + 0.05 0.77 127676/127676 report_plaintext [4] +[35] 2.4 0.05 0.77 127676 describe [35] + 0.00 0.15 163573/1380398 nr_render [25] + 0.01 0.08 803645/950595 f_regionid [161] + 0.05 0.04 1838265/24887945 locale_string [27] + 0.07 0.00 169255/2742237 paragraph [26] + 0.00 0.06 765959/2225796 get_borders [120] + 0.00 0.06 638271/785221 trailinto [207] + 0.06 0.00 3045620/34611296 strlcpy [45] + 0.03 0.01 62581/108211 report_resources [210] + 0.04 0.00 127676/1766225 nr_curses [48] + 0.00 0.03 8525/8892 astralregions [329] + 0.01 0.02 163573/967784 msg_message [132] + 0.01 0.00 4194164/36653945 wrptr [178] + 0.00 0.00 127676/1874928 terrain_name [226] + 0.00 0.00 127676/669051 production [417] + 0.00 0.00 93452/190469 border_name [641] + 0.00 0.00 255350/51974272 a_find [65] + 0.00 0.00 179832/2605004 rpeasants [435] + 0.00 0.00 62581/987488 is_astral [479] + 0.00 0.00 255352/10053919 rtrees [302] + 0.00 0.00 222964/4666665 rmoney [452] + 0.00 0.00 164218/2494242 newline [594] + 0.00 0.00 96621/13259934 resourcename [233] + 0.00 0.00 96621/56052475 get_resourcetype [194] + 0.00 0.00 8515/12246335 ct_find [114] + 0.00 0.00 8515/10190660 get_curse [143] + 0.00 0.00 8515/4201030 curse_active [543] + 0.00 0.00 291/369586 r_connect [474] + 0.00 0.00 127676/1613387 rule_region_owners [1323] + 0.00 0.00 225630/1160345 rhorses [1369] + 0.00 0.00 163573/1009028 msg_release [1373] + 0.00 0.00 93452/93452 see_border [1440] + 0.00 0.00 93450/190467 b_transparent [1420] + 0.00 0.00 52156/515192 is_mourning [1392] + 0.00 0.00 8515/651711 oldcursename [1381] + 0.00 0.00 5680/109377 free_regionlist [1436] + 0.00 0.00 2/2 b_opaque [1772] +----------------------------------------------- + 0.00 0.01 676/79180 rp_battles [618] + 0.03 0.77 78504/79180 report_plaintext [4] +[36] 2.3 0.03 0.78 79180 rp_messages [36] + 0.00 0.38 405014/1380398 nr_render [25] + 0.02 0.20 3739100/3780355 nr_section [113] + 0.18 0.01 405014/2742237 paragraph [26] + 0.00 0.00 31368/24887945 locale_string [27] + 0.00 0.00 31368/37931 centre [789] + 0.00 0.00 62736/2494242 newline [594] +----------------------------------------------- + 0.00 0.00 6/32337529 get_or_create_locale [1275] + 0.00 0.00 337/32337529 report_computer [9] + 0.00 0.00 957/32337529 crt_register [1006] + 0.00 0.00 957/32337529 mt_register [1007] + 0.00 0.00 1909/32337529 nrt_register [883] + 0.00 0.00 2081/32337529 cr_reportspell [756] + 0.00 0.00 3496/32337529 locale_setstring [918] + 0.00 0.00 5588/32337529 get_locale [884] + 0.00 0.00 174677/32337529 cr_output_resource [378] + 0.01 0.00 301257/32337529 crt_find [321] + 0.02 0.00 779486/32337529 locale_getstring [266] + 0.02 0.00 1010116/32337529 mt_find [227] + 0.12 0.00 5168717/32337529 nrt_find [98] + 0.58 0.00 24887945/32337529 locale_string [27] +[37] 2.2 0.76 0.00 32337529 hashstring [37] +----------------------------------------------- + +[38] 2.1 0.00 0.74 tolua_write_summary [38] + 0.04 0.69 1/2 make_summary [21] + 0.00 0.01 2/2 report_summary [614] + 0.00 0.00 2/2 free_summary [1773] +----------------------------------------------- + 4060217 use_pooled [39] + 0.00 0.00 1/860263 breedtrees [1148] + 0.00 0.00 1/860263 promotion_cmd [917] + 0.00 0.00 1/860263 use_item [765] + 0.00 0.00 3/860263 use_healingpotion [1119] + 0.00 0.00 5/860263 give_horses [1108] + 0.00 0.00 21/860263 build_road [950] + 0.00 0.00 22/860263 give_money [484] + 0.00 0.00 38/860263 expandstealing [807] + 0.00 0.00 51/860263 potion_water_of_life [945] + 0.00 0.00 56/860263 use_bloodpotion [935] + 0.00 0.00 345/860263 end_potion [814] + 0.00 0.00 470/860263 pay_spell [805] + 0.00 0.00 1484/860263 build [691] + 0.00 0.00 1670/860263 do_recruiting [351] + 0.00 0.00 6386/860263 maintain [478] + 0.00 0.00 7475/860263 study_cmd [105] + 0.01 0.05 71328/860263 reserve_i [213] + 0.02 0.06 93824/860263 give_item [126] + 0.06 0.19 282676/860263 expandselling [93] + 0.08 0.26 394406/860263 expandbuying [49] +[39] 2.1 0.17 0.57 860263+4060217 use_pooled [39] + 0.03 0.26 3149695/9953180 alliedunit [31] + 0.02 0.14 4920480/8302761 get_resource [99] + 0.00 0.05 862087/931076 change_resource [240] + 0.03 0.01 4154050/4851739 get_reservation [281] + 0.01 0.00 4607888/7417541 urace [436] + 0.01 0.00 4920480/129167539 u_race [89] + 0.00 0.00 1/93120 change_reservation [1441] + 4060217 use_pooled [39] +----------------------------------------------- + +[40] 2.1 0.00 0.73 tolua_init_summary [40] + 0.04 0.69 1/2 make_summary [21] +----------------------------------------------- + 0.00 0.00 15708/3398582 add_travelthru_addresses [673] + 0.00 0.01 54735/3398582 write_travelthru [327] + 0.00 0.01 57367/3398582 count_travelthru [518] + 0.01 0.04 204298/3398582 cr_output_travelthru [298] + 0.08 0.53 3066474/3398582 prepare_report [8] +[41] 2.0 0.09 0.59 3398582 travelthru_map [41] + 0.29 0.00 18856320/18856320 cb_add_seen [94] + 0.00 0.10 1048274/1048274 cb_write_travelthru [169] + 0.02 0.06 967902/967902 cb_cr_travelthru_ship [204] + 0.02 0.04 1054200/1054200 count_cb [231] + 0.03 0.00 3398582/51974272 a_find [65] + 0.01 0.01 967902/967902 cb_cr_travelthru_unit [466] + 0.00 0.01 755575/755575 cb_add_address [598] +----------------------------------------------- + 3931390 parse_string [86] + 5612941 parse [333] +[42] 1.9 0.24 0.44 9544331 parse_symbol [42] + 0.01 0.06 799427/799427 eval_unit [223] + 0.00 0.05 515550/515550 eval_region [245] + 0.00 0.05 883617/883617 eval_int [268] + 0.04 0.00 4568249/4568249 find_variable [304] + 0.00 0.04 470529/470529 eval_resource [328] + 0.00 0.03 127674/127674 eval_trailto [369] + 0.03 0.00 4568249/13102790 opstack_push [202] + 0.00 0.02 843545/843545 eval_if [393] + 0.01 0.01 655564/655564 eval_eq [398] + 0.00 0.02 123513/123513 eval_order [472] + 0.01 0.00 67213/67213 eval_building [494] + 0.01 0.00 116804/116804 eval_isnull [517] + 0.01 0.00 163/163 eval_lt [539] + 0.01 0.00 4976082/4976082 find_function [549] + 0.00 0.01 127788/127788 eval_direction [608] + 0.00 0.01 108560/108560 eval_trail [634] + 0.00 0.00 40099/40099 eval_skill [671] + 0.00 0.00 46224/46224 eval_faction [685] + 0.00 0.00 25857/25857 eval_int36 [729] + 0.00 0.00 19545/19545 eval_ship [740] + 0.00 0.00 1520/1520 eval_race [882] + 0.00 0.00 834/834 eval_resources [907] + 0.00 0.00 1196/1196 eval_localize [922] + 0.00 0.00 604/604 eval_spell [961] + 0.00 0.00 124/124 eval_unit_dative [1076] + 0.00 0.00 78/78 eval_weight [1102] + 0.00 0.00 54/54 eval_add [1182] + 7791002 parse [333] +----------------------------------------------- + 0.00 0.65 1/1 tolua_read_orders [44] +[43] 1.9 0.00 0.65 1 readorders [43] + 0.02 0.59 221802/221802 unitorders [46] + 0.00 0.02 61643/1158076 getbuf [71] + 0.00 0.01 283446/2281756 gettoken [195] + 0.00 0.00 279151/1787006 findparam [458] + 0.00 0.00 283446/1311302 init_tokens_str [544] + 0.00 0.00 287/287 factionorders [983] + 0.00 0.00 2/64 log_info [1339] +----------------------------------------------- + +[44] 1.9 0.00 0.65 tolua_read_orders [44] + 0.00 0.65 1/1 readorders [43] +----------------------------------------------- + 0.00 0.00 12/34611296 register_spelldata [1250] + 0.00 0.00 15/34611296 check_dupe [1244] + 0.00 0.00 15/34611296 sp_summon_familiar [1025] + 0.00 0.00 22/34611296 dragon_name [1095] + 0.00 0.00 34/34611296 dracoid_name [1126] + 0.00 0.00 53/34611296 lua_getresource [1191] + 0.00 0.00 76/34611296 make_name [970] + 0.00 0.00 137/34611296 parse_spells [1120] + 0.00 0.00 527/34611296 make_movement_order [522] + 0.00 0.00 569/34611296 relpath [1061] + 0.00 0.00 1146/34611296 join_path [1016] + 0.00 0.00 1584/34611296 produce_resource [994] + 0.00 0.00 1667/34611296 add_recruits [371] + 0.00 0.00 2008/34611296 default_name [851] + 0.00 0.00 2478/34611296 write_spell_modifier [964] + 0.00 0.00 2622/34611296 nr_spell_syntax [732] + 0.00 0.00 2660/34611296 write_regionname [280] + 0.00 0.00 3111/34611296 sidename [867] + 0.00 0.00 3123/34611296 limit_resource [943] + 0.00 0.00 4921/34611296 nrt_register [883] + 0.00 0.00 4967/34611296 report_plaintext [4] + 0.00 0.00 6243/34611296 nr_spell [507] + 0.00 0.00 17417/34611296 teach_cmd [272] + 0.00 0.00 18788/34611296 sideabkz [745] + 0.00 0.00 32943/34611296 bufunit [17] + 0.00 0.00 54735/34611296 write_travelthru [327] + 0.00 0.00 62870/34611296 report_template [87] + 0.00 0.00 97114/34611296 guards [229] + 0.00 0.00 216694/34611296 racename [133] + 0.00 0.00 260073/34611296 nr_building [141] + 0.01 0.00 293954/34611296 show_allies [429] + 0.01 0.00 425391/34611296 create_order [341] + 0.01 0.00 529305/34611296 prices [85] + 0.01 0.00 532232/34611296 nr_ship [111] + 0.01 0.00 598234/34611296 report_status [318] + 0.01 0.00 785221/34611296 trailinto [207] + 0.02 0.00 950595/34611296 f_regionid [161] + 0.03 0.00 1380398/34611296 nr_render [25] + 0.06 0.00 3045620/34611296 describe [35] + 0.07 0.00 3889315/34611296 get_command [108] + 0.07 0.00 3931390/34611296 parse_string [86] + 0.32 0.00 17451017/34611296 strlcpy_w [67] +[45] 1.8 0.63 0.00 34611296 strlcpy [45] +----------------------------------------------- + 0.02 0.59 221802/221802 readorders [43] +[46] 1.8 0.02 0.59 221802 unitorders [46] + 0.00 0.36 1096433/1158076 getbuf [71] + 0.01 0.10 874634/1481407 parse_order [117] + 0.00 0.05 221802/221899 findunitg [279] + 0.02 0.01 984476/5387327 parse_token [125] + 0.00 0.01 221802/228907 getid [483] + 0.00 0.01 984476/1787006 findparam [458] + 0.00 0.01 221802/71815034 get_race [12] + 0.01 0.00 573389/55492327 getkeyword [54] + 0.00 0.00 573389/2985733 is_repeated [552] + 0.00 0.00 56948/1644867 free_orders [306] + 0.00 0.00 221802/129167539 u_race [89] + 0.00 0.00 395426/1936876 free_order [1356] +----------------------------------------------- + 0.04 0.57 1/1 process [7] +[47] 1.8 0.04 0.57 1 movement [47] + 0.00 0.44 103494/103784 move_cmd [66] + 0.03 0.01 1/1 move_pirates [326] + 0.03 0.00 1/1 move_hunters [342] + 0.01 0.02 1/1 init_transportation [384] + 0.02 0.00 1733187/55492327 getkeyword [54] + 0.00 0.01 178254/178254 drifting_ships [490] + 0.00 0.00 113702/115276 can_move [736] + 0.00 0.00 103494/1027665 init_order [613] + 0.00 0.00 17286/3358315 ship_owner [438] + 0.00 0.00 163/15102 cmistake [718] + 0.00 0.00 163/1291427 set_order [1365] +----------------------------------------------- + 0.04 0.00 113592/1766225 nr_building [141] + 0.04 0.00 127676/1766225 describe [35] + 0.06 0.00 180598/1766225 nr_ship [111] + 0.43 0.03 1344359/1766225 nr_unit [11] +[48] 1.7 0.57 0.04 1766225 nr_curses [48] + 0.00 0.02 1766225/1766225 nr_curses_i [401] + 0.00 0.01 113592/593636 building_owner [232] + 0.00 0.00 180598/3358315 ship_owner [438] +----------------------------------------------- + 0.01 0.59 5494/5494 produce [29] +[49] 1.7 0.01 0.59 5494 expandbuying [49] + 0.08 0.26 394406/860263 use_pooled [39] + 0.02 0.16 400300/541982 get_pooled [104] + 0.02 0.03 5484/10852 expandorders [197] + 0.01 0.00 788812/11241829 i_change [115] + 0.00 0.00 493465/51974272 a_find [65] + 0.00 0.00 394406/2186159 rsetmoney [553] + 0.00 0.00 11358/967784 msg_message [132] + 0.00 0.00 394406/4666665 rmoney [452] + 0.00 0.00 11358/392959 add_message [434] + 0.00 0.00 5679/451774 a_remove [366] + 0.00 0.00 5679/779419 a_add [555] + 0.00 0.00 5494/2605004 rpeasants [435] + 0.00 0.00 5494/56052475 get_resourcetype [194] + 0.00 0.00 11358/1009028 msg_release [1373] + 0.00 0.00 5679/779868 a_new [1376] +----------------------------------------------- + 0.00 0.54 1/1 process [7] +[50] 1.6 0.00 0.54 1 demographics [50] + 0.00 0.37 178254/178254 live [73] + 0.00 0.04 1/1 immigration [294] + 0.00 0.04 32670/32670 growing_herbs [300] + 0.01 0.03 32670/32670 horses [330] + 0.00 0.02 1/6 remove_empty_units [146] + 0.00 0.01 32670/32670 calculate_emigration [603] + 0.00 0.01 32670/32670 growing_trees [624] + 0.00 0.01 32670/490896 wage [174] + 0.00 0.00 32670/32670 peasants [658] + 0.00 0.00 65214/438629 maxworkingpeasants [473] + 0.00 0.00 32878/1336242 rng_injectable_double [396] + 0.00 0.00 120/120 plagues [781] + 0.00 0.00 32670/2605004 rpeasants [435] + 0.00 0.00 1/560926 bt_find [237] + 0.00 0.00 1/4984610 config_get_int [348] + 0.00 0.00 50673/50673 update_resources [1457] + 0.00 0.00 32670/32670 migrate [1478] + 0.00 0.00 208/75797 buildingtype_exists [1443] + 0.00 0.00 2/40692 get_gamedate [1466] +----------------------------------------------- + +[51] 1.5 0.00 0.53 tolua_planmonsters [51] + 0.00 0.53 1/1 plan_monsters [52] + 0.00 0.00 1/3902878 get_monsters [293] +----------------------------------------------- + 0.00 0.53 1/1 tolua_planmonsters [51] +[52] 1.5 0.00 0.53 1 plan_monsters [52] + 0.01 0.15 105106/105106 monster_move [129] + 0.02 0.07 313244/313244 check_overpopulated [184] + 0.04 0.01 160196/160206 monster_attacks [248] + 0.00 0.05 317735/317735 monster_learn [269] + 0.00 0.05 298/298 plan_dragon [273] + 0.04 0.00 432765/760673 addlist [217] + 0.00 0.03 419518/472418 produceexp [322] + 0.00 0.01 335497/71815034 get_race [12] + 0.00 0.01 595808/752645 chance [495] + 0.01 0.00 419518/1644867 free_orders [306] + 0.01 0.00 419518/1121103 monster_is_waiting [407] + 0.01 0.00 839036/51974272 a_find [65] + 0.00 0.00 419518/3902878 get_monsters [293] + 0.00 0.00 31277/447808 create_order [341] + 0.00 0.00 595142/129167539 u_race [89] + 0.00 0.00 417554/417554 random_move_chance [754] + 0.00 0.00 419518/21345834 skill_enabled [365] + 0.00 0.00 12762/6610983 is_guard [211] + 0.00 0.00 12984/748527 unit_can_study [709] + 0.00 0.00 44/12320804 effskill [100] + 0.00 0.00 44/2934859 skillname [122] + 0.00 0.00 40/451774 a_remove [366] + 0.00 0.00 1/717218 config_get_flt [714] + 0.00 0.00 315567/1342832 handle_event [1363] + 0.00 0.00 1/1 pathfinder_cleanup [1828] +----------------------------------------------- + 0.04 0.49 1953682/1953682 bufunit [17] +[53] 1.5 0.04 0.49 1953682 spskill [53] + 0.03 0.15 7046371/17451017 strlcpy_w [67] + 0.05 0.09 1953681/12320804 eff_skill [334] + 0.01 0.12 1953681/2934859 skillname [122] + 0.01 0.01 592664/24887945 locale_string [27] + 0.01 0.01 237880/12320804 get_modifier [55] + 0.01 0.00 1958340/36653945 wrptr [178] + 0.00 0.00 9493/2426021 get_mage [198] + 0.00 0.00 1551/8034 u_geteffstealth [919] + 0.00 0.00 1088/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 24/55492327 is_moving_ship [1231] + 0.00 0.00 148/55492327 transport [1011] + 0.00 0.00 17417/55492327 teach_cmd [272] + 0.00 0.00 30554/55492327 guard_on_cmd [656] + 0.00 0.00 30634/55492327 guard_off_cmd [711] + 0.00 0.00 38489/55492327 move_pirates [326] + 0.00 0.00 85384/55492327 move_hunters [342] + 0.00 0.00 103187/55492327 cycle_route [375] + 0.00 0.00 151532/55492327 report_template [87] + 0.00 0.00 162752/55492327 travel_i [92] + 0.00 0.00 204065/55492327 do_siege [515] + 0.01 0.00 573389/55492327 unitorders [46] + 0.01 0.00 619614/55492327 produce [29] + 0.01 0.00 692835/55492327 write_unit [97] + 0.01 0.00 695201/55492327 cr_output_unit [19] + 0.01 0.00 1045507/55492327 bufunit [17] + 0.01 0.00 1128316/55492327 magic [157] + 0.01 0.00 1129818/55492327 start_battle [297] + 0.01 0.00 1130203/55492327 restack_units [353] + 0.01 0.00 1131212/55492327 defaultorders [249] + 0.01 0.00 1132975/55492327 update_long_order [270] + 0.01 0.00 1133099/55492327 do_contact [250] + 0.01 0.00 1135305/55492327 follow_unit [331] + 0.01 0.00 1136686/55492327 new_units [282] + 0.02 0.00 1693146/55492327 init_transportation [384] + 0.02 0.00 1733187/55492327 movement [47] + 0.03 0.00 2855598/55492327 economics [78] + 0.04 0.00 4529361/55492327 do_enter [128] + 0.29 0.00 31172689/55492327 process [7] +[54] 1.5 0.52 0.00 55492327 getkeyword [54] +----------------------------------------------- + 6907105 eff_skill [334] + 0.00 0.00 34169/12320804 effskill_study [504] + 0.01 0.01 237880/12320804 spskill [53] +[55] 1.4 0.04 0.46 7179154 get_modifier [55] + 0.05 0.26 7179079/7179079 att_modification [90] + 0.00 0.14 7179079/7179079 rc_skillmod [140] + 0.02 0.00 7179079/129167539 u_race [89] + 0.00 0.00 1467202/18647447 getplane [596] + 7179079 skillmod [214] +----------------------------------------------- + +[56] 1.4 0.47 0.00 decode_pointer [56] +----------------------------------------------- + 0.00 0.01 723/61961 report_computer [9] + 0.00 0.46 61238/61961 cr_output_region [10] +[57] 1.3 0.00 0.46 61961 cr_output_messages [57] + 0.01 0.45 20176/20176 render_messages [58] +----------------------------------------------- + 0.01 0.45 20176/20176 cr_output_messages [57] +[58] 1.3 0.01 0.45 20176 render_messages [58] + 0.00 0.28 301257/1380398 nr_render [25] + 0.09 0.00 297222/297222 fwritestr [191] + 0.01 0.07 301257/301257 cr_render [196] + 0.00 0.00 297222/297222 messagehash [1405] +----------------------------------------------- + 0.00 0.46 1/1 tolua_eressea_eressea_read_game00 [61] +[59] 1.3 0.00 0.46 1 eressea_read_game [59] + 0.00 0.46 1/1 readgame [60] +----------------------------------------------- + 0.00 0.46 1/1 eressea_read_game [59] +[60] 1.3 0.00 0.46 1 readgame [60] + 0.00 0.46 1/1 read_game [62] + 0.00 0.00 1/3 init_locales [947] + 0.00 0.00 1/573 join_path [1016] + 0.00 0.00 1/5 datapath [1289] + 0.00 0.00 2/49235 log_debug [1245] +----------------------------------------------- + +[61] 1.3 0.00 0.46 tolua_eressea_eressea_read_game00 [61] + 0.00 0.46 1/1 eressea_read_game [59] +----------------------------------------------- + 0.00 0.46 1/1 readgame [60] +[62] 1.3 0.00 0.46 1 read_game [62] + 0.01 0.36 595125/595125 read_unit [74] + 0.00 0.08 178254/178254 readregion [209] + 0.00 0.01 9729/10232 update_lighthouse [605] + 0.00 0.00 46176/560926 bt_find [237] + 0.00 0.00 65258/840577 read_attribs [388] + 0.00 0.00 1/1 read_borders [706] + 0.00 0.00 595125/3383689 update_interval [551] + 0.00 0.00 1/1 resolve [757] + 0.00 0.00 233/233 readfaction [767] + 0.00 0.00 1/1 read_planes [1164] + 0.00 0.00 12/180818 buildingname [621] + 0.00 0.00 1/2 game_id [1324] + 0.00 0.00 182/49235 log_debug [1245] + 0.00 0.00 12/13 log_error [1340] + 0.00 0.00 46175/46196 bhash [1464] + 0.00 0.00 19082/19085 shash [1502] + 0.00 0.00 19082/19082 st_find [1503] + 0.00 0.00 233/233 fhash [1617] + 0.00 0.00 1/1 init_genrand [1809] + 0.00 0.00 1/1 read_alliances [1830] +----------------------------------------------- + 0.00 0.45 1/1 process [7] +[63] 1.3 0.00 0.45 1 do_battles [63] + 0.00 0.45 178254/178254 do_battle [64] + 0.00 0.00 1/1 init_rules [1272] +----------------------------------------------- + 0.00 0.45 178254/178254 do_battles [63] +[64] 1.3 0.00 0.45 178254 do_battle [64] + 0.00 0.35 574/574 battle_attacks [79] + 0.01 0.03 178254/178254 start_battle [297] + 0.00 0.03 574/574 battle_flee [352] + 0.01 0.00 780/780 battle_report [503] + 0.00 0.01 206/206 print_stats [525] + 0.00 0.00 206/206 join_allies [693] + 0.00 0.00 206/206 aftermath [701] + 0.00 0.00 206/206 print_header [838] + 0.00 0.00 206/412 do_combatmagic [825] + 0.00 0.00 206/361 regionname [987] + 0.00 0.00 206/207 rule_force_leave [1175] + 0.00 0.00 1/967784 msg_message [132] + 0.00 0.00 206/206 make_heroes [1298] + 0.00 0.00 206/49235 log_debug [1245] + 0.00 0.00 574/574 battle_update [1595] + 0.00 0.00 206/206 free_battle [1630] +----------------------------------------------- + 0.00 0.00 1/51974272 reshow_other [823] + 0.00 0.00 1/51974272 create_mage [1315] + 0.00 0.00 1/51974272 a_upgradekeys [1314] + 0.00 0.00 2/51974272 u_seteffstealth [1199] + 0.00 0.00 3/51974272 create_newfamiliar [1288] + 0.00 0.00 7/51974272 parse_resources [1086] + 0.00 0.00 9/51974272 melt_iceberg [1082] + 0.00 0.00 11/51974272 add_trigger [1260] + 0.00 0.00 12/51974272 volcano_destruction [1022] + 0.00 0.00 15/51974272 mail_cmd [844] + 0.00 0.00 26/51974272 set_new_dragon_target [486] + 0.00 0.00 27/51974272 move_iceberg [1094] + 0.00 0.00 48/51974272 cansee [22] + 0.00 0.00 58/51974272 tolua_dict_get [1218] + 0.00 0.00 62/51974272 potion_luck [1176] + 0.00 0.00 85/51974272 volcano_update [981] + 0.00 0.00 89/51974272 add_chaoscount [1198] + 0.00 0.00 104/51974272 set_factionstealth [183] + 0.00 0.00 115/51974272 usetcontact [1147] + 0.00 0.00 232/51974272 renumber_factions [1156] + 0.00 0.00 298/51974272 plan_dragon [273] + 0.00 0.00 324/51974272 caught_target [1003] + 0.00 0.00 328/51974272 display_potion [1090] + 0.00 0.00 348/51974272 ugetpotionuse [1133] + 0.00 0.00 380/51974272 set_group [1048] + 0.00 0.00 404/51974272 usetpotionuse [1078] + 0.00 0.00 460/51974272 report_computer [9] + 0.00 0.00 460/51974272 report_plaintext [4] + 0.00 0.00 631/51974272 follow_unit [331] + 0.00 0.00 664/51974272 ally_cmd [877] + 0.00 0.00 760/51974272 resolve_familiar [846] + 0.00 0.00 760/51974272 resolve_mage [856] + 0.00 0.00 793/51974272 is_familiar [1092] + 0.00 0.00 1297/51974272 hunted_dir [1055] + 0.00 0.00 1422/51974272 attrib_allocation [914] + 0.00 0.00 1429/51974272 start_battle [297] + 0.00 0.00 1573/51974272 usetprivate [1041] + 0.00 0.00 1593/51974272 make_fighter [424] + 0.00 0.00 1610/51974272 transfer_curse [1039] + 0.00 0.00 1725/51974272 max_magicians [915] + 0.00 0.00 1774/51974272 join_battle [425] + 0.00 0.00 2280/51974272 set_familiar [992] + 0.00 0.00 2421/51974272 set_racename [1015] + 0.00 0.00 2598/51974272 create_unit [296] + 0.00 0.00 2723/51974272 get_allocator [1001] + 0.00 0.00 2822/51974272 get_followers [254] + 0.00 0.00 2977/51974272 change_effect [982] + 0.00 0.00 3035/51974272 scale_number [969] + 0.00 0.00 3078/51974272 allocate_resource [752] + 0.00 0.00 3730/51974272 transfermen [899] + 0.00 0.00 4475/51974272 matmod [975] + 0.00 0.00 5049/51974272 find_piracy_target [967] + 0.00 0.00 5903/51974272 buy [707] + 0.00 0.00 5941/51974272 deathcounts [843] + 0.00 0.00 6245/51974272 produce [29] + 0.00 0.00 7815/51974272 already_seen [929] + 0.00 0.00 7957/51974272 magic_resistance [727] + 0.00 0.00 8034/51974272 u_geteffstealth [919] + 0.00 0.00 8144/51974272 ucontact [927] + 0.00 0.00 8246/51974272 horses [330] + 0.00 0.00 12520/51974272 sell [498] + 0.00 0.00 16132/51974272 teach_unit [426] + 0.00 0.00 23509/51974272 setguard [815] + 0.00 0.00 30250/51974272 peasants [658] + 0.00 0.00 31351/51974272 update_guards [415] + 0.00 0.00 32670/51974272 growing_trees [624] + 0.00 0.00 34221/51974272 eff_weight [683] + 0.00 0.00 35539/51974272 check_leuchtturm [786] + 0.00 0.00 39729/51974272 leave_trail [704] + 0.00 0.00 52551/51974272 update_lighthouse [605] + 0.00 0.00 54351/51974272 get_familiar [796] + 0.00 0.00 66058/51974272 shipspeed [669] + 0.00 0.00 71414/51974272 get_mage [198] + 0.00 0.00 116002/51974272 get_movement [750] + 0.00 0.00 116914/51974272 fleechance [408] + 0.00 0.00 169733/51974272 travelthru_add [609] + 0.00 0.00 172276/51974272 largestbuilding [651] + 0.00 0.00 174968/51974272 get_familiar_mage [722] + 0.00 0.00 178254/51974272 age_traveldir [720] + 0.00 0.00 178254/51974272 randomevents [91] + 0.00 0.00 178257/51974272 key_get [719] + 0.00 0.00 179235/51974272 get_chaoscount [717] + 0.00 0.00 255350/51974272 describe [35] + 0.00 0.00 285923/51974272 ualias [692] + 0.00 0.00 307833/51974272 default_wage [173] + 0.00 0.00 325282/51974272 eaten_by_monster [468] + 0.00 0.00 325825/51974272 scared_by_monster [380] + 0.00 0.00 329691/51974272 getguard [652] + 0.00 0.00 355423/51974272 deathcount [674] + 0.00 0.00 370844/51974272 expandselling [93] + 0.00 0.00 417739/51974272 study_cmd [105] + 0.00 0.00 493465/51974272 expandbuying [49] + 0.01 0.00 595441/51974272 destroyfaction [392] + 0.01 0.00 595476/51974272 dissolve_units [241] + 0.01 0.00 839036/51974272 plan_monsters [52] + 0.01 0.00 847828/51974272 raceprefix [222] + 0.01 0.00 973220/51974272 cr_output_unit [19] + 0.01 0.00 1115958/51974272 visible_faction [68] + 0.01 0.00 1344359/51974272 nr_unit [11] + 0.01 0.00 1401002/51974272 bufunit [17] + 0.01 0.00 1474687/51974272 leftship [500] + 0.01 0.00 1523708/51974272 uprivate [497] + 0.01 0.00 1646640/51974272 terrain_name [226] + 0.02 0.00 2275967/51974272 get_racename [368] + 0.02 0.00 2277350/51974272 get_prefix [263] + 0.02 0.00 2858912/51974272 get_effect [225] + 0.03 0.00 3398582/51974272 travelthru_map [41] + 0.05 0.00 5640296/51974272 alliedunit [31] + 0.06 0.00 7298034/51974272 skillmod [214] + 0.09 0.00 10322799/51974272 att_modification [90] +[65] 1.3 0.45 0.00 51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 99/103784 piracy_cmd [660] + 0.00 0.00 191/103784 follow_ship [749] + 0.00 0.44 103494/103784 movement [47] +[66] 1.3 0.00 0.45 103784 move_cmd [66] + 0.00 0.35 96529/96529 travel [81] + 0.01 0.09 7255/7255 sail [181] + 0.00 0.00 7269/3358315 ship_owner [438] + 0.00 0.00 103784/1291427 set_order [1365] + 0.00 0.00 103369/109377 free_regionlist [1436] +----------------------------------------------- + 0.00 0.00 211/17451017 display_race [963] + 0.00 0.00 1612/17451017 follow_ship [749] + 0.00 0.00 1799/17451017 print_header [838] + 0.00 0.00 4287/17451017 eval_trail [634] + 0.00 0.00 25201/17451017 battle_report [503] + 0.00 0.00 63020/17451017 cycle_route [375] + 0.00 0.02 989920/17451017 buforder [201] + 0.03 0.15 7046371/17451017 spskill [53] + 0.04 0.20 9318596/17451017 bufunit [17] +[67] 1.3 0.07 0.37 17451017 strlcpy_w [67] + 0.32 0.00 17451017/34611296 strlcpy [45] + 0.05 0.00 17451017/36653945 wrptr [178] +----------------------------------------------- + 0.00 0.00 8/4374788 spy_message [1038] + 0.00 0.00 315/4374788 piracy_cmd [660] + 0.00 0.01 67332/4374788 guards [229] + 0.00 0.01 74068/4374788 cb_add_address [598] + 0.00 0.02 249624/4374788 cr_output_region [10] + 0.00 0.08 854692/4374788 get_addresses [20] + 0.00 0.08 856373/4374788 set_factionstealth [183] + 0.00 0.09 923633/4374788 cr_output_unit [19] + 0.00 0.13 1348743/4374788 bufunit [17] +[68] 1.2 0.01 0.42 4374788 visible_faction [68] + 0.05 0.36 4374788/9953180 alliedunit [31] + 0.01 0.00 1115958/51974272 a_find [65] + 0.00 0.00 151469/1380007 get_otherfaction [1362] +----------------------------------------------- + 0.12 0.01 386740/1310373 cr_output_curses_compat [144] + 0.28 0.02 923633/1310373 cr_output_unit [19] +[69] 1.2 0.40 0.03 1310373 cr_output_curses [69] + 0.00 0.01 12729/1380398 nr_render [25] + 0.00 0.01 104830/593636 building_owner [232] + 0.00 0.00 12828/26045 msg_curse [664] + 0.00 0.00 179761/3358315 ship_owner [438] + 0.00 0.00 28167/10103290 stream_printf [158] + 0.00 0.00 2073/4434556 translate [75] + 0.00 0.00 2073/24887945 locale_string [27] + 0.00 0.00 2073/13259934 resourcename [233] + 0.00 0.00 12828/26045 curse_cansee [1489] + 0.00 0.00 12729/1009028 msg_release [1373] +----------------------------------------------- + 0.02 0.40 33139/33139 report_plaintext [4] +[70] 1.2 0.02 0.40 33139 statistics [70] + 0.00 0.18 192618/1380398 nr_render [25] + 0.16 0.01 361771/2742237 paragraph [26] + 0.01 0.02 192618/967784 msg_message [132] + 0.00 0.00 169153/24887945 locale_string [27] + 0.00 0.01 32354/490896 wage [174] + 0.01 0.00 347340/11241829 i_change [115] + 0.00 0.00 31155/560926 bt_find [237] + 0.00 0.00 31676/79772 entertainmoney [643] + 0.00 0.00 33139/669051 production [417] + 0.00 0.00 169153/13259934 resourcename [233] + 0.00 0.00 63509/163027 markets_module [748] + 0.00 0.00 144924/129167539 u_race [89] + 0.00 0.00 66278/2494242 newline [594] + 0.00 0.00 33139/2605004 rpeasants [435] + 0.00 0.00 31725/4666665 rmoney [452] + 0.00 0.00 33139/21345834 skill_enabled [365] + 0.00 0.00 1098/71815034 get_race [12] + 0.00 0.00 192618/1009028 msg_release [1373] + 0.00 0.00 169153/257723 i_remove [1407] + 0.00 0.00 169153/374425 i_free [1400] + 0.00 0.00 31155/75797 buildingtype_exists [1443] +----------------------------------------------- + 0.00 0.02 61643/1158076 readorders [43] + 0.00 0.36 1096433/1158076 unitorders [46] +[71] 1.1 0.00 0.38 1158076 getbuf [71] + 0.24 0.14 1158076/1158076 getbuf_utf8 [72] +----------------------------------------------- + 0.24 0.14 1158076/1158076 getbuf [71] +[72] 1.1 0.24 0.14 1158076 getbuf_utf8 [72] + 0.08 0.00 38195175/46391457 unicode_utf8_to_ucs4 [177] + 0.04 0.01 6241702/6241702 eatwhite [243] +----------------------------------------------- + 0.00 0.37 178254/178254 demographics [50] +[73] 1.1 0.00 0.37 178254 live [73] + 0.15 0.17 178254/178254 get_food [88] + 0.00 0.03 595472/595472 age_unit [336] + 0.01 0.01 595472/2858912 get_effect [225] +----------------------------------------------- + 0.01 0.36 595125/595125 read_game [62] +[74] 1.1 0.01 0.36 595125 read_unit [74] + 0.00 0.12 595125/888603 findunit [123] + 0.01 0.07 606357/1481407 parse_order [117] + 0.02 0.02 595125/628037 read_items [320] + 0.03 0.00 1951270/1956810 add_skill [355] + 0.00 0.02 379049/778818 describe_race [267] + 0.00 0.02 597254/68430117 rc_find [15] + 0.00 0.02 595125/840577 read_attribs [388] + 0.01 0.00 595125/1644867 free_orders [306] + 0.00 0.01 595125/4625636 findfaction [259] + 0.00 0.00 595125/598069 uhash [667] + 0.00 0.00 595125/129167539 u_race [89] + 0.00 0.00 606357/2155959 is_persistent [687] + 0.00 0.00 595125/598129 u_setfaction [1111] + 0.00 0.00 2129/21345834 skill_enabled [365] + 0.00 0.00 153878/154110 rule_stealth_anon [1325] + 0.00 0.00 595125/603524 set_number [1387] + 0.00 0.00 595125/600145 u_setrace [1389] + 0.00 0.00 595125/599650 setstatus [1390] + 0.00 0.00 595125/1291427 set_order [1365] + 0.00 0.00 47396/48455 findbuilding [1462] + 0.00 0.00 47396/48565 u_set_building [1460] + 0.00 0.00 27412/28818 findship [1483] + 0.00 0.00 27412/27640 u_set_ship [1485] +----------------------------------------------- + 0.00 0.00 352/4434556 cr_resources [960] + 0.00 0.00 356/4434556 cr_race [949] + 0.00 0.00 446/4434556 print_items [938] + 0.00 0.00 1896/4434556 report_computer [9] + 0.00 0.00 2073/4434556 cr_output_curses [69] + 0.00 0.00 5284/4434556 cr_reportspell [756] + 0.00 0.00 20072/4434556 cr_skill [672] + 0.00 0.00 33909/4434556 cr_output_spells [639] + 0.00 0.01 104830/4434556 cr_output_building [239] + 0.00 0.01 110167/4434556 cr_resource [488] + 0.01 0.01 174677/4434556 cr_output_resource [378] + 0.01 0.01 179761/4434556 cr_output_ship [152] + 0.01 0.02 427650/4434556 cr_output_region [10] + 0.11 0.17 3373083/4434556 cr_output_unit [19] +[75] 1.0 0.14 0.22 4434556 translate [75] + 0.01 0.21 4434556/4488684 crtag [110] +----------------------------------------------- + 0.00 0.36 1/1 tolua_eressea_eressea_write_game00 [77] +[76] 1.0 0.00 0.36 1 eressea_write_game [76] + 0.00 0.35 1/1 writegame [82] + 0.01 0.00 1/1 remove_empty_factions [576] +----------------------------------------------- + +[77] 1.0 0.00 0.36 tolua_eressea_eressea_write_game00 [77] + 0.00 0.36 1/1 eressea_write_game [76] +----------------------------------------------- + 0.02 0.34 178254/178254 process [7] +[78] 1.0 0.02 0.34 178254 economics [78] + 0.00 0.26 131722/131722 give_cmd [102] + 0.00 0.03 1594/1594 expandrecruit [349] + 0.03 0.00 2855598/55492327 getkeyword [54] + 0.02 0.00 178254/1375380 remove_empty_units_in_region [134] + 0.00 0.01 1835/1835 recruit [650] + 0.00 0.00 12/12 forget_cmd [1093] + 0.00 0.00 23/23 destroy_cmd [1113] + 0.00 0.00 1/1 recruit_init [1334] +----------------------------------------------- + 0.00 0.35 574/574 do_battle [64] +[79] 1.0 0.00 0.35 574 battle_attacks [79] + 0.01 0.34 2838/2838 do_attack [80] + 0.00 0.00 378/378 get_tactics [1178] +----------------------------------------------- + 0.01 0.34 2838/2838 battle_attacks [79] +[80] 1.0 0.01 0.34 2838 do_attack [80] + 0.00 0.34 617313/617313 attack [84] + 0.00 0.00 1501863/129167539 u_race [89] + 0.00 0.00 251867/876979 count_enemies [611] + 0.00 0.00 18/1486 message_all [834] + 0.00 0.00 18/967784 msg_message [132] + 0.00 0.00 251867/251867 attacks_per_round [1409] + 0.00 0.00 4005/754589 preferred_weapon [1377] + 0.00 0.00 18/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.35 96529/96529 move_cmd [66] +[81] 1.0 0.00 0.35 96529 travel [81] + 0.00 0.31 96555/96555 travel_i [92] + 0.00 0.04 96527/96527 make_route [289] + 0.00 0.00 94655/1474687 leftship [500] + 0.00 0.00 66/15361 is_guarded [377] + 0.00 0.00 133/133 reroute [1020] + 0.00 0.00 133/324 caught_target [1003] + 0.00 0.00 133/447808 create_order [341] + 0.00 0.00 133/24887945 locale_string [27] + 0.00 0.00 94660/95593 can_leave [1112] + 0.00 0.00 2/41248 msg_feedback [647] + 0.00 0.00 2/392959 add_message [434] + 0.00 0.00 5/129167539 u_race [89] + 0.00 0.00 133/1936876 free_order [1356] + 0.00 0.00 2/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.35 1/1 eressea_write_game [76] +[82] 1.0 0.00 0.35 1 writegame [82] + 0.01 0.34 1/1 write_game [83] + 0.00 0.00 1/2 create_directories [1294] + 0.00 0.00 1/573 join_path [1016] + 0.00 0.00 1/5 datapath [1289] + 0.00 0.00 1/1 version_no [1894] + 0.00 0.00 1/231 eressea_version [1624] +----------------------------------------------- + 0.01 0.34 1/1 writegame [82] +[83] 1.0 0.01 0.34 1 write_game [83] + 0.12 0.15 596221/596221 write_unit [97] + 0.04 0.00 534764/1248014 listlen [190] + 0.00 0.01 178254/178254 writeregion [519] + 0.00 0.01 1/1 clear_npc_orders [531] + 0.00 0.00 65263/839970 write_attribs [301] + 0.00 0.00 232/232 writefaction [762] + 0.00 0.00 1/1 write_planes [1207] + 0.00 0.00 1/2 game_id [1324] + 0.00 0.00 176/49235 log_debug [1245] + 0.00 0.00 46184/642406 write_building_reference [1383] + 0.00 0.00 19078/615299 write_ship_reference [1386] + 0.00 0.00 1/1 write_alliances [1896] + 0.00 0.00 1/1 write_borders [1897] +----------------------------------------------- + 0.00 0.34 617313/617313 do_attack [80] +[84] 1.0 0.00 0.34 617313 attack [84] + 0.00 0.16 363071/363071 hits [131] + 0.01 0.10 363135/363135 select_opponent [160] + 0.00 0.05 72692/80630 terminate [242] + 0.00 0.01 42157/146997 dice_rand [409] + 0.00 0.01 53/53 do_extra_spell [648] + 0.00 0.00 252753/876979 count_enemies [611] + 0.00 0.00 38/38 do_combatspell [702] + 0.00 0.00 47310/7641081 genrand_int31 [171] + 0.00 0.00 112/112 attack_firesword [785] + 0.00 0.00 5596/5596 drain_exp [850] + 0.00 0.00 23194/129167539 u_race [89] + 0.00 0.00 256354/619425 getreload [1385] + 0.00 0.00 234242/754589 preferred_weapon [1377] + 0.00 0.00 44924/1726748 is_riding [1358] + 0.00 0.00 3639/3639 setreload [1542] + 0.00 0.00 7/160 damage_ship [1641] + 0.00 0.00 1/1 dazzle [1800] +----------------------------------------------- + 0.03 0.31 35287/35287 report_plaintext [4] +[85] 1.0 0.03 0.31 35287 prices [85] + 0.00 0.23 247009/1380398 nr_render [25] + 0.01 0.03 247009/967784 msg_message [132] + 0.02 0.00 35287/2742237 paragraph [26] + 0.01 0.01 247009/24887945 locale_string [27] + 0.01 0.00 529305/34611296 strlcpy [45] + 0.00 0.00 776314/36653945 wrptr [178] + 0.00 0.00 247009/1009028 msg_release [1373] +----------------------------------------------- + 2724978 parse [333] + 0.00 0.00 605/1380398 translate [28] +[86] 1.0 0.21 0.12 2725583 parse_string [86] + 0.07 0.00 3931390/34611296 strlcpy [45] + 0.03 0.00 3931390/13102790 opstack_pop [176] + 0.02 0.00 2725583/13102790 opstack_push [202] + 0.01 0.00 2725583/13399069 balloc [363] + 0.00 0.00 6656973/6656973 bfree [1349] + 3931390 parse_symbol [42] +----------------------------------------------- + 0.27 0.06 99/99 write_reports [3] +[87] 1.0 0.27 0.06 99 report_template [87] + 0.03 0.00 195108/195108 rps_nowrap [359] + 0.00 0.01 128725/1470505 write_order [121] + 0.00 0.00 55807/24887945 locale_string [27] + 0.00 0.00 10477/490896 wage [174] + 0.00 0.00 52225/5100840 itoa36 [116] + 0.00 0.00 151532/55492327 getkeyword [54] + 0.00 0.00 12521/593636 building_owner [232] + 0.00 0.00 62870/34611296 strlcpy [45] + 0.00 0.00 216458/2494242 newline [594] + 0.00 0.00 45033/7120688 get_money [187] + 0.00 0.00 10477/1552289 rname [200] + 0.00 0.00 45033/4198692 lifestyle [286] + 0.00 0.00 45033/3351853 unit_getname [332] + 0.00 0.00 10477/1826688 adjust_coordinates [234] + 0.00 0.00 107804/36653945 wrptr [178] + 0.00 0.00 151532/2155959 is_persistent [687] + 0.00 0.00 45071/129167539 u_race [89] + 0.00 0.00 4309/10190660 get_curse [143] + 0.00 0.00 1258/884940 itoa10 [338] + 0.00 0.00 7093/3358315 ship_owner [438] + 0.00 0.00 12208/2985733 is_repeated [552] + 0.00 0.00 4309/4201030 curse_active [543] + 0.00 0.00 10477/18647447 getplane [596] + 0.00 0.00 99/12246335 ct_find [114] + 0.00 0.00 99/56052475 get_resourcetype [194] + 0.00 0.00 10477/3587241 pnormalize [1350] + 0.00 0.00 4066/4066 buildingmaintenance [1535] +----------------------------------------------- + 0.15 0.17 178254/178254 live [73] +[88] 0.9 0.15 0.17 178254 get_food [88] + 0.05 0.01 4046908/7120688 get_money [187] + 0.01 0.03 4046861/4198692 lifestyle [286] + 0.00 0.03 1044674/71815034 get_race [12] + 0.00 0.01 111338/9953180 alliedunit [31] + 0.01 0.00 726086/2599554 change_money [337] + 0.01 0.00 178254/264251 rsetpeasants [545] + 0.00 0.00 1771752/1771752 help_money [663] + 0.00 0.00 106798/106798 help_feed [678] + 0.00 0.00 1044674/129167539 u_race [89] + 0.00 0.00 178254/2605004 rpeasants [435] + 0.00 0.00 178257/4984610 config_get_int [348] + 0.00 0.00 43034/2858912 get_effect [225] + 0.00 0.00 88/88 hunger [808] + 0.00 0.00 178254/18647447 getplane [596] + 0.00 0.00 1461/2977 change_effect [982] + 0.00 0.00 2148/2032164 rt_find [597] +----------------------------------------------- + 0.00 0.00 1/129167539 sp_summonshadowlords [1034] + 0.00 0.00 1/129167539 sp_seduce [1336] + 0.00 0.00 1/129167539 promotion_cmd [917] + 0.00 0.00 1/129167539 oldfamiliars [1240] + 0.00 0.00 2/129167539 make_familiar [1219] + 0.00 0.00 2/129167539 do_fumble [1062] + 0.00 0.00 2/129167539 create_ship [1014] + 0.00 0.00 3/129167539 trigger_changerace [1297] + 0.00 0.00 4/129167539 cast_cmd [760] + 0.00 0.00 5/129167539 travel [81] + 0.00 0.00 5/129167539 leave_cmd [721] + 0.00 0.00 6/129167539 skill_summoned [1032] + 0.00 0.00 8/129167539 mod_elves_only [1239] + 0.00 0.00 9/129167539 chaos [848] + 0.00 0.00 15/129167539 steal_cmd [766] + 0.00 0.00 18/129167539 destroyfaction [392] + 0.00 0.00 20/129167539 spawn_dragons [411] + 0.00 0.00 24/129167539 make_heroes [1298] + 0.00 0.00 28/129167539 get_friends [895] + 0.00 0.00 31/129167539 random_unit [1174] + 0.00 0.00 36/129167539 damage_unit [1044] + 0.00 0.00 43/129167539 get_money_for_dragon [1087] + 0.00 0.00 44/129167539 build_road [950] + 0.00 0.00 45/129167539 dissolve_units [241] + 0.00 0.00 48/129167539 reshow_other [823] + 0.00 0.00 50/129167539 get_combatspell [874] + 0.00 0.00 58/129167539 use_bloodpotion [935] + 0.00 0.00 60/129167539 nb_armor [1273] + 0.00 0.00 71/129167539 disband_men [999] + 0.00 0.00 79/129167539 can_guard [908] + 0.00 0.00 88/129167539 hunger [808] + 0.00 0.00 92/129167539 spawn_undead [629] + 0.00 0.00 97/129167539 age_stonecircle [1021] + 0.00 0.00 111/129167539 check_steal [1234] + 0.00 0.00 112/129167539 give_unit [952] + 0.00 0.00 138/129167539 LongHunger [536] + 0.00 0.00 142/129167539 transfermen [899] + 0.00 0.00 168/129167539 loot_cmd [873] + 0.00 0.00 188/129167539 is_freezing [1088] + 0.00 0.00 222/129167539 enter_ship [733] + 0.00 0.00 242/129167539 canfly [1031] + 0.00 0.00 257/129167539 is_guardian_u [626] + 0.00 0.00 266/129167539 income [885] + 0.00 0.00 409/129167539 enter_building [695] + 0.00 0.00 460/129167539 plan_dragon [273] + 0.00 0.00 508/129167539 regeneration [942] + 0.00 0.00 578/129167539 gift_items [891] + 0.00 0.00 659/129167539 can_give_men [940] + 0.00 0.00 666/129167539 generic_name [962] + 0.00 0.00 681/129167539 absorbed_by_monster [804] + 0.00 0.00 783/129167539 give_men [857] + 0.00 0.00 802/129167539 heal_fighters [1158] + 0.00 0.00 990/129167539 kill_troop [532] + 0.00 0.00 1289/129167539 allocate_resource [752] + 0.00 0.00 1518/129167539 start_battle [297] + 0.00 0.00 1670/129167539 do_recruiting [351] + 0.00 0.00 1722/129167539 aftermath [701] + 0.00 0.00 2097/129167539 create_unit [296] + 0.00 0.00 3241/129167539 is_guardian_r [186] + 0.00 0.00 3340/129167539 select_recruitment [1079] + 0.00 0.00 3551/129167539 recruit [650] + 0.00 0.00 3836/129167539 tax_cmd [697] + 0.00 0.00 4069/129167539 is_migrant [1047] + 0.00 0.00 4632/129167539 add_recruits [371] + 0.00 0.00 4777/129167539 name_unit [803] + 0.00 0.00 5049/129167539 validate_pirate [1051] + 0.00 0.00 5358/129167539 max_spellpoints [755] + 0.00 0.00 5384/129167539 teach_cmd [272] + 0.00 0.00 5915/129167539 buy [707] + 0.00 0.00 7054/129167539 make_fighter [424] + 0.00 0.00 7279/129167539 remove_empty_units_in_region [134] + 0.00 0.00 7560/129167539 drown [394] + 0.00 0.00 7938/129167539 calculate_armor [645] + 0.00 0.00 7957/129167539 magic_resistance [727] + 0.00 0.00 8132/129167539 battle_flee [352] + 0.00 0.00 10979/129167539 expandwork [277] + 0.00 0.00 11880/129167539 cansee_unit [684] + 0.00 0.00 12787/129167539 canwalk [633] + 0.00 0.00 15347/129167539 can_start_guarding [679] + 0.00 0.00 15763/129167539 sell [498] + 0.00 0.00 16132/129167539 magic_lowskill [897] + 0.00 0.00 20370/129167539 get_reservation [281] + 0.00 0.00 21443/129167539 ridingcapacity [694] + 0.00 0.00 22150/129167539 do_work [612] + 0.00 0.00 23194/129167539 attack [84] + 0.00 0.00 25088/129167539 rmfighter [890] + 0.00 0.00 27379/129167539 bewegung_blockiert_von [631] + 0.00 0.00 27694/129167539 dragon_affinity_value [516] + 0.00 0.00 45071/129167539 report_template [87] + 0.00 0.00 45992/129167539 golem_factor [265] + 0.00 0.00 47987/129167539 guard_on_cmd [656] + 0.00 0.00 51382/129167539 immigration [294] + 0.00 0.00 52873/129167539 produceexp_ex [323] + 0.00 0.00 80630/129167539 natural_armor [788] + 0.00 0.00 92804/129167539 canswim [682] + 0.00 0.00 101492/129167539 report_item [106] + 0.00 0.00 115276/129167539 can_move [736] + 0.00 0.00 116914/129167539 fleechance [408] + 0.00 0.00 117616/129167539 rc_specialdamage [830] + 0.00 0.00 120592/129167539 CavalryBonus [491] + 0.00 0.00 132028/129167539 shipspeed [669] + 0.00 0.00 144924/129167539 statistics [70] + 0.00 0.00 168094/129167539 monster_move [129] + 0.00 0.00 176065/129167539 randomevents [91] + 0.00 0.00 192570/129167539 canride [465] + 0.00 0.00 193274/129167539 personcapacity [795] + 0.00 0.00 193321/129167539 walkingcapacity [403] + 0.00 0.00 221802/129167539 unitorders [46] + 0.00 0.00 278421/129167539 movement_speed [155] + 0.00 0.00 279395/129167539 weight [459] + 0.00 0.00 307120/129167539 give_cmd [102] + 0.00 0.00 325282/129167539 eaten_by_monster [468] + 0.00 0.00 325825/129167539 scared_by_monster [380] + 0.00 0.00 346411/129167539 travel_route [147] + 0.00 0.00 363135/129167539 select_opponent [160] + 0.00 0.00 372173/129167539 select_enemy [172] + 0.00 0.00 407896/129167539 guard_flags [690] + 0.00 0.00 417577/129167539 study_days [747] + 0.00 0.00 420172/129167539 tolua_unit_get_race [746] + 0.00 0.00 439954/129167539 process [7] + 0.00 0.00 464187/129167539 skilldiff [166] + 0.00 0.00 475770/129167539 terminate [242] + 0.00 0.00 578592/129167539 heal_factor [619] + 0.00 0.00 595125/129167539 read_unit [74] + 0.00 0.00 595142/129167539 plan_monsters [52] + 0.00 0.00 595144/129167539 monthly_healing [215] + 0.00 0.00 595476/129167539 demon_skillchanges [246] + 0.00 0.00 596221/129167539 prepare_report [8] + 0.00 0.00 597269/129167539 bufunit [17] + 0.00 0.00 742235/129167539 random_neighbour [153] + 0.00 0.00 748527/129167539 unit_can_study [709] + 0.00 0.00 793492/129167539 produce [29] + 0.00 0.00 835519/129167539 study_cmd [105] + 0.00 0.00 868104/129167539 select_armor [700] + 0.00 0.00 949946/129167539 can_survive [640] + 0.00 0.00 1044674/129167539 get_food [88] + 0.00 0.00 1100763/129167539 cr_output_unit [19] + 0.00 0.00 1121103/129167539 monster_is_waiting [407] + 0.00 0.00 1190864/129167539 magic [157] + 0.00 0.00 1191346/129167539 make_summary [21] + 0.00 0.00 1194391/129167539 age_unit [336] + 0.00 0.00 1335533/129167539 cansee [22] + 0.00 0.00 1344397/129167539 nr_unit [11] + 0.00 0.00 1381157/129167539 unit_max_hp [136] + 0.00 0.00 1469625/129167539 monster_kills_peasants [230] + 0.00 0.00 1501863/129167539 do_attack [80] + 0.00 0.00 1555209/129167539 weapon_skill [221] + 0.00 0.00 1747682/129167539 cansee_durchgezogen [170] + 0.00 0.00 1771752/129167539 help_money [663] + 0.00 0.00 1788663/129167539 write_unit [97] + 0.01 0.00 2367342/129167539 get_pooled [104] + 0.01 0.00 2521048/129167539 maintenance_cost [481] + 0.01 0.00 2554959/129167539 u_description [347] + 0.01 0.00 3891194/129167539 count_faction [219] + 0.01 0.00 3903981/129167539 score [23] + 0.01 0.00 4920480/129167539 use_pooled [39] + 0.02 0.00 7179079/129167539 get_modifier [55] + 0.07 0.00 29944440/129167539 check_overpopulated [184] + 0.08 0.00 34058224/129167539 room_for_race_in_region [165] +[89] 0.9 0.32 0.00 129167539 u_race [89] +----------------------------------------------- + 0.05 0.26 7179079/7179079 get_modifier [55] +[90] 0.9 0.05 0.26 7179079 att_modification [90] + 0.12 0.00 7027859/12246335 ct_find [114] + 0.09 0.00 10322799/51974272 a_find [65] + 0.04 0.00 3294942/10190660 get_curse [143] + 0.01 0.00 3294942/5152236 ct_changed [592] + 0.00 0.00 601859/4201030 curse_active [543] + 0.00 0.00 58/432940 curse_geteffect [1395] +----------------------------------------------- + 0.04 0.27 1/1 process [7] +[91] 0.9 0.04 0.27 1 randomevents [91] + 0.03 0.03 1/1 dissolve_units [241] + 0.03 0.02 1/1 demon_skillchanges [246] + 0.01 0.03 1/1 rotting_herbs [284] + 0.00 0.04 1/1 icebergs [285] + 0.02 0.01 1/1 orc_growth [370] + 0.02 0.00 1/1 godcurse [405] + 0.01 0.00 1/1 chaos_update [514] + 0.00 0.00 419410/3902878 get_monsters [293] + 0.00 0.00 178254/51974272 a_find [65] + 0.00 0.00 176065/129167539 u_race [89] + 0.00 0.00 1/1 volcano_update [981] + 0.00 0.00 172/2605004 rpeasants [435] + 0.00 0.00 6/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.31 96555/96555 travel [81] +[92] 0.9 0.00 0.31 96555 travel_i [92] + 0.00 0.12 96482/96482 travel_route [147] + 0.00 0.11 96450/96450 movement_speed [155] + 0.05 0.00 96482/96482 get_followers [254] + 0.00 0.01 96450/96450 cap_route [502] + 0.00 0.01 96555/96555 canwalk [633] + 0.00 0.00 162752/55492327 getkeyword [54] + 0.00 0.00 65/282847 getunit [205] + 0.00 0.00 105/15102 cmistake [718] + 0.00 0.00 32/967784 msg_message [132] + 0.00 0.00 33/392959 add_message [434] + 0.00 0.00 65/1027665 init_order [613] + 0.00 0.00 32/115276 can_move [736] + 0.00 0.00 32/1629412 LongHunger [536] + 0.00 0.00 1/41248 msg_feedback [647] + 0.00 0.00 199/95593 can_leave [1112] + 0.00 0.00 33/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.30 4629/4629 produce [29] +[93] 0.9 0.00 0.30 4629 expandselling [93] + 0.06 0.19 282676/860263 use_pooled [39] + 0.01 0.02 4628/10852 expandorders [197] + 0.01 0.00 282676/11241829 i_change [115] + 0.00 0.00 283759/2599554 change_money [337] + 0.00 0.00 370844/51974272 a_find [65] + 0.00 0.00 12448/967784 msg_message [132] + 0.00 0.00 5821/34409 add_income [625] + 0.00 0.00 4629/12933 owner_buildingtyp [676] + 0.00 0.00 9465/593636 building_owner [232] + 0.00 0.00 12448/392959 add_message [434] + 0.00 0.00 3778/184870 buildingeffsize [367] + 0.00 0.00 4738/451774 a_remove [366] + 0.00 0.00 4738/779419 a_add [555] + 0.00 0.00 4690/2605004 rpeasants [435] + 0.00 0.00 4629/4666665 rmoney [452] + 0.00 0.00 3/560926 bt_find [237] + 0.00 0.00 287458/308950 r_demand [1404] + 0.00 0.00 12448/1009028 msg_release [1373] + 0.00 0.00 4738/779868 a_new [1376] + 0.00 0.00 4629/204314 bt_changed [1415] + 0.00 0.00 4628/1511812 newterrain [1359] + 0.00 0.00 344/75797 buildingtype_exists [1443] + 0.00 0.00 13/217405 r_setdemand [1413] +----------------------------------------------- + 0.29 0.00 18856320/18856320 travelthru_map [41] +[94] 0.8 0.29 0.00 18856320 cb_add_seen [94] + 0.00 0.00 61444/745269 add_seen_nb [386] +----------------------------------------------- + +[95] 0.8 0.28 0.00 cb_find_prefix_i [95] +----------------------------------------------- + +[96] 0.8 0.28 0.00 from_external_node [96] +----------------------------------------------- + 0.12 0.15 596221/596221 write_game [83] +[97] 0.8 0.12 0.15 596221 write_unit [97] + 0.00 0.08 607926/607926 writeorder [208] + 0.00 0.03 596221/839970 write_attribs [301] + 0.01 0.00 596221/629123 write_items [511] + 0.01 0.00 596221/2868601 u_irace [257] + 0.01 0.00 596221/604861 write_unit_reference [557] + 0.01 0.00 692835/55492327 getkeyword [54] + 0.00 0.00 47440/593636 building_owner [232] + 0.00 0.00 1788663/129167539 u_race [89] + 0.00 0.00 692829/2155959 is_persistent [687] + 0.00 0.00 68016/2985733 is_repeated [552] + 0.00 0.00 27416/3358315 ship_owner [438] + 0.00 0.00 40/2383101 unitname [142] + 0.00 0.00 40/64 log_info [1339] + 0.00 0.00 596221/647569 write_faction_reference [1382] + 0.00 0.00 596221/642406 write_building_reference [1383] + 0.00 0.00 596221/615299 write_ship_reference [1386] +----------------------------------------------- + 0.00 0.00 7964/5168717 report_crtypes [428] + 0.04 0.03 1380398/5168717 nr_render [25] + 0.11 0.09 3780355/5168717 nr_section [113] +[98] 0.8 0.15 0.12 5168717 nrt_find [98] + 0.12 0.00 5168717/32337529 hashstring [37] +----------------------------------------------- + 0.00 0.00 4/8302761 reserve_i [213] + 0.00 0.00 83859/8302761 reduce_weight [404] + 0.00 0.03 931076/8302761 change_resource [240] + 0.01 0.07 2367342/8302761 get_pooled [104] + 0.02 0.14 4920480/8302761 use_pooled [39] +[99] 0.8 0.03 0.23 8302761 get_resource [99] + 0.03 0.21 8301368/9232125 res_changeitem [101] + 0.00 0.00 357/443 res_changepermaura [912] + 0.00 0.00 983/1199 res_changeaura [972] + 0.00 0.00 53/53 lua_getresource [1191] +----------------------------------------------- + 54349 sm_familiar [520] + 0.00 0.00 1/12320804 plant [1184] + 0.00 0.00 1/12320804 planttrees [1206] + 0.00 0.00 1/12320804 destroy_road [1230] + 0.00 0.00 2/12320804 sp_bloodsacrifice [1209] + 0.00 0.00 2/12320804 breedtrees [1148] + 0.00 0.00 2/12320804 setstealth_cmd [182] + 0.00 0.00 3/12320804 target_resists_magic [1154] + 0.00 0.00 4/12320804 sail [181] + 0.00 0.00 4/12320804 create_ship [1014] + 0.00 0.00 15/12320804 age_stonecircle [1021] + 0.00 0.00 22/12320804 reshow [822] + 0.00 0.00 41/12320804 build_road [950] + 0.00 0.00 44/12320804 plan_monsters [52] + 0.00 0.00 65/12320804 steal_cmd [766] + 0.00 0.00 90/12320804 sp_charmingsong [993] + 0.00 0.00 96/12320804 spy_cmd [990] + 0.00 0.00 165/12320804 update_spells [381] + 0.00 0.00 170/12320804 breedhorses [742] + 0.00 0.00 200/12320804 max_skill [1037] + 0.00 0.00 226/12320804 fumble [973] + 0.00 0.00 251/12320804 cancast [833] + 0.00 0.00 329/12320804 cast_cmd [760] + 0.00 0.00 349/12320804 research_cmd [886] + 0.00 0.00 377/12320804 manufacture [759] + 0.00 0.00 432/12320804 continue_ship [813] + 0.00 0.00 489/12320804 u_hasspell [951] + 0.00 0.00 508/12320804 regeneration [942] + 0.00 0.00 621/12320804 build_building [696] + 0.00 0.00 1230/12320804 build [691] + 0.00 0.00 1302/12320804 get_combatspelllevel [880] + 0.00 0.00 1334/12320804 bufunit [17] + 0.00 0.00 1423/12320804 leveled_allocation [888] + 0.00 0.00 1717/12320804 faction_getmages [382] + 0.00 0.00 2273/12320804 do_combatmagic [825] + 0.00 0.00 2659/12320804 tax_cmd [697] + 0.00 0.00 2909/12320804 make_fighter [424] + 0.00 0.00 2939/12320804 allocate_resource [752] + 0.00 0.00 3116/12320804 drifting_ships [490] + 0.00 0.00 3403/12320804 lighthouse_range [728] + 0.00 0.00 5358/12320804 max_spellpoints [755] + 0.00 0.00 5903/12320804 buy [707] + 0.00 0.00 5988/12320804 herbsearch [493] + 0.00 0.00 6428/12320804 cansee_unit [684] + 0.00 0.00 6580/12320804 study_cmd [105] + 0.00 0.00 7254/12320804 ship_ready [354] + 0.00 0.00 7957/12320804 magic_resistance [727] + 0.00 0.00 8873/12320804 bewegung_blockiert_von [631] + 0.00 0.00 10679/12320804 move_ship [374] + 0.00 0.00 12787/12320804 canwalk [633] + 0.00 0.00 20459/12320804 crew_skill [344] + 0.00 0.00 28293/12320804 sell [498] + 0.00 0.00 33015/12320804 ridingcapacity [694] + 0.00 0.00 33156/12320804 entertain_cmd [665] + 0.00 0.01 116914/12320804 horse_fleeing_bonus [604] + 0.00 0.01 116914/12320804 fleechance [408] + 0.00 0.01 137709/12320804 CavalryBonus [491] + 0.00 0.01 172836/12320804 cansee_durchgezogen [170] + 0.00 0.01 179414/12320804 walkingcapacity [403] + 0.01 0.01 192556/12320804 canride [465] + 0.01 0.01 207188/12320804 report_resources [210] + 0.02 0.02 551693/12320804 weapon_skill [221] + 0.02 0.03 604957/12320804 cr_output_unit [19] + 0.03 0.05 1188531/12320804 eff_stealth [163] + 0.03 0.05 1213526/12320804 make_summary [21] + 0.04 0.06 1327770/12320804 armedmen [151] + 0.04 0.06 1381157/12320804 unit_max_hp [136] + 0.07 0.10 2363341/12320804 cansee [22] +[100] 0.8 0.25 0.01 10030400 effskill [100] + 0.01 0.00 10030400/21345834 skill_enabled [365] + 4953357 eff_skill [334] +----------------------------------------------- + 0.00 0.02 930757/9232125 change_resource [240] + 0.03 0.21 8301368/9232125 get_resource [99] +[101] 0.8 0.03 0.23 9232125 res_changeitem [101] + 0.17 0.00 9232120/11241829 i_change [115] + 0.02 0.03 9163148/9163148 golem_factor [265] + 0.01 0.00 9232120/9298667 resource2item [546] + 0.00 0.00 1/3178 scale_number [969] +----------------------------------------------- + 0.00 0.26 131722/131722 economics [78] +[102] 0.7 0.00 0.26 131722 give_cmd [102] + 0.00 0.18 95533/95533 give_item [126] + 0.00 0.04 131722/282847 getunit [205] + 0.00 0.01 102699/102705 can_give_to [600] + 0.00 0.01 102606/9953180 alliedunit [31] + 0.00 0.01 231035/2281756 gettoken [195] + 0.00 0.00 102606/71815034 get_race [12] + 0.00 0.00 28910/41248 msg_feedback [647] + 0.00 0.00 29028/392959 add_message [434] + 0.00 0.00 131722/1027665 init_order [613] + 0.00 0.00 307120/129167539 u_race [89] + 0.00 0.00 94233/534930 isparam [668] + 0.00 0.00 93568/191379 finditemtype [735] + 0.00 0.00 18400/6010308 i_find [127] + 0.00 0.00 45456/1787006 findparam [458] + 0.00 0.00 24010/4851739 get_reservation [281] + 0.00 0.00 588/588 give_men [857] + 0.00 0.00 965/15102 cmistake [718] + 0.00 0.00 102739/18647447 getplane [596] + 0.00 0.00 114/114 give_unit [952] + 0.00 0.00 71/71 disband_men [999] + 0.00 0.00 102761/102761 check_give [1138] + 0.00 0.00 50/8898 ucontact [927] + 0.00 0.00 114935/217696 can_give [1335] + 0.00 0.00 131729/203117 atoip [1416] + 0.00 0.00 29028/1009028 msg_release [1373] +----------------------------------------------- + 0.02 0.10 700757/1405457 cr_output_unit [19] + 0.03 0.10 704700/1405457 bufunit [17] +[103] 0.7 0.05 0.20 1405457 report_items [103] + 0.06 0.11 8843052/12353561 report_item [106] + 0.02 0.00 1017568/12246335 ct_find [114] + 0.01 0.00 1017568/10190660 get_curse [143] +----------------------------------------------- + 1825360 get_pooled [104] + 0.00 0.00 1/541982 planttrees [1206] + 0.00 0.00 1/541982 breedtrees [1148] + 0.00 0.00 1/541982 promotion_cmd [917] + 0.00 0.00 2/541982 plant [1184] + 0.00 0.00 23/541982 build_road [950] + 0.00 0.00 59/541982 expandstealing [807] + 0.00 0.00 122/541982 maxbuild [946] + 0.00 0.00 404/541982 academy_can_teach [527] + 0.00 0.00 489/541982 eff_spelllevel [845] + 0.00 0.00 503/541982 cancast [833] + 0.00 0.00 590/541982 use_item [765] + 0.00 0.00 1670/541982 do_recruiting [351] + 0.00 0.00 1816/541982 build [691] + 0.00 0.00 3359/541982 recruit [650] + 0.00 0.00 7821/541982 study_cmd [105] + 0.00 0.01 13492/541982 maintain [478] + 0.00 0.01 15796/541982 sell [498] + 0.01 0.04 95533/541982 give_item [126] + 0.02 0.16 400300/541982 expandbuying [49] +[104] 0.7 0.03 0.21 541982+1825360 get_pooled [104] + 0.01 0.11 1273750/9953180 alliedunit [31] + 0.01 0.07 2367342/8302761 get_resource [99] + 0.00 0.00 671315/4851739 get_reservation [281] + 0.01 0.00 2367342/129167539 u_race [89] + 0.00 0.00 1849529/7417541 urace [436] + 1825360 get_pooled [104] +----------------------------------------------- + 0.03 0.21 417808/417808 process [7] +[105] 0.7 0.03 0.21 417808 study_cmd [105] + 0.00 0.04 420075/560926 bt_find [237] + 0.01 0.02 417577/451774 a_remove [366] + 0.00 0.02 417775/435022 getskill [387] + 0.02 0.00 417730/418134 study_cost [433] + 0.01 0.01 836342/2858912 get_effect [225] + 0.00 0.01 417740/71815034 get_race [12] + 0.01 0.00 417580/424669 active_building [560] + 0.00 0.01 417577/892307 learn_skill [471] + 0.00 0.00 7475/860263 use_pooled [39] + 0.00 0.01 405840/779419 a_add [555] + 0.00 0.00 835616/4984610 config_get_int [348] + 0.00 0.00 417739/51974272 a_find [65] + 0.00 0.00 7821/541982 get_pooled [104] + 0.00 0.00 417775/1027665 init_order [613] + 0.00 0.00 20072/967784 msg_message [132] + 0.00 0.00 169917/12246335 ct_find [114] + 0.00 0.00 169917/10190660 get_curse [143] + 0.00 0.00 835519/129167539 u_race [89] + 0.00 0.00 417808/748527 unit_can_study [709] + 0.00 0.00 417577/417577 study_days [747] + 0.00 0.00 20258/392959 add_message [434] + 0.00 0.00 6326/9953180 alliedunit [31] + 0.00 0.00 6580/12320804 effskill [100] + 0.00 0.00 169917/4201030 curse_active [543] + 0.00 0.00 4/4 count_skill [868] + 0.00 0.00 234/15102 cmistake [718] + 0.00 0.00 15296/56052475 get_resourcetype [194] + 0.00 0.00 186/41248 msg_feedback [647] + 0.00 0.00 3659/3659 ExpensiveMigrants [1004] + 0.00 0.00 589/2624955 has_skill [193] + 0.00 0.00 524/2426021 get_mage [198] + 0.00 0.00 1118/2977 change_effect [982] + 0.00 0.00 3659/3659 is_migrant [1047] + 0.00 0.00 524/793 is_familiar [1092] + 0.00 0.00 91/1441945 is_mage [262] + 0.00 0.00 17/45891 get_level [934] + 0.00 0.00 4/1583 skill_limit [1172] + 0.00 0.00 417577/417577 study_speedup [1398] + 0.00 0.00 405840/779868 a_new [1376] + 0.00 0.00 169917/651711 oldcursename [1381] + 0.00 0.00 20258/1009028 msg_release [1373] + 0.00 0.00 2495/75797 buildingtype_exists [1443] +----------------------------------------------- + 0.01 0.02 1727391/12353561 cr_output_unit [19] + 0.01 0.02 1783118/12353561 bufunit [17] + 0.06 0.11 8843052/12353561 report_items [103] +[106] 0.7 0.08 0.16 12353561 report_item [106] + 0.04 0.04 1783118/24887945 locale_string [27] + 0.05 0.00 11478488/13259934 resourcename [233] + 0.02 0.00 12353561/56052475 get_resourcetype [194] + 0.00 0.00 101492/129167539 u_race [89] +----------------------------------------------- + 0.03 0.00 884940/5985780 itoa10 [338] + 0.20 0.00 5100840/5985780 itoa36 [116] +[107] 0.7 0.23 0.00 5985780 itoab [107] +----------------------------------------------- + 0.00 0.00 41086/2006524 cr_order [489] + 0.01 0.04 494960/2006524 buforder [201] + 0.04 0.13 1470478/2006524 write_order [121] +[108] 0.7 0.05 0.18 2006524 get_command [108] + 0.05 0.05 2006524/24887945 locale_string [27] + 0.07 0.00 3889315/34611296 strlcpy [45] + 0.01 0.00 3889315/36653945 wrptr [178] + 0.00 0.00 2006524/2009097 keyword [1355] +----------------------------------------------- + 0.00 0.00 145/1118718 findunitr [991] + 0.00 0.00 754/1118718 createunitid [317] + 0.00 0.00 1794/1118718 remove_unit [499] + 0.00 0.00 5523/1118718 newunitid [319] + 0.04 0.00 221899/1118718 findunitg [279] + 0.17 0.01 888603/1118718 findunit [123] +[109] 0.7 0.22 0.01 1118718 ufindhash [109] + 0.01 0.00 1118718/2903884 jenkins_hash [439] +----------------------------------------------- + 0.00 0.00 3232/4488684 cr_output_resources [238] + 0.00 0.00 50896/4488684 write_translations [689] + 0.01 0.21 4434556/4488684 translate [75] +[110] 0.6 0.01 0.22 4488684 crtag [110] + 0.11 0.11 4488684/24887945 locale_string [27] + 0.00 0.00 1/5588 get_locale [884] +----------------------------------------------- + 0.01 0.21 180598/180598 report_plaintext [4] +[111] 0.6 0.01 0.21 180598 nr_ship [111] + 0.08 0.00 180598/2742237 paragraph [26] + 0.06 0.00 180598/1766225 nr_curses [48] + 0.03 0.00 18693/47902 getshipweight [212] + 0.01 0.01 373674/24887945 locale_string [27] + 0.01 0.00 532232/34611296 strlcpy [45] + 0.00 0.01 180598/1065211 shipname [290] + 0.00 0.00 18693/47887 shipcapacity [567] + 0.00 0.00 743981/36653945 wrptr [178] + 0.00 0.00 180598/2494242 newline [594] + 0.00 0.00 30150/30150 ship_damage_percent [1482] +----------------------------------------------- + +[112] 0.6 0.22 0.00 ql_advance [112] +----------------------------------------------- + 0.00 0.00 41255/3780355 log_orders [251] + 0.02 0.20 3739100/3780355 rp_messages [36] +[113] 0.6 0.02 0.20 3780355 nr_section [113] + 0.11 0.09 3780355/5168717 nrt_find [98] +----------------------------------------------- + 0.00 0.00 1/12246335 unit_max_hp [136] + 0.00 0.00 1/12246335 sp_holyground [1068] + 0.00 0.00 1/12246335 monthly_healing [215] + 0.00 0.00 1/12246335 spawn_undead [629] + 0.00 0.00 2/12246335 sp_charmingsong [993] + 0.00 0.00 2/12246335 sp_generous [1040] + 0.00 0.00 2/12246335 sp_enterastral [1045] + 0.00 0.00 2/12246335 shipcurse_flyingship [1072] + 0.00 0.00 3/12246335 sp_song_of_peace [939] + 0.00 0.00 3/12246335 sp_eternizewall [988] + 0.00 0.00 3/12246335 init_rules [1272] + 0.00 0.00 3/12246335 skilldiff [166] + 0.00 0.00 4/12246335 sp_goodwinds [974] + 0.00 0.00 6/12246335 forget_cmd [1093] + 0.00 0.00 9/12246335 is_freezing [1088] + 0.00 0.00 13/12246335 sp_blessedharvest [847] + 0.00 0.00 15/12246335 age_stonecircle [1021] + 0.00 0.00 17/12246335 produce [29] + 0.00 0.00 17/12246335 process [7] + 0.00 0.00 17/12246335 magic [157] + 0.00 0.00 22/12246335 drifting_ships [490] + 0.00 0.00 27/12246335 sp_stormwinds [871] + 0.00 0.00 34/12246335 sp_viewreality [784] + 0.00 0.00 99/12246335 report_template [87] + 0.00 0.00 349/12246335 can_give_men [940] + 0.00 0.00 406/12246335 make_fighter [424] + 0.00 0.00 450/12246335 spellpower [1000] + 0.00 0.00 452/12246335 fumble [973] + 0.00 0.00 488/12246335 give_men [857] + 0.00 0.00 508/12246335 regenerate_aura [346] + 0.00 0.00 1689/12246335 recruit [650] + 0.00 0.00 2815/12246335 count_faction [219] + 0.00 0.00 4020/12246335 curse_read [770] + 0.00 0.00 5358/12246335 max_spellpoints [755] + 0.00 0.00 5380/12246335 teach_cmd [272] + 0.00 0.00 5948/12246335 deathcounts [843] + 0.00 0.00 8515/12246335 describe [35] + 0.00 0.00 8573/12246335 magic_resistance [727] + 0.00 0.00 9250/12246335 movement_speed [155] + 0.00 0.00 16560/12246335 entertain_cmd [665] + 0.00 0.00 29173/12246335 horses [330] + 0.00 0.00 32649/12246335 growing_trees [624] + 0.00 0.00 37300/12246335 cr_output_region [10] + 0.00 0.00 39858/12246335 sail [181] + 0.00 0.00 67682/12246335 shipspeed [669] + 0.00 0.00 91155/12246335 godcurse [405] + 0.00 0.00 91483/12246335 orc_growth [370] + 0.00 0.00 94865/12246335 ageing [185] + 0.00 0.00 104368/12246335 roadto [606] + 0.00 0.00 159633/12246335 entertainmoney [643] + 0.00 0.00 169917/12246335 study_cmd [105] + 0.00 0.00 173175/12246335 can_survive [640] + 0.00 0.00 178254/12246335 maintain_buildings [339] + 0.00 0.00 282968/12246335 move_blocked [283] + 0.01 0.00 669051/12246335 production [417] + 0.01 0.00 733941/12246335 default_wage [173] + 0.02 0.00 1017568/12246335 report_items [103] + 0.02 0.00 1174371/12246335 terrain_name [226] + 0.12 0.00 7027859/12246335 att_modification [90] +[114] 0.6 0.21 0.00 12246335 ct_find [114] +----------------------------------------------- + 0.00 0.00 1/11241829 age_stonecircle [1021] + 0.00 0.00 4/11241829 claim_cmd [1242] + 0.00 0.00 26/11241829 gift_items [891] + 0.00 0.00 121/11241829 tolua_unit_add_item [1103] + 0.00 0.00 129/11241829 create_potion [821] + 0.00 0.00 306/11241829 manufacture [759] + 0.00 0.00 340/11241829 aftermath [701] + 0.00 0.00 1091/11241829 loot_items [810] + 0.00 0.00 2825/11241829 split_allocations [743] + 0.00 0.00 3221/11241829 terminate [242] + 0.00 0.00 5896/11241829 herbsearch [493] + 0.00 0.00 12859/11241829 breedhorses [742] + 0.00 0.00 22496/11241829 rotting_herbs [284] + 0.00 0.00 93119/11241829 give_item [126] + 0.01 0.00 282676/11241829 expandselling [93] + 0.01 0.00 347340/11241829 statistics [70] + 0.01 0.00 448447/11241829 read_items [320] + 0.01 0.00 788812/11241829 expandbuying [49] + 0.17 0.00 9232120/11241829 res_changeitem [101] +[115] 0.6 0.21 0.00 11241829 i_change [115] + 0.00 0.00 735776/822780 i_new [1375] + 0.00 0.00 98482/374425 i_free [1400] +----------------------------------------------- + 0.00 0.00 1/5100840 give_men [857] + 0.00 0.00 2/5100840 new_ship [1229] + 0.00 0.00 5/5100840 factionorders [983] + 0.00 0.00 11/5100840 new_building [1059] + 0.00 0.00 52/5100840 update_nmrs [1155] + 0.00 0.00 232/5100840 write_script [853] + 0.00 0.00 232/5100840 writepasswd [1074] + 0.00 0.00 233/5100840 readfaction [767] + 0.00 0.00 462/5100840 score [23] + 0.00 0.00 559/5100840 write_reports [3] + 0.00 0.00 1196/5100840 create_order [341] + 0.00 0.00 2008/5100840 default_name [851] + 0.00 0.00 17417/5100840 teach_cmd [272] + 0.00 0.00 18788/5100840 sideabkz [745] + 0.00 0.00 25857/5100840 eval_int36 [729] + 0.00 0.00 52225/5100840 report_template [87] + 0.00 0.00 56643/5100840 groupid [698] + 0.00 0.01 180818/5100840 write_buildingname [622] + 0.00 0.04 1065211/5100840 write_shipname [291] + 0.00 0.05 1295787/5100840 factionname [247] + 0.00 0.09 2383101/5100840 write_unitname [148] +[116] 0.6 0.00 0.20 5100840 itoa36 [116] + 0.20 0.00 5100840/5985780 itoab [107] +----------------------------------------------- + 0.00 0.00 1/1481407 tolua_unit_add_order [1276] + 0.00 0.00 47/1481407 give_peasants [1060] + 0.00 0.00 136/1481407 make_movement_order [522] + 0.00 0.00 232/1481407 defaultorders [249] + 0.01 0.07 606357/1481407 read_unit [74] + 0.01 0.10 874634/1481407 unitorders [46] +[117] 0.6 0.02 0.17 1481407 parse_order [117] + 0.04 0.04 1481407/1929215 create_order_i [175] + 0.00 0.05 1505792/2066777 parse_token_depr [220] + 0.03 0.02 1481407/1481616 get_keyword [274] + 0.00 0.00 24385/534930 isparam [668] +----------------------------------------------- + 0.00 0.00 22644/2248440 new_border [705] + 0.19 0.00 2225796/2248440 get_borders [120] +[118] 0.5 0.19 0.00 2248440 get_borders_i [118] +----------------------------------------------- + +[119] 0.5 0.19 0.00 bin_r_int_pak [119] +----------------------------------------------- + 0.00 0.00 22/2225796 rsetroad [1152] + 0.00 0.01 106203/2225796 travel_route [147] + 0.00 0.01 113487/2225796 next_region [601] + 0.00 0.01 143730/2225796 rroad [508] + 0.00 0.03 300501/2225796 move_blocked [283] + 0.00 0.06 765959/2225796 describe [35] + 0.00 0.07 795894/2225796 cr_borders [135] +[120] 0.5 0.00 0.19 2225796 get_borders [120] + 0.19 0.00 2225796/2248440 get_borders_i [118] +----------------------------------------------- + 0.00 0.01 123513/1470505 eval_order [472] + 0.00 0.01 128725/1470505 report_template [87] + 0.01 0.07 607926/1470505 writeorder [208] + 0.01 0.07 610341/1470505 stream_order [167] +[121] 0.5 0.02 0.17 1470505 write_order [121] + 0.04 0.13 1470478/2006524 get_command [108] +----------------------------------------------- + 0.00 0.00 8/2934859 sp_summon_familiar [1025] + 0.00 0.00 17/2934859 recruit_dracoids [837] + 0.00 0.00 44/2934859 plan_monsters [52] + 0.00 0.00 48/2934859 spy_message [1038] + 0.00 0.00 58/2934859 create_data [252] + 0.00 0.00 119/2934859 plan_dragon [273] + 0.00 0.00 20072/2934859 cr_skill [672] + 0.00 0.00 40099/2934859 eval_skill [671] + 0.00 0.02 317467/2934859 monster_learn [269] + 0.00 0.04 603246/2934859 cr_output_unit [19] + 0.01 0.12 1953681/2934859 spskill [53] +[122] 0.5 0.01 0.18 2934859 skillname [122] + 0.07 0.07 2934859/24887945 locale_string [27] + 0.01 0.03 2934859/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 1/888603 tolua_get_unit [1254] + 0.00 0.00 16/888603 verify_unit [1028] + 0.00 0.00 20/888603 restack_units [353] + 0.00 0.00 147/888603 contact_cmd [965] + 0.00 0.00 900/888603 follow_unit [331] + 0.00 0.00 9926/888603 resolve_unit [703] + 0.00 0.06 282468/888603 getunit [205] + 0.00 0.12 595125/888603 read_unit [74] +[123] 0.5 0.00 0.18 888603 findunit [123] + 0.17 0.01 888603/1118718 ufindhash [109] +----------------------------------------------- + +[124] 0.5 0.18 0.00 fs_write [124] +----------------------------------------------- + 0.00 0.00 54318/5387327 getstrtoken [710] + 0.02 0.01 984476/5387327 unitorders [46] + 0.05 0.02 2066777/5387327 parse_token_depr [220] + 0.06 0.02 2281756/5387327 gettoken [195] +[125] 0.5 0.13 0.05 5387327 parse_token [125] + 0.05 0.00 5306964/5329742 eatwhitespace_c [255] + 0.00 0.00 85158/46391457 unicode_utf8_to_ucs4 [177] +----------------------------------------------- + 0.00 0.18 95533/95533 give_cmd [102] +[126] 0.5 0.00 0.18 95533 give_item [126] + 0.02 0.06 93824/860263 use_pooled [39] + 0.01 0.04 95533/541982 get_pooled [104] + 0.01 0.02 94308/94420 add_give [379] + 0.02 0.00 51003/51003 give_money [484] + 0.01 0.00 283665/283711 item2resource [561] + 0.00 0.00 93119/11241829 i_change [115] + 0.00 0.00 41876/41882 GiveRestriction [836] + 0.00 0.00 93119/93119 give_quota [858] + 0.00 0.00 1225/41248 msg_feedback [647] + 0.00 0.00 1225/392959 add_message [434] + 0.00 0.00 2364/4851739 get_reservation [281] + 0.00 0.00 1761/1761 give_horses [1108] + 0.00 0.00 186260/1342832 handle_event [1363] + 0.00 0.00 93119/93120 change_reservation [1441] + 0.00 0.00 1225/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 2/6010308 claim_cmd [1242] + 0.00 0.00 11/6010308 build_road [950] + 0.00 0.00 1356/6010308 build [691] + 0.00 0.00 18400/6010308 give_cmd [102] + 0.02 0.00 595476/6010308 rotting_herbs [284] + 0.15 0.00 5395063/6010308 i_get [130] +[127] 0.5 0.17 0.00 6010308 i_find [127] +----------------------------------------------- + 0.03 0.01 178254/713016 enter_2 [295] + 0.09 0.03 534762/713016 enter_1 [145] +[128] 0.5 0.12 0.05 713016 do_enter [128] + 0.04 0.00 4529361/55492327 getkeyword [54] + 0.00 0.00 405/405 enter_building [695] + 0.00 0.00 222/222 enter_ship [733] + 0.00 0.00 639/228907 getid [483] + 0.00 0.00 639/2281756 gettoken [195] + 0.00 0.00 639/6530 findparam_ex [926] + 0.00 0.00 639/1027665 init_order [613] + 0.00 0.00 514/1936876 free_order [1356] +----------------------------------------------- + 0.01 0.15 105106/105106 plan_monsters [52] +[129] 0.5 0.01 0.15 105106 monster_move [129] + 0.00 0.11 84017/84017 random_neighbour [153] + 0.00 0.02 83723/83859 reduce_weight [404] + 0.00 0.01 83723/447808 create_order [341] + 0.00 0.00 83723/24887945 locale_string [27] + 0.00 0.00 84047/71815034 get_race [12] + 0.00 0.00 105106/1121103 monster_is_waiting [407] + 0.00 0.00 168094/129167539 u_race [89] + 0.00 0.00 30/30 treeman_neighbour [1201] +----------------------------------------------- + 0.00 0.00 4/5395063 damage_unit [1044] + 0.00 0.00 59/5395063 reshow_other [823] + 0.00 0.00 118/5395063 steal_cmd [766] + 0.00 0.00 170/5395063 breedhorses [742] + 0.00 0.00 225/5395063 spellpower [1000] + 0.00 0.00 242/5395063 canfly [1031] + 0.00 0.00 372/5395063 bewegung_blockiert_von [631] + 0.00 0.00 2594/5395063 make_fighter [424] + 0.00 0.00 2938/5395063 allocate_resource [752] + 0.00 0.00 5358/5395063 max_spellpoints [755] + 0.00 0.00 7957/5395063 magic_resistance [727] + 0.00 0.00 10900/5395063 terminate [242] + 0.00 0.00 47287/5395063 canswim [682] + 0.00 0.00 83224/5395063 trollbelts [677] + 0.00 0.00 85655/5395063 movement_speed [155] + 0.00 0.00 96637/5395063 walkingcapacity [403] + 0.00 0.01 279395/5395063 weight [459] + 0.00 0.02 566190/5395063 invisible [139] + 0.00 0.02 703334/5395063 make_summary [21] + 0.01 0.10 3502404/5395063 item_invis [149] +[130] 0.5 0.01 0.15 5395063 i_get [130] + 0.15 0.00 5395063/6010308 i_find [127] +----------------------------------------------- + 0.00 0.16 363071/363071 attack [84] +[131] 0.5 0.00 0.16 363071 hits [131] + 0.00 0.10 353422/353422 skilldiff [166] + 0.01 0.04 726142/1662377 get_unitrow [154] + 0.00 0.00 353422/353422 contest [654] + 0.00 0.00 706844/868104 select_armor [700] + 0.00 0.00 363071/1218663 select_weapon [1367] + 0.00 0.00 363071/619425 getreload [1385] +----------------------------------------------- + 0.00 0.00 1/967784 sp_holyground [1068] + 0.00 0.00 1/967784 sp_summonshadowlords [1034] + 0.00 0.00 1/967784 sp_generous [1040] + 0.00 0.00 1/967784 do_battle [64] + 0.00 0.00 1/967784 breedtrees [1148] + 0.00 0.00 1/967784 promotion_cmd [917] + 0.00 0.00 1/967784 age_stonecircle [1021] + 0.00 0.00 1/967784 verify_building [1255] + 0.00 0.00 1/967784 cast_cmd [760] + 0.00 0.00 1/967784 sp_flying_ship [1064] + 0.00 0.00 1/967784 use_skillpotion [1233] + 0.00 0.00 2/967784 sp_summon_familiar [1025] + 0.00 0.00 2/967784 sp_bloodsacrifice [1209] + 0.00 0.00 2/967784 sp_charmingsong [993] + 0.00 0.00 2/967784 sp_viewreality [784] + 0.00 0.00 2/967784 magic [157] + 0.00 0.00 2/967784 create_icebergs [538] + 0.00 0.00 2/967784 make_wormhole [1150] + 0.00 0.00 2/967784 summon_allies [925] + 0.00 0.00 3/967784 wormhole_age [1130] + 0.00 0.00 3/967784 sp_eternizewall [988] + 0.00 0.00 3/967784 report_failed_spell [1187] + 0.00 0.00 3/967784 begin_potion [1096] + 0.00 0.00 3/967784 give_control_cmd [287] + 0.00 0.00 3/967784 drown [394] + 0.00 0.00 3/967784 melt_iceberg [1082] + 0.00 0.00 3/967784 use_healingpotion [1119] + 0.00 0.00 4/967784 caught_target [1003] + 0.00 0.00 4/967784 movement_error [1193] + 0.00 0.00 4/967784 sp_goodwinds [974] + 0.00 0.00 4/967784 sp_enterastral [1045] + 0.00 0.00 4/967784 terminate [242] + 0.00 0.00 4/967784 give_men [857] + 0.00 0.00 4/967784 quit [276] + 0.00 0.00 4/967784 move_iceberg [1094] + 0.00 0.00 4/967784 factionorders [983] + 0.00 0.00 5/967784 sp_song_of_peace [939] + 0.00 0.00 6/967784 spy_cmd [990] + 0.00 0.00 6/967784 cinfo_skillmod [1192] + 0.00 0.00 7/967784 sp_healing [989] + 0.00 0.00 9/967784 sp_stormwinds [871] + 0.00 0.00 10/967784 spawn_dragons [411] + 0.00 0.00 12/967784 drifting_ships [490] + 0.00 0.00 12/967784 sp_mallornhain [968] + 0.00 0.00 12/967784 sp_summonundead [896] + 0.00 0.00 12/967784 forget_cmd [1093] + 0.00 0.00 13/967784 volcano_destruction [1022] + 0.00 0.00 15/967784 do_fumble [1062] + 0.00 0.00 18/967784 sp_hain [931] + 0.00 0.00 18/967784 do_attack [80] + 0.00 0.00 18/967784 attack_firesword [785] + 0.00 0.00 21/967784 sp_kampfzauber [957] + 0.00 0.00 21/967784 build_road [950] + 0.00 0.00 22/967784 spy_message [1038] + 0.00 0.00 24/967784 nmr_warnings [878] + 0.00 0.00 24/967784 cinfo_slave [1118] + 0.00 0.00 26/967784 sp_blessedharvest [847] + 0.00 0.00 28/967784 cinfo_speed [1110] + 0.00 0.00 30/967784 steal_cmd [766] + 0.00 0.00 32/967784 travel_i [92] + 0.00 0.00 37/967784 volcano_update [981] + 0.00 0.00 38/967784 expandstealing [807] + 0.00 0.00 39/967784 deliverMail [966] + 0.00 0.00 39/967784 display_item [1054] + 0.00 0.00 39/967784 random_growl [1065] + 0.00 0.00 41/967784 dissolve_units [241] + 0.00 0.00 48/967784 caddmessage [1070] + 0.00 0.00 51/967784 potion_water_of_life [945] + 0.00 0.00 51/967784 chaos [848] + 0.00 0.00 53/967784 sp_dragonodem [627] + 0.00 0.00 56/967784 use_bloodpotion [935] + 0.00 0.00 58/967784 add_recruits [371] + 0.00 0.00 71/967784 disband_men [999] + 0.00 0.00 88/967784 hunger [808] + 0.00 0.00 92/967784 spawn_undead [629] + 0.00 0.00 100/967784 age_reduceproduction [1017] + 0.00 0.00 110/967784 peasants [658] + 0.00 0.00 115/967784 build_ship [839] + 0.00 0.00 120/967784 plagues [781] + 0.00 0.00 129/967784 create_potion [821] + 0.00 0.00 163/967784 cinfo_shipnodrift [997] + 0.00 0.00 170/967784 breedhorses [742] + 0.00 0.00 174/967784 cinfo_magicrunes [996] + 0.00 0.00 306/967784 manufacture [759] + 0.00 0.00 325/967784 mail_cmd [844] + 0.00 0.00 345/967784 end_potion [814] + 0.00 0.00 349/967784 research_cmd [886] + 0.00 0.00 395/967784 reportcasualties [881] + 0.00 0.00 490/967784 build_building [696] + 0.00 0.00 508/967784 regenerate_aura [346] + 0.00 0.00 567/967784 eaten_by_monster [468] + 0.00 0.00 614/967784 print_fighters [616] + 0.00 0.00 676/967784 rp_battles [618] + 0.00 0.00 679/967784 print_header [838] + 0.00 0.00 681/967784 absorbed_by_monster [804] + 0.00 0.00 1080/967784 report_plaintext [4] + 0.00 0.00 1911/967784 cinfo_magicresistance [824] + 0.00 0.00 1992/967784 aftermath [701] + 0.00 0.00 2069/967784 nr_curses_i [401] + 0.00 0.00 2274/967784 cinfo_ship [812] + 0.00 0.00 2317/967784 print_stats [525] + 0.00 0.00 2594/967784 battle_report [503] + 0.00 0.00 2699/967784 scared_by_monster [380] + 0.00 0.00 2938/967784 split_allocations [743] + 0.00 0.00 5049/967784 piracy_cmd [660] + 0.00 0.00 5810/967784 report_transfer [724] + 0.00 0.00 5907/967784 cinfo_simple [751] + 0.00 0.00 5966/967784 herbsearch [493] + 0.00 0.00 7042/967784 sail [181] + 0.00 0.00 8710/967784 maintain_buildings [339] + 0.00 0.00 11358/967784 expandbuying [49] + 0.00 0.00 12398/967784 fbattlerecord [688] + 0.00 0.00 12448/967784 expandselling [93] + 0.00 0.00 14939/967784 maintain [478] + 0.00 0.00 15359/967784 cinfo_building [686] + 0.00 0.00 20072/967784 study_cmd [105] + 0.00 0.00 34409/967784 add_income [625] + 0.00 0.01 80478/967784 add_give [379] + 0.00 0.01 96460/967784 travel_route [147] + 0.01 0.02 163573/967784 describe [35] + 0.01 0.02 192618/967784 statistics [70] + 0.01 0.03 247009/967784 prices [85] +[132] 0.4 0.03 0.12 967784 msg_message [132] + 0.04 0.02 967784/1010116 mt_find [227] + 0.00 0.06 967784/1009159 msg_create [228] +----------------------------------------------- + 0.00 0.00 923/1351796 name_unit [803] + 0.01 0.14 1350873/1351796 bufunit [17] +[133] 0.4 0.01 0.14 1351796 racename [133] + 0.04 0.03 1460143/24887945 locale_string [27] + 0.01 0.03 1351796/2275429 raceprefix [222] + 0.01 0.01 1351796/2818494 rc_name_s [260] + 0.00 0.00 216694/34611296 strlcpy [45] + 0.00 0.00 108347/4133717 mkname [261] + 0.00 0.00 216694/36653945 wrptr [178] +----------------------------------------------- + 0.00 0.00 12/1375380 volcano_destruction [1022] + 0.01 0.00 127590/1375380 drown [394] + 0.02 0.00 178254/1375380 economics [78] + 0.11 0.01 1069524/1375380 remove_empty_units [146] +[134] 0.4 0.14 0.01 1375380 remove_empty_units_in_region [134] + 0.00 0.00 493/1794 remove_unit [499] + 0.00 0.00 4181205/24935046 faction_alive [451] + 0.00 0.00 7279/71815034 get_race [12] + 0.00 0.00 7279/129167539 u_race [89] +----------------------------------------------- + 0.06 0.09 209572/209572 cr_output_region [10] +[135] 0.4 0.06 0.09 209572 cr_borders [135] + 0.00 0.07 795894/2225796 get_borders [120] + 0.00 0.01 97014/143730 rroad [508] + 0.00 0.00 97017/24887945 locale_string [27] + 0.00 0.00 97017/190469 border_name [641] + 0.00 0.00 51044/369586 r_connect [474] + 0.00 0.00 97017/4133717 mkname [261] + 0.00 0.00 103026/196476 b_finvisible [1417] + 0.00 0.00 103026/196476 b_rvisibleroad [1418] + 0.00 0.00 97017/190467 b_transparent [1420] + 0.00 0.00 12323/26515 b_uinvisible [1487] +----------------------------------------------- + 0.00 0.00 1/1381157 make_familiar [1219] + 0.00 0.00 1/1381157 make_zombie [1267] + 0.00 0.00 2/1381157 summon_allies [925] + 0.00 0.00 4/1381157 heal [1224] + 0.00 0.00 6/1381157 skill_summoned [1032] + 0.00 0.00 8/1381157 age_firedragon [1123] + 0.00 0.00 10/1381157 age_dragon [1098] + 0.00 0.00 14/1381157 age_ghoul [1024] + 0.00 0.00 30/1381157 equip_unit_mask [776] + 0.00 0.00 34/1381157 age_zombie [1019] + 0.00 0.00 38/1381157 age_skeleton [1008] + 0.00 0.00 52/1381157 terminate [242] + 0.00 0.00 92/1381157 spawn_undead [629] + 0.00 0.00 369/1381157 add_recruits [371] + 0.00 0.00 2889/1381157 create_unit [296] + 0.00 0.00 8962/1381157 battle_flee [352] + 0.00 0.06 595454/1381157 monthly_healing [215] + 0.01 0.07 773191/1381157 hp_status [206] +[136] 0.4 0.01 0.13 1381157 unit_max_hp [136] + 0.04 0.06 1381157/12320804 effskill [100] + 0.02 0.00 1366398/10190660 get_curse [143] + 0.00 0.01 1381157/4984610 config_get_int [348] + 0.00 0.00 1381157/129167539 u_race [89] + 0.00 0.00 1366398/5152236 ct_changed [592] + 0.00 0.00 1/12246335 ct_find [114] +----------------------------------------------- + +[137] 0.4 0.14 0.00 fstream_done [137] +----------------------------------------------- + +[138] 0.4 0.14 0.00 ql_get [138] +----------------------------------------------- + 0.00 0.00 12/1753922 spy_cmd [990] + 0.00 0.00 8873/1753922 bewegung_blockiert_von [631] + 0.00 0.00 13580/1753922 cansee_unit [684] + 0.00 0.02 218268/1753922 cansee_durchgezogen [170] + 0.00 0.12 1513189/1753922 cansee [22] +[139] 0.4 0.00 0.14 1753922 invisible [139] + 0.01 0.11 1751202/1751202 item_invis [149] + 0.00 0.02 566190/5395063 i_get [130] + 0.00 0.00 566190/56052475 get_resourcetype [194] +----------------------------------------------- + 0.00 0.14 7179079/7179079 get_modifier [55] +[140] 0.4 0.00 0.14 7179079 rc_skillmod [140] + 0.05 0.03 7179079/7910500 r_isforest [199] + 0.02 0.03 7179079/7179079 skill_mod [264] + 0.01 0.00 7179079/21345834 skill_enabled [365] + 0.00 0.00 469309/12560453 rc_changed [256] + 0.00 0.00 1/71815034 get_race [12] +----------------------------------------------- + 0.01 0.12 113592/113592 report_plaintext [4] +[141] 0.4 0.01 0.12 113592 nr_building [141] + 0.05 0.00 113592/2742237 paragraph [26] + 0.04 0.00 113592/1766225 nr_curses [48] + 0.00 0.01 113592/218422 report_building [397] + 0.01 0.01 227343/24887945 locale_string [27] + 0.00 0.00 260073/34611296 strlcpy [45] + 0.00 0.00 113592/180818 buildingname [621] + 0.00 0.00 373665/36653945 wrptr [178] + 0.00 0.00 113592/2494242 newline [594] + 0.00 0.00 113592/147171 building_finished [1428] +----------------------------------------------- + 0.00 0.00 1/2383101 tolua_unit_tostring [1300] + 0.00 0.00 2/2383101 sp_igjarjuk [923] + 0.00 0.00 40/2383101 write_unit [97] + 0.00 0.00 122/2383101 eval_unit_dative [1076] + 0.00 0.00 75486/2383101 cb_cr_travelthru_unit [466] + 0.00 0.01 159282/2383101 cb_write_travelthru [169] + 0.00 0.04 799425/2383101 eval_unit [223] + 0.01 0.07 1348743/2383101 bufunit [17] +[142] 0.4 0.01 0.12 2383101 unitname [142] + 0.00 0.12 2383101/2383101 write_unitname [148] +----------------------------------------------- + 0.00 0.00 1/10190660 sp_generous [1040] + 0.00 0.00 2/10190660 sp_enterastral [1045] + 0.00 0.00 2/10190660 shipcurse_flyingship [1072] + 0.00 0.00 3/10190660 skilldiff [166] + 0.00 0.00 6/10190660 forget_cmd [1093] + 0.00 0.00 9/10190660 is_freezing [1088] + 0.00 0.00 10/10190660 sp_stormwinds [871] + 0.00 0.00 13/10190660 set_curseingmagician [1265] + 0.00 0.00 15/10190660 age_stonecircle [1021] + 0.00 0.00 17/10190660 produce [29] + 0.00 0.00 17/10190660 process [7] + 0.00 0.00 17/10190660 magic [157] + 0.00 0.00 22/10190660 drifting_ships [490] + 0.00 0.00 34/10190660 sp_viewreality [784] + 0.00 0.00 45/10190660 create_curse [800] + 0.00 0.00 349/10190660 can_give_men [940] + 0.00 0.00 406/10190660 make_fighter [424] + 0.00 0.00 450/10190660 spellpower [1000] + 0.00 0.00 452/10190660 fumble [973] + 0.00 0.00 488/10190660 give_men [857] + 0.00 0.00 508/10190660 regenerate_aura [346] + 0.00 0.00 1689/10190660 recruit [650] + 0.00 0.00 2815/10190660 count_faction [219] + 0.00 0.00 2974/10190660 start_battle [297] + 0.00 0.00 4309/10190660 report_template [87] + 0.00 0.00 5358/10190660 max_spellpoints [755] + 0.00 0.00 5380/10190660 teach_cmd [272] + 0.00 0.00 5948/10190660 deathcounts [843] + 0.00 0.00 7957/10190660 magic_resistance [727] + 0.00 0.00 8515/10190660 describe [35] + 0.00 0.00 9250/10190660 movement_speed [155] + 0.00 0.00 16560/10190660 entertain_cmd [665] + 0.00 0.00 19730/10190660 can_survive [640] + 0.00 0.00 29173/10190660 horses [330] + 0.00 0.00 32649/10190660 growing_trees [624] + 0.00 0.00 37300/10190660 cr_output_region [10] + 0.00 0.00 39858/10190660 sail [181] + 0.00 0.00 46175/10190660 maintain_buildings [339] + 0.00 0.00 67682/10190660 shipspeed [669] + 0.00 0.00 90436/10190660 spawn_undead [629] + 0.00 0.00 91155/10190660 godcurse [405] + 0.00 0.00 91176/10190660 monthly_healing [215] + 0.00 0.00 91483/10190660 orc_growth [370] + 0.00 0.00 94865/10190660 ageing [185] + 0.00 0.00 159633/10190660 entertainmoney [643] + 0.00 0.00 169917/10190660 study_cmd [105] + 0.00 0.00 208736/10190660 roadto [606] + 0.00 0.00 282968/10190660 move_blocked [283] + 0.01 0.00 669051/10190660 production [417] + 0.01 0.00 1017568/10190660 report_items [103] + 0.01 0.00 1041773/10190660 default_wage [173] + 0.01 0.00 1174371/10190660 terrain_name [226] + 0.02 0.00 1366398/10190660 unit_max_hp [136] + 0.04 0.00 3294942/10190660 att_modification [90] +[143] 0.4 0.13 0.00 10190660 get_curse [143] +----------------------------------------------- + 0.00 0.03 102149/386740 cr_output_region [10] + 0.00 0.03 104830/386740 cr_output_building [239] + 0.00 0.06 179761/386740 cr_output_ship [152] +[144] 0.4 0.00 0.13 386740 cr_output_curses_compat [144] + 0.12 0.01 386740/1310373 cr_output_curses [69] +----------------------------------------------- + 0.00 0.12 534762/534762 process [7] +[145] 0.4 0.00 0.12 534762 enter_1 [145] + 0.09 0.03 534762/713016 do_enter [128] +----------------------------------------------- + 0.00 0.02 1/6 reports [2] + 0.00 0.02 1/6 demographics [50] + 0.00 0.02 1/6 quit [276] + 0.00 0.02 1/6 processorders [6] + 0.00 0.02 1/6 magic [157] + 0.00 0.02 1/6 dissolve_units [241] +[146] 0.4 0.01 0.11 6 remove_empty_units [146] + 0.11 0.01 1069524/1375380 remove_empty_units_in_region [134] +----------------------------------------------- + 0.00 0.12 96482/96482 travel_i [92] +[147] 0.4 0.00 0.12 96482 travel_route [147] + 0.00 0.03 96240/103187 cycle_route [375] + 0.00 0.02 96240/109785 move_unit [421] + 0.00 0.01 105958/300501 move_blocked [283] + 0.00 0.01 96460/967784 msg_message [132] + 0.00 0.01 96240/192556 canride [465] + 0.00 0.01 106203/2225796 get_borders [120] + 0.00 0.01 96240/106919 mark_travelthru [610] + 0.00 0.01 9680/9680 bewegung_blockiert_von [631] + 0.00 0.00 96460/392959 add_message [434] + 0.00 0.00 106203/263302 reldirection [528] + 0.00 0.00 105958/71815034 get_race [12] + 0.00 0.00 346411/129167539 u_race [89] + 0.00 0.00 10581/472418 produceexp [322] + 0.00 0.00 192722/337987 setguard [815] + 0.00 0.00 1953/47287 canswim [682] + 0.00 0.00 234/242 canfly [1031] + 0.00 0.00 234/1874928 terrain_name [226] + 0.00 0.00 9/188 is_freezing [1088] + 0.00 0.00 2/15102 cmistake [718] + 0.00 0.00 105958/105958 entrance_allowed [1437] + 0.00 0.00 96460/1009028 msg_release [1373] + 0.00 0.00 96208/96208 var_copy_regions [1439] + 0.00 0.00 1727/744202 has_horses [1378] + 0.00 0.00 1567/59694 r_insectstalled [1446] +----------------------------------------------- + 0.00 0.12 2383101/2383101 unitname [142] +[148] 0.3 0.00 0.12 2383101 write_unitname [148] + 0.00 0.09 2383101/5100840 itoa36 [116] + 0.00 0.03 2383101/3351853 unit_getname [332] + 0.00 0.00 2383101/5461936 slprintf [548] +----------------------------------------------- + 0.01 0.11 1751202/1751202 invisible [139] +[149] 0.3 0.01 0.11 1751202 item_invis [149] + 0.01 0.10 3502404/5395063 i_get [130] + 0.01 0.00 3502404/56052475 get_resourcetype [194] +----------------------------------------------- + 0.01 0.00 1336242/11253756 genrand_real2 [395] + 0.02 0.00 2276433/11253756 scramble [244] + 0.08 0.00 7641081/11253756 genrand_int31 [171] +[150] 0.3 0.12 0.00 11253756 genrand_int32 [150] +----------------------------------------------- + 0.00 0.00 42/771861 loot_cmd [873] + 0.00 0.00 79/771861 can_guard [908] + 0.00 0.00 960/771861 tax_cmd [697] + 0.00 0.00 15347/771861 can_start_guarding [679] + 0.01 0.04 351667/771861 make_summary [21] + 0.01 0.05 403766/771861 is_guardian_r [186] +[151] 0.3 0.02 0.10 771861 armedmen [151] + 0.04 0.06 1327770/12320804 effskill [100] + 0.00 0.00 771861/7417541 urace [436] + 0.00 0.00 2375762/2379316 resource2weapon [1353] +----------------------------------------------- + 0.00 0.12 179761/179761 cr_output_region [10] +[152] 0.3 0.00 0.12 179761 cr_output_ship [152] + 0.00 0.06 179761/386740 cr_output_curses_compat [144] + 0.03 0.00 18850/47902 getshipweight [212] + 0.01 0.01 179761/4434556 translate [75] + 0.00 0.00 179761/24887945 locale_string [27] + 0.00 0.00 18850/47887 shipcapacity [567] + 0.00 0.00 18850/66134 shipspeed [669] + 0.00 0.00 160572/4503145 omniscient [470] +----------------------------------------------- + 0.00 0.11 84017/84017 monster_move [129] +[153] 0.3 0.00 0.11 84017 random_neighbour [153] + 0.02 0.08 742235/742235 room_for_race_in_region [165] + 0.00 0.01 797286/797288 can_survive [640] + 0.00 0.00 742235/129167539 u_race [89] + 0.00 0.00 84017/1087065 get_neighbours [480] + 0.00 0.00 83698/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.00 33/1662377 select_ally [1132] + 0.00 0.00 308/1662377 fighters [1012] + 0.00 0.00 25256/1662377 count_enemies_i [636] + 0.00 0.00 49445/1662377 count_side [666] + 0.01 0.04 726142/1662377 hits [131] + 0.01 0.05 861193/1662377 select_enemy [172] +[154] 0.3 0.02 0.09 1662377 get_unitrow [154] + 0.09 0.00 1390078/1390078 get_row [189] + 0.00 0.00 1662377/4301501 statusrow [550] +----------------------------------------------- + 0.00 0.11 96450/96450 travel_i [92] +[155] 0.3 0.00 0.11 96450 movement_speed [155] + 0.01 0.08 96316/2480226 old_race [14] + 0.00 0.01 96316/192556 canride [465] + 0.00 0.00 75870/1441945 is_mage [262] + 0.00 0.00 85655/5395063 i_get [130] + 0.00 0.00 85655/2858912 get_effect [225] + 0.00 0.00 85655/1177511 it_find [385] + 0.00 0.00 85643/987488 is_astral [479] + 0.00 0.00 278421/129167539 u_race [89] + 0.00 0.00 9250/12246335 ct_find [114] + 0.00 0.00 9250/10190660 get_curse [143] + 0.00 0.00 9/2977 change_effect [982] + 0.00 0.00 1/2426021 get_mage [198] +----------------------------------------------- + +[156] 0.3 0.02 0.09 ql_set_insert_ex [156] + 0.05 0.00 4746218/7252744 cmp_transfer [203] + 0.04 0.00 3573165/3573165 cmp_faction [305] +----------------------------------------------- + 0.01 0.10 1/1 process [7] +[157] 0.3 0.01 0.10 1 magic [157] + 0.01 0.04 1190864/71815034 get_race [12] + 0.00 0.02 1/6 remove_empty_units [146] + 0.00 0.02 595478/1441945 is_mage [262] + 0.01 0.00 1128316/55492327 getkeyword [54] + 0.00 0.00 1190864/129167539 u_race [89] + 0.00 0.00 222/222 cast_cmd [760] + 0.00 0.00 2/2 sp_viewreality [784] + 0.00 0.00 192/273 pay_spell [805] + 0.00 0.00 220/251 cancast [833] + 0.00 0.00 13/13 sp_blessedharvest [847] + 0.00 0.00 220/251 eff_spelllevel [845] + 0.00 0.00 9/9 sp_stormwinds [871] + 0.00 0.00 6/6 sp_summonundead [896] + 0.00 0.00 2062/2831 countspells [903] + 0.00 0.00 3/3 sp_song_of_peace [939] + 0.00 0.00 9/10 sp_hain [931] + 0.00 0.00 6/6 sp_mallornhain [968] + 0.00 0.00 4/4 sp_goodwinds [974] + 0.00 0.00 195/226 fumble [973] + 0.00 0.00 3/3 sp_eternizewall [988] + 0.00 0.00 3/3 sp_charmingsong [993] + 0.00 0.00 196/225 spellpower [1000] + 0.00 0.00 2/2 sp_summon_familiar [1025] + 0.00 0.00 196/196 verify_targets [1027] + 0.00 0.00 1/1 sp_summonshadowlords [1034] + 0.00 0.00 1/1 sp_generous [1040] + 0.00 0.00 1/1 sp_enterastral [1045] + 0.00 0.00 152/472418 produceexp [322] + 0.00 0.00 8/8 do_fumble [1062] + 0.00 0.00 1/1 sp_flying_ship [1064] + 0.00 0.00 1/1 sp_holyground [1068] + 0.00 0.00 2/2 sp_bloodsacrifice [1209] + 0.00 0.00 196/499 MagicPower [1195] + 0.00 0.00 2/967784 msg_message [132] + 0.00 0.00 17/12246335 ct_find [114] + 0.00 0.00 17/10190660 get_curse [143] + 0.00 0.00 2/392959 add_message [434] + 0.00 0.00 17/4201030 curse_active [543] + 0.00 0.00 1/1 sp_seduce [1336] + 0.00 0.00 8501/59694 r_insectstalled [1446] + 0.00 0.00 220/229 add_castorder [1626] + 0.00 0.00 220/608 co_get_region [1594] + 0.00 0.00 119/121 lua_callspell [1645] + 0.00 0.00 99/99 spl_costtyp [1650] + 0.00 0.00 17/651711 oldcursename [1381] + 0.00 0.00 9/3717 free_castorders [1541] + 0.00 0.00 2/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 28167/10103290 cr_output_curses [69] + 0.00 0.00 35101/10103290 cr_output_spells [639] + 0.01 0.00 610341/10103290 stream_order [167] + 0.10 0.00 9429681/10103290 cr_output_unit [19] +[158] 0.3 0.11 0.00 10103290 stream_printf [158] +----------------------------------------------- + +[159] 0.3 0.11 0.00 fs_writeln [159] +----------------------------------------------- + 0.01 0.10 363135/363135 attack [84] +[160] 0.3 0.01 0.10 363135 select_opponent [160] + 0.03 0.07 363135/372173 select_enemy [172] + 0.00 0.00 363135/129167539 u_race [89] +----------------------------------------------- + 0.00 0.02 146950/950595 f_regionid_s [477] + 0.01 0.08 803645/950595 describe [35] +[161] 0.3 0.01 0.10 950595 f_regionid [161] + 0.01 0.04 950595/1552289 rname [200] + 0.03 0.00 950595/1826688 adjust_coordinates [234] + 0.02 0.00 950595/34611296 strlcpy [45] + 0.00 0.00 950595/18647447 getplane [596] + 0.00 0.00 950595/3587241 pnormalize [1350] +----------------------------------------------- + 0.00 0.00 14/1205451 allysfm [1122] + 0.00 0.00 1449/1205451 nmr_warnings [878] + 0.00 0.00 5926/1205451 writefaction [762] + 0.00 0.00 10565/1205451 list_address [635] + 0.01 0.10 1187497/1205451 bufunit [17] +[162] 0.3 0.01 0.10 1205451 alliedfaction [162] + 0.07 0.02 1205451/10375491 alliedgroup [34] +----------------------------------------------- + 0.00 0.00 9680/1188532 bewegung_blockiert_von [631] + 0.00 0.00 9999/1188532 cansee_unit [684] + 0.00 0.02 208440/1188532 cansee_durchgezogen [170] + 0.02 0.07 960413/1188532 cansee [22] +[163] 0.3 0.02 0.09 1188532 eff_stealth [163] + 0.03 0.05 1188531/12320804 effskill [100] + 0.00 0.00 1188531/21345834 skill_enabled [365] + 0.00 0.00 4846/8034 u_geteffstealth [919] +----------------------------------------------- + 0.03 0.08 10375461/10375461 alliedgroup [34] +[164] 0.3 0.03 0.08 10375461 AllianceRestricted [164] + 0.01 0.03 10375461/10383360 HelpMask [288] + 0.01 0.02 10375461/20777534 config_get [224] +----------------------------------------------- + 0.02 0.08 742235/742235 random_neighbour [153] +[165] 0.3 0.02 0.08 742235 room_for_race_in_region [165] + 0.08 0.00 34058224/129167539 u_race [89] +----------------------------------------------- + 0.00 0.10 353422/353422 hits [131] +[166] 0.3 0.00 0.10 353422 skilldiff [166] + 0.02 0.07 706844/860166 weapon_effskill [168] + 0.00 0.01 463903/71815034 get_race [12] + 0.00 0.00 11599/11599 building_protection [708] + 0.00 0.00 464187/129167539 u_race [89] + 0.00 0.00 3/12246335 ct_find [114] + 0.00 0.00 3/10190660 get_curse [143] + 0.00 0.00 3/4201030 curse_active [543] + 0.00 0.00 706844/1218663 select_weapon [1367] +----------------------------------------------- + 0.01 0.09 610341/610341 cr_output_unit [19] +[167] 0.3 0.01 0.09 610341 stream_order [167] + 0.01 0.07 610341/1470505 write_order [121] + 0.01 0.00 610341/618305 escape_string [556] + 0.01 0.00 610341/10103290 stream_printf [158] +----------------------------------------------- + 0.00 0.01 153322/860166 terminate [242] + 0.02 0.07 706844/860166 skilldiff [166] +[168] 0.3 0.02 0.08 860166 weapon_effskill [168] + 0.01 0.05 489652/546579 weapon_skill [221] + 0.00 0.01 120592/137709 CavalryBonus [491] + 0.00 0.01 116873/12320804 skillmod [214] + 0.00 0.00 116873/7417541 urace [436] + 0.00 0.00 1601194/1726748 is_riding [1358] +----------------------------------------------- + 0.00 0.10 1048274/1048274 travelthru_map [41] +[169] 0.3 0.00 0.10 1048274 cb_write_travelthru [169] + 0.01 0.04 1028195/1996097 travelthru_cansee [180] + 0.02 0.00 55063/2742237 paragraph [26] + 0.00 0.02 435946/1065211 shipname [290] + 0.00 0.01 159282/2383101 unitname [142] + 0.00 0.00 35368/24887945 locale_string [27] +----------------------------------------------- + 0.01 0.03 613860/1747682 count_cb [231] + 0.02 0.05 1133822/1747682 travelthru_cansee [180] +[170] 0.3 0.03 0.07 1747682 cansee_durchgezogen [170] + 0.00 0.02 208440/1188532 eff_stealth [163] + 0.00 0.02 218268/1753922 invisible [139] + 0.00 0.02 1394913/6610983 is_guard [211] + 0.00 0.01 172836/12320804 effskill [100] + 0.00 0.00 1747682/129167539 u_race [89] + 0.00 0.00 1394913/4835422 usiege [593] +----------------------------------------------- + 0.00 0.00 1/7641081 select_familiar [1322] + 0.00 0.00 1/7641081 breedtrees [1148] + 0.00 0.00 1/7641081 use_bloodpotion [935] + 0.00 0.00 2/7641081 sp_charmingsong [993] + 0.00 0.00 3/7641081 select_wormhole_regions [909] + 0.00 0.00 6/7641081 randomevents [91] + 0.00 0.00 6/7641081 rrandneighbour [1221] + 0.00 0.00 10/7641081 do_fumble [1062] + 0.00 0.00 12/7641081 volcano_destruction [1022] + 0.00 0.00 13/7641081 newcontainerid [1263] + 0.00 0.00 15/7641081 drift_target [1053] + 0.00 0.00 15/7641081 random_unit [1174] + 0.00 0.00 21/7641081 do_combatspell [702] + 0.00 0.00 24/7641081 equip_unit_mask [776] + 0.00 0.00 25/7641081 treeman_neighbour [1201] + 0.00 0.00 27/7641081 nrand [1232] + 0.00 0.00 29/7641081 select_ally [1132] + 0.00 0.00 29/7641081 move_icebergs [534] + 0.00 0.00 36/7641081 expandloot [816] + 0.00 0.00 37/7641081 move_iceberg [1094] + 0.00 0.00 48/7641081 chaosterrain [1213] + 0.00 0.00 60/7641081 do_recruiting [351] + 0.00 0.00 83/7641081 fumble [973] + 0.00 0.00 92/7641081 dragon_name [1095] + 0.00 0.00 112/7641081 attack_firesword [785] + 0.00 0.00 116/7641081 terraform_default [1165] + 0.00 0.00 170/7641081 use_default [1149] + 0.00 0.00 176/7641081 default_spoil [1144] + 0.00 0.00 182/7641081 age_firedragon [1123] + 0.00 0.00 208/7641081 dracoid_name [1126] + 0.00 0.00 290/7641081 scramble_fighters [1116] + 0.00 0.00 295/7641081 age_dragon [1098] + 0.00 0.00 298/7641081 terraform_region [932] + 0.00 0.00 360/7641081 plan_dragon [273] + 0.00 0.00 412/7641081 piracy_cmd [660] + 0.00 0.00 503/7641081 expandwork [277] + 0.00 0.00 588/7641081 make_name [970] + 0.00 0.00 598/7641081 makename [1084] + 0.00 0.00 648/7641081 volcano_update [981] + 0.00 0.00 653/7641081 age_ghoul [1024] + 0.00 0.00 665/7641081 age_zombie [1019] + 0.00 0.00 725/7641081 age_skeleton [1008] + 0.00 0.00 1279/7641081 scale_number [969] + 0.00 0.00 1281/7641081 leveled_allocation [888] + 0.00 0.00 1596/7641081 attrib_allocation [914] + 0.00 0.00 1918/7641081 spawn_braineaters [505] + 0.00 0.00 2126/7641081 dissolve_units [241] + 0.00 0.00 2204/7641081 loot_items [810] + 0.00 0.00 2818/7641081 newunitid [319] + 0.00 0.00 3890/7641081 chaos [848] + 0.00 0.00 9552/7641081 spawn_undead [629] + 0.00 0.00 11021/7641081 drain_exp [850] + 0.00 0.00 11540/7641081 absorbed_by_monster [804] + 0.00 0.00 13338/7641081 terminate [242] + 0.00 0.00 17902/7641081 make_fighter [424] + 0.00 0.00 18025/7641081 chaos_update [514] + 0.00 0.00 18444/7641081 demon_skillchange [826] + 0.00 0.00 33436/7641081 scareaway [768] + 0.00 0.00 39919/7641081 sail [181] + 0.00 0.00 41004/7641081 dice [787] + 0.00 0.00 47310/7641081 attack [84] + 0.00 0.00 60896/7641081 breedhorses [742] + 0.00 0.00 83698/7641081 random_neighbour [153] + 0.00 0.00 139786/7641081 spawn_dragons [411] + 0.00 0.00 204245/7641081 term_eval [410] + 0.00 0.00 317467/7641081 monster_learn [269] + 0.00 0.00 325282/7641081 eaten_by_monster [468] + 0.00 0.00 325825/7641081 scared_by_monster [380] + 0.00 0.00 361320/7641081 growing_trees [624] + 0.00 0.00 372078/7641081 select_enemy [172] + 0.00 0.00 373896/7641081 contest_classic [655] + 0.00 0.00 403488/7641081 lovar [644] + 0.00 0.01 479588/7641081 learn_skill [471] + 0.00 0.01 889716/7641081 skill_weeks [509] + 0.01 0.03 3017598/7641081 growing_herbs [300] +[171] 0.3 0.02 0.08 7641081 genrand_int31 [171] + 0.08 0.00 7641081/11253756 genrand_int32 [150] +----------------------------------------------- + 0.00 0.00 45/372173 sp_kampfzauber [957] + 0.00 0.00 580/372173 attack_firesword [785] + 0.00 0.00 1100/372173 loot_items [810] + 0.00 0.00 7313/372173 sp_dragonodem [627] + 0.03 0.07 363135/372173 select_opponent [160] +[172] 0.3 0.03 0.07 372173 select_enemy [172] + 0.01 0.05 861193/1662377 get_unitrow [154] + 0.00 0.00 372078/7641081 genrand_int31 [171] + 0.00 0.00 372173/876979 count_enemies [611] + 0.00 0.00 1405349/4301501 statusrow [550] + 0.00 0.00 372173/129167539 u_race [89] +----------------------------------------------- + 0.03 0.07 490896/490896 wage [174] +[173] 0.3 0.03 0.07 490896 default_wage [173] + 0.01 0.02 169490/184870 buildingeffsize [367] + 0.01 0.00 1041773/10190660 get_curse [143] + 0.01 0.00 733941/12246335 ct_find [114] + 0.00 0.01 490896/490901 largestbuilding [651] + 0.00 0.00 125515/71815034 get_race [12] + 0.00 0.00 396300/1106528 is_building_type [554] + 0.00 0.00 307833/51974272 a_find [65] + 0.00 0.00 615666/4201030 curse_active [543] + 0.00 0.00 490896/5152236 ct_changed [592] + 0.00 0.00 426107/508632 rule_blessed_harvest [1327] + 0.00 0.00 426107/515192 is_mourning [1392] + 0.00 0.00 426107/432940 curse_geteffect [1395] +----------------------------------------------- + 0.00 0.00 10477/490896 report_template [87] + 0.00 0.00 10979/490896 do_work [612] + 0.00 0.01 32354/490896 statistics [70] + 0.00 0.01 32670/490896 demographics [50] + 0.00 0.01 36929/490896 cr_output_region [10] + 0.00 0.04 178254/490896 immigration [294] + 0.00 0.04 189233/490896 expandwork [277] +[174] 0.3 0.00 0.10 490896 wage [174] + 0.03 0.07 490896/490896 default_wage [173] +----------------------------------------------- + 0.01 0.01 447808/1929215 create_order [341] + 0.04 0.04 1481407/1929215 parse_order [117] +[175] 0.3 0.05 0.05 1929215 create_order_i [175] + 0.02 0.03 1929215/1929215 create_data [252] + 0.00 0.00 1929215/2124526 locale_index [1354] + 0.00 0.00 1207012/11194781 keyword_disabled [1348] +----------------------------------------------- + 0.00 0.00 78/13102790 eval_weight [1102] + 0.00 0.00 108/13102790 eval_add [1182] + 0.00 0.00 124/13102790 eval_unit_dative [1076] + 0.00 0.00 326/13102790 eval_lt [539] + 0.00 0.00 604/13102790 eval_spell [961] + 0.00 0.00 834/13102790 eval_resources [907] + 0.00 0.00 1196/13102790 eval_localize [922] + 0.00 0.00 3040/13102790 eval_race [882] + 0.00 0.00 19545/13102790 eval_ship [740] + 0.00 0.00 25857/13102790 eval_int36 [729] + 0.00 0.00 40099/13102790 eval_skill [671] + 0.00 0.00 46224/13102790 eval_faction [685] + 0.00 0.00 67213/13102790 eval_building [494] + 0.00 0.00 108560/13102790 eval_trail [634] + 0.00 0.00 116804/13102790 eval_isnull [517] + 0.00 0.00 123513/13102790 eval_order [472] + 0.00 0.00 127674/13102790 eval_trailto [369] + 0.00 0.00 127788/13102790 eval_direction [608] + 0.00 0.00 515550/13102790 eval_region [245] + 0.01 0.00 799427/13102790 eval_unit [223] + 0.01 0.00 883617/13102790 eval_int [268] + 0.01 0.00 941058/13102790 eval_resource [328] + 0.01 0.00 1311128/13102790 eval_eq [398] + 0.01 0.00 1380398/13102790 translate [28] + 0.02 0.00 2530635/13102790 eval_if [393] + 0.03 0.00 3931390/13102790 parse_string [86] +[176] 0.3 0.10 0.00 13102790 opstack_pop [176] +----------------------------------------------- + 0.00 0.00 130/46391457 transliterate [358] + 0.00 0.00 248/46391457 unicode_utf8_strcasecmp [1216] + 0.00 0.00 5132/46391457 eatwhitespace_c [255] + 0.00 0.00 85158/46391457 parse_token [125] + 0.00 0.00 176717/46391457 addtoken [811] + 0.00 0.00 1232688/46391457 findtoken [501] + 0.01 0.00 6696209/46391457 eatwhite [243] + 0.08 0.00 38195175/46391457 getbuf_utf8 [72] +[177] 0.3 0.10 0.00 46391457 unicode_utf8_to_ucs4 [177] +----------------------------------------------- + 0.00 0.00 15/36653945 sp_summon_familiar [1025] + 0.00 0.00 191/36653945 follow_ship [749] + 0.00 0.00 456/36653945 display_race [963] + 0.00 0.00 527/36653945 make_movement_order [522] + 0.00 0.00 1490/36653945 eval_resources [907] + 0.00 0.00 5871/36653945 report_plaintext [4] + 0.00 0.00 7912/36653945 nr_spell_syntax [732] + 0.00 0.00 12000/36653945 nr_spell [507] + 0.00 0.00 19276/36653945 eval_trail [634] + 0.00 0.00 97114/36653945 guards [229] + 0.00 0.00 107804/36653945 report_template [87] + 0.00 0.00 216694/36653945 racename [133] + 0.00 0.00 293954/36653945 show_allies [429] + 0.00 0.00 373665/36653945 nr_building [141] + 0.00 0.00 425391/36653945 create_order [341] + 0.00 0.00 743981/36653945 nr_ship [111] + 0.00 0.00 776314/36653945 prices [85] + 0.01 0.00 1958340/36653945 spskill [53] + 0.01 0.00 3889315/36653945 get_command [108] + 0.01 0.00 4194164/36653945 describe [35] + 0.02 0.00 6078454/36653945 bufunit [17] + 0.05 0.00 17451017/36653945 strlcpy_w [67] +[178] 0.3 0.10 0.00 36653945 wrptr [178] +----------------------------------------------- + 0.03 0.01 9004040/20834979 alliedunit [31] + 0.05 0.01 11830939/20834979 alliedgroup [34] +[179] 0.3 0.08 0.02 20834979 autoalliance [179] + 0.02 0.00 20834975/20836359 f_get_alliance [455] +----------------------------------------------- + 0.00 0.00 94066/1996097 cb_cr_travelthru_unit [466] + 0.01 0.03 873836/1996097 cb_cr_travelthru_ship [204] + 0.01 0.04 1028195/1996097 cb_write_travelthru [169] +[180] 0.3 0.02 0.08 1996097 travelthru_cansee [180] + 0.02 0.05 1133822/1747682 cansee_durchgezogen [170] + 0.01 0.00 1731771/3358315 ship_owner [438] +----------------------------------------------- + 0.01 0.09 7255/7255 move_cmd [66] +[181] 0.3 0.01 0.09 7255 sail [181] + 0.00 0.03 7254/7254 ship_ready [354] + 0.02 0.01 6947/6963 move_ship [374] + 0.00 0.00 39714/300501 move_blocked [283] + 0.00 0.01 42665/252446 movewhere [350] + 0.00 0.00 39731/39810 check_ship_allowed [657] + 0.00 0.00 47093/66134 shipspeed [669] + 0.00 0.00 6947/103187 cycle_route [375] + 0.00 0.00 6947/12933 owner_buildingtyp [676] + 0.00 0.00 42665/54318 getstrtoken [710] + 0.00 0.00 7042/967784 msg_message [132] + 0.00 0.00 6947/560926 bt_find [237] + 0.00 0.00 39858/12246335 ct_find [114] + 0.00 0.00 39926/39926 check_leuchtturm [786] + 0.00 0.00 39919/7641081 genrand_int31 [171] + 0.00 0.00 39858/10190660 get_curse [143] + 0.00 0.00 7043/392959 add_message [434] + 0.00 0.00 4325/4361 can_takeoff [854] + 0.00 0.00 6947/6962 set_coast [875] + 0.00 0.00 1613/9953180 alliedunit [31] + 0.00 0.00 39858/4201030 curse_active [543] + 0.00 0.00 14510/4984610 config_get_int [348] + 0.00 0.00 7273/717218 config_get_flt [714] + 0.00 0.00 191/324 caught_target [1003] + 0.00 0.00 112/15102 cmistake [718] + 0.00 0.00 951/955 movement_error [1193] + 0.00 0.00 8/369586 r_connect [474] + 0.00 0.00 4/12320804 effskill [100] + 0.00 0.00 39909/44216 flying_ship [1465] + 0.00 0.00 39904/40692 get_gamedate [1466] + 0.00 0.00 39714/192815 add_regionlist [1419] + 0.00 0.00 7043/1009028 msg_release [1373] + 0.00 0.00 6947/1291427 set_order [1365] + 0.00 0.00 149/651711 oldcursename [1381] + 0.00 0.00 29/160 damage_ship [1641] +----------------------------------------------- + 0.00 0.09 799/799 process [7] +[182] 0.3 0.00 0.09 799 setstealth_cmd [182] + 0.01 0.08 150/150 set_factionstealth [183] + 0.00 0.00 209/40046 rule_stealth_other [530] + 0.00 0.00 1238/2281756 gettoken [195] + 0.00 0.00 231/338 findrace [1030] + 0.00 0.00 209/1481616 get_keyword [274] + 0.00 0.00 799/1027665 init_order [613] + 0.00 0.00 209/688711 atoi36 [440] + 0.00 0.00 461/1787006 findparam [458] + 0.00 0.00 150/4625636 findfaction [259] + 0.00 0.00 569/569 u_seteffstealth [1199] + 0.00 0.00 231/21345834 skill_enabled [365] + 0.00 0.00 2/12320804 effskill [100] + 0.00 0.00 59/178429 a_removeall [958] + 0.00 0.00 230/154110 rule_stealth_anon [1325] +----------------------------------------------- + 0.01 0.08 150/150 setstealth_cmd [182] +[183] 0.3 0.01 0.08 150 set_factionstealth [183] + 0.00 0.08 856373/4374788 visible_faction [68] + 0.00 0.00 109/1437425 cansee [22] + 0.00 0.00 104/51974272 a_find [65] + 0.00 0.00 2/779419 a_add [555] + 0.00 0.00 2/433 make_otherfaction [1603] +----------------------------------------------- + 0.02 0.07 313244/313244 plan_monsters [52] +[184] 0.3 0.02 0.07 313244 check_overpopulated [184] + 0.07 0.00 29944440/129167539 u_race [89] +----------------------------------------------- + 0.04 0.05 1/1 processorders [6] +[185] 0.3 0.04 0.05 1 ageing [185] + 0.02 0.01 1190908/2858912 get_effect [225] + 0.01 0.00 614764/839202 a_age [418] + 0.00 0.00 178254/178254 age_region [659] + 0.00 0.00 94865/12246335 ct_find [114] + 0.00 0.00 46184/46184 age_building [712] + 0.00 0.00 94865/10190660 get_curse [143] + 0.00 0.00 94865/4201030 curse_active [543] + 0.00 0.00 178254/1613387 rule_region_owners [1323] + 0.00 0.00 614764/1342832 handle_event [1363] + 0.00 0.00 94865/651711 oldcursename [1381] + 0.00 0.00 1/1 age_borders [1789] +----------------------------------------------- + 0.00 0.02 1841323/8452306 is_guarded [377] + 0.02 0.06 6610983/8452306 is_guard [211] +[186] 0.3 0.02 0.07 8452306 is_guardian_r [186] + 0.01 0.05 403766/771861 armedmen [151] + 0.01 0.00 8451974/8506411 besieged [547] + 0.00 0.00 3241/129167539 u_race [89] + 0.00 0.00 913774/1613387 rule_region_owners [1323] +----------------------------------------------- + 0.00 0.00 9/7120688 destroyfaction [392] + 0.00 0.00 43/7120688 plan_dragon [273] + 0.00 0.00 752/7120688 monster_attacks [248] + 0.00 0.00 11448/7120688 all_money [529] + 0.00 0.00 45033/7120688 report_template [87] + 0.00 0.00 106798/7120688 help_feed [678] + 0.00 0.00 174965/7120688 cr_output_unit [19] + 0.01 0.00 1191719/7120688 score [23] + 0.02 0.00 1543013/7120688 make_summary [21] + 0.05 0.01 4046908/7120688 get_food [88] +[187] 0.3 0.08 0.01 7120688 get_money [187] + 0.01 0.00 7120688/56052475 get_resourcetype [194] +----------------------------------------------- + 0.00 0.00 102149/50553492 cr_output_region [10] + 0.04 0.00 21341107/50553492 report_plaintext [4] + 0.05 0.00 29110236/50553492 get_addresses [20] +[188] 0.3 0.09 0.00 50553492 stealth_modifier [188] +----------------------------------------------- + 0.09 0.00 1390078/1390078 get_unitrow [154] +[189] 0.3 0.09 0.00 1390078 get_row [189] +----------------------------------------------- + 0.00 0.00 1/1248014 report_summary [614] + 0.00 0.00 1/1248014 write_planes [1207] + 0.00 0.00 232/1248014 writefaction [762] + 0.04 0.00 534764/1248014 write_game [83] + 0.05 0.00 713016/1248014 make_summary [21] +[190] 0.3 0.09 0.00 1248014 listlen [190] +----------------------------------------------- + 0.09 0.00 297222/297222 render_messages [58] +[191] 0.3 0.09 0.00 297222 fwritestr [191] +----------------------------------------------- + +[192] 0.3 0.09 0.00 qli_more [192] +----------------------------------------------- + 0.00 0.00 224/2624955 give_unit [952] + 0.00 0.00 589/2624955 study_cmd [105] + 0.00 0.00 659/2624955 can_give_men [940] + 0.00 0.00 1758/2624955 give_men [857] + 0.00 0.00 3340/2624955 recruit [650] + 0.00 0.00 5253/2624955 count_skill [868] + 0.01 0.00 187111/2624955 orc_growth [370] + 0.08 0.00 2426021/2624955 get_mage [198] +[193] 0.3 0.09 0.00 2624955 has_skill [193] +----------------------------------------------- + 0.00 0.00 1/56052475 sp_seduce [1336] + 0.00 0.00 1/56052475 plant [1184] + 0.00 0.00 1/56052475 planttrees [1206] + 0.00 0.00 1/56052475 promotion_cmd [917] + 0.00 0.00 2/56052475 breedtrees [1148] + 0.00 0.00 2/56052475 make_summary [21] + 0.00 0.00 5/56052475 set_money [1326] + 0.00 0.00 41/56052475 expandstealing [807] + 0.00 0.00 55/56052475 build_road [950] + 0.00 0.00 99/56052475 report_template [87] + 0.00 0.00 111/56052475 steal_cmd [766] + 0.00 0.00 112/56052475 give_unit [952] + 0.00 0.00 124/56052475 age_stonecircle [1021] + 0.00 0.00 174/56052475 breedhorses [742] + 0.00 0.00 251/56052475 eff_spelllevel [845] + 0.00 0.00 251/56052475 cancast [833] + 0.00 0.00 273/56052475 pay_spell [805] + 0.00 0.00 404/56052475 academy_can_teach [527] + 0.00 0.00 505/56052475 mm_smithy [1203] + 0.00 0.00 521/56052475 breed_cmd [741] + 0.00 0.00 767/56052475 spellcost [995] + 0.00 0.00 1356/56052475 build [691] + 0.00 0.00 3335/56052475 region_setresource [1097] + 0.00 0.00 3340/56052475 do_recruiting [351] + 0.00 0.00 3359/56052475 recruit [650] + 0.00 0.00 3606/56052475 gift_items [891] + 0.00 0.00 3891/56052475 make_fighter [424] + 0.00 0.00 5494/56052475 expandbuying [49] + 0.00 0.00 5877/56052475 allocate_resource [752] + 0.00 0.00 6714/56052475 region_getresource [1058] + 0.00 0.00 7957/56052475 magic_resistance [727] + 0.00 0.00 9680/56052475 bewegung_blockiert_von [631] + 0.00 0.00 15296/56052475 study_cmd [105] + 0.00 0.00 83871/56052475 reduce_weight [404] + 0.00 0.00 93119/56052475 limited_give [879] + 0.00 0.00 96621/56052475 describe [35] + 0.00 0.00 279395/56052475 weight [459] + 0.00 0.00 325282/56052475 eaten_by_monster [468] + 0.00 0.00 350742/56052475 horse_fleeing_bonus [604] + 0.00 0.00 566190/56052475 invisible [139] + 0.00 0.00 577668/56052475 canride [465] + 0.00 0.00 2599554/56052475 change_money [337] + 0.01 0.00 3502404/56052475 item_invis [149] + 0.01 0.00 7120688/56052475 get_money [187] + 0.01 0.00 9703478/56052475 get_reservation [281] + 0.02 0.00 12353561/56052475 report_item [106] + 0.03 0.00 18326296/56052475 golem_factor [265] +[194] 0.2 0.09 0.00 56052475 get_resourcetype [194] + 0.00 0.00 310783/2032164 rt_find [597] +----------------------------------------------- + 0.00 0.00 1/2281756 destroy_road [1230] + 0.00 0.00 3/2281756 claim_cmd [1242] + 0.00 0.00 6/2281756 send_cmd [1202] + 0.00 0.00 12/2281756 forget_cmd [1093] + 0.00 0.00 20/2281756 restack_units [353] + 0.00 0.00 38/2281756 destroy_cmd [1113] + 0.00 0.00 100/2281756 combatspell_cmd [898] + 0.00 0.00 179/2281756 breed_cmd [741] + 0.00 0.00 241/2281756 reshow_cmd [818] + 0.00 0.00 250/2281756 renumber_cmd [780] + 0.00 0.00 262/2281756 defaultorders [249] + 0.00 0.00 286/2281756 factionorders [983] + 0.00 0.00 348/2281756 mail_cmd [844] + 0.00 0.00 378/2281756 recruit [650] + 0.00 0.00 395/2281756 cast_cmd [760] + 0.00 0.00 639/2281756 do_enter [128] + 0.00 0.00 677/2281756 ally_cmd [877] + 0.00 0.00 754/2281756 new_units [282] + 0.00 0.00 900/2281756 use_cmd [763] + 0.00 0.00 1238/2281756 setstealth_cmd [182] + 0.00 0.00 1700/2281756 status_cmd [904] + 0.00 0.00 2013/2281756 display_cmd [859] + 0.00 0.00 3117/2281756 name_cmd [835] + 0.00 0.00 5762/2281756 buy [707] + 0.00 0.00 15176/2281756 make_cmd [383] + 0.00 0.00 31531/2281756 sell [498] + 0.00 0.00 57138/2281756 getint [699] + 0.00 0.00 69432/2281756 getparam [681] + 0.00 0.00 131765/2281756 give_control_cmd [287] + 0.00 0.00 142423/2281756 cycle_route [375] + 0.00 0.00 142776/2281756 reserve_i [213] + 0.00 0.01 209781/2281756 make_route [289] + 0.00 0.01 228907/2281756 getid [483] + 0.00 0.01 231035/2281756 give_cmd [102] + 0.00 0.01 283446/2281756 readorders [43] + 0.00 0.01 284005/2281756 read_unitid [413] + 0.00 0.01 435022/2281756 getskill [387] +[195] 0.2 0.01 0.08 2281756 gettoken [195] + 0.06 0.02 2281756/5387327 parse_token [125] +----------------------------------------------- + 0.01 0.07 301257/301257 render_messages [58] +[196] 0.2 0.01 0.07 301257 cr_render [196] + 0.03 0.01 301257/301257 crt_find [321] + 0.00 0.01 110167/110167 cr_resource [488] + 0.01 0.00 41095/41095 cr_order [489] + 0.00 0.00 133873/133873 cr_region [662] + 0.00 0.00 20072/20072 cr_skill [672] + 0.00 0.00 12407/12407 cr_regions [840] + 0.00 0.00 356/356 cr_race [949] + 0.00 0.00 210/210 cr_resources [960] + 0.00 0.00 279/279 cr_spell [1026] + 0.00 0.00 330438/330438 cr_unit [1403] + 0.00 0.00 279072/279072 cr_int [1406] + 0.00 0.00 31688/31688 cr_building [1481] + 0.00 0.00 23233/23233 cr_faction [1493] + 0.00 0.00 14994/14994 cr_string [1510] + 0.00 0.00 7153/7153 cr_ship [1530] +----------------------------------------------- + 0.00 0.00 36/10852 expandloot [816] + 0.00 0.00 41/10852 expandstealing [807] + 0.00 0.00 663/10852 expandtax [278] + 0.01 0.02 4628/10852 expandselling [93] + 0.02 0.03 5484/10852 expandbuying [49] +[197] 0.2 0.03 0.05 10852 expandorders [197] + 0.03 0.02 10846/10846 scramble [244] + 0.00 0.00 19315/1936876 free_order [1356] +----------------------------------------------- + 0.00 0.00 1/2426021 movement_speed [155] + 0.00 0.00 1/2426021 spy_message [1038] + 0.00 0.00 10/2426021 set_combatspell [1146] + 0.00 0.00 43/2426021 unset_combatspell [1167] + 0.00 0.00 226/2426021 fumble [973] + 0.00 0.00 412/2426021 teach_cmd [272] + 0.00 0.00 443/2426021 change_maxspellpoints [911] + 0.00 0.00 524/2426021 study_cmd [105] + 0.00 0.00 1201/2426021 change_spellpoints [971] + 0.00 0.00 1339/2426021 get_combatspelllevel [880] + 0.00 0.00 1717/2426021 update_spells [381] + 0.00 0.00 1873/2426021 set_spellpoints [933] + 0.00 0.00 2831/2426021 countspells [903] + 0.00 0.00 4875/2426021 get_combatspell [874] + 0.00 0.00 4915/2426021 get_spellpoints [872] + 0.00 0.00 5358/2426021 get_spchange [862] + 0.00 0.00 9493/2426021 spskill [53] + 0.00 0.01 174965/2426021 cr_output_unit [19] + 0.00 0.01 176043/2426021 faction_getmages [382] + 0.00 0.02 597806/2426021 unit_get_spellbook [427] + 0.00 0.05 1441945/2426021 is_mage [262] +[198] 0.2 0.00 0.08 2426021 get_mage [198] + 0.08 0.00 2426021/2624955 has_skill [193] + 0.00 0.00 71414/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 326/7910500 make_fighter [424] + 0.00 0.00 152504/7910500 plain_name [715] + 0.00 0.00 578591/7910500 heal_factor [619] + 0.05 0.03 7179079/7910500 rc_skillmod [140] +[199] 0.2 0.05 0.03 7910500 r_isforest [199] + 0.03 0.00 8199466/10053919 rtrees [302] +----------------------------------------------- + 0.00 0.00 18/1552289 dragon_name [1095] + 0.00 0.00 39/1552289 random_growl [1065] + 0.00 0.00 10477/1552289 report_template [87] + 0.00 0.00 77909/1552289 cr_output_region [10] + 0.01 0.02 513251/1552289 write_regionname [280] + 0.01 0.04 950595/1552289 f_regionid [161] +[200] 0.2 0.02 0.06 1552289 rname [200] + 0.02 0.02 751188/24887945 locale_string [27] + 0.00 0.02 752225/1874928 terrain_name [226] +----------------------------------------------- + 0.00 0.08 494960/494960 bufunit [17] +[201] 0.2 0.00 0.08 494960 buforder [201] + 0.01 0.04 494960/2006524 get_command [108] + 0.00 0.02 989920/17451017 strlcpy_w [67] +----------------------------------------------- + 0.00 0.00 54/13102790 eval_add [1182] + 0.00 0.00 78/13102790 eval_weight [1102] + 0.00 0.00 124/13102790 eval_unit_dative [1076] + 0.00 0.00 163/13102790 eval_lt [539] + 0.00 0.00 604/13102790 eval_spell [961] + 0.00 0.00 834/13102790 eval_resources [907] + 0.00 0.00 1196/13102790 eval_localize [922] + 0.00 0.00 1520/13102790 eval_race [882] + 0.00 0.00 19545/13102790 eval_ship [740] + 0.00 0.00 25857/13102790 eval_int36 [729] + 0.00 0.00 40099/13102790 eval_skill [671] + 0.00 0.00 46224/13102790 eval_faction [685] + 0.00 0.00 67213/13102790 eval_building [494] + 0.00 0.00 108560/13102790 eval_trail [634] + 0.00 0.00 116804/13102790 eval_isnull [517] + 0.00 0.00 123513/13102790 eval_order [472] + 0.00 0.00 127674/13102790 eval_trailto [369] + 0.00 0.00 127788/13102790 eval_direction [608] + 0.00 0.00 470529/13102790 eval_resource [328] + 0.00 0.00 515550/13102790 eval_region [245] + 0.00 0.00 655564/13102790 eval_eq [398] + 0.00 0.00 799427/13102790 eval_unit [223] + 0.01 0.00 832876/13102790 parse_int [649] + 0.01 0.00 843545/13102790 eval_if [393] + 0.01 0.00 883617/13102790 eval_int [268] + 0.02 0.00 2725583/13102790 parse_string [86] + 0.03 0.00 4568249/13102790 parse_symbol [42] +[202] 0.2 0.08 0.00 13102790 opstack_push [202] +----------------------------------------------- + 0.03 0.00 2506526/7252744 ql_set_find_ex [373] + 0.05 0.00 4746218/7252744 ql_set_insert_ex [156] +[203] 0.2 0.08 0.00 7252744 cmp_transfer [203] +----------------------------------------------- + 0.02 0.06 967902/967902 travelthru_map [41] +[204] 0.2 0.02 0.06 967902 cb_cr_travelthru_ship [204] + 0.01 0.03 873836/1996097 travelthru_cansee [180] + 0.00 0.02 434165/1065211 shipname [290] +----------------------------------------------- + 0.00 0.00 16/282847 spy_cmd [990] + 0.00 0.00 65/282847 travel_i [92] + 0.00 0.00 70/282847 transport [1011] + 0.00 0.00 145/282847 init_transportation [384] + 0.00 0.00 1487/282847 start_battle [297] + 0.00 0.00 17577/282847 teach_cmd [272] + 0.00 0.04 131722/282847 give_cmd [102] + 0.00 0.04 131765/282847 give_control_cmd [287] +[205] 0.2 0.00 0.08 282847 getunit [205] + 0.00 0.06 282468/888603 findunit [123] + 0.00 0.02 282847/284005 read_unitid [413] +----------------------------------------------- + 0.00 0.02 174965/773191 cr_output_unit [19] + 0.00 0.06 598226/773191 bufunit [17] +[206] 0.2 0.00 0.08 773191 hp_status [206] + 0.01 0.07 773191/1381157 unit_max_hp [136] + 0.00 0.00 8974/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 19276/785221 eval_trail [634] + 0.00 0.01 127674/785221 eval_trailto [369] + 0.00 0.06 638271/785221 describe [35] +[207] 0.2 0.00 0.08 785221 trailinto [207] + 0.02 0.02 785221/24887945 locale_string [27] + 0.00 0.02 785221/1874928 terrain_name [226] + 0.01 0.00 785221/34611296 strlcpy [45] + 0.00 0.00 785221/987128 strlcat [1374] +----------------------------------------------- + 0.00 0.08 607926/607926 write_unit [97] +[208] 0.2 0.00 0.08 607926 writeorder [208] + 0.01 0.07 607926/1470505 write_order [121] +----------------------------------------------- + 0.00 0.08 178254/178254 read_game [62] +[209] 0.2 0.00 0.08 178254 readregion [209] + 0.00 0.05 178254/178254 new_region [275] + 0.01 0.00 32679/32727 rsetherbtype [537] + 0.00 0.01 178254/459083 findregion [420] + 0.00 0.01 178254/840577 read_attribs [388] + 0.00 0.00 178254/1206547 findplane [457] + 0.00 0.00 32679/628037 read_items [320] + 0.00 0.00 32679/264251 rsetpeasants [545] + 0.00 0.00 249361/2032164 rt_find [597] + 0.00 0.00 32679/2186159 rsetmoney [553] + 0.00 0.00 217392/217405 r_setdemand [1413] + 0.00 0.00 178254/178311 region_setinfo [1422] + 0.00 0.00 178254/178270 get_terrain [1423] + 0.00 0.00 98037/229715 rsettrees [1410] + 0.00 0.00 32679/257693 rsethorses [1408] + 0.00 0.00 32679/101322 rsetherbs [1438] + 0.00 0.00 32679/32727 region_set_morale [1476] + 0.00 0.00 32679/32679 read_owner [1477] + 0.00 0.00 25441/25441 rmt_find [1490] +----------------------------------------------- + 0.03 0.01 45630/108211 cr_output_resources [238] + 0.03 0.01 62581/108211 describe [35] +[210] 0.2 0.06 0.02 108211 report_resources [210] + 0.01 0.01 207188/12320804 effskill [100] + 0.00 0.00 182290/10053919 rtrees [302] + 0.00 0.00 91145/2605004 rpeasants [435] + 0.00 0.00 91145/4666665 rmoney [452] + 0.00 0.00 59445/9298667 resource2item [546] + 0.00 0.00 348444/348444 report_resource [1402] + 0.00 0.00 91145/1160345 rhorses [1369] + 0.00 0.00 7915/7915 visible_default [1525] +----------------------------------------------- + 0.00 0.00 3/6610983 destroy_road [1230] + 0.00 0.00 10/6610983 get_money_for_dragon [1087] + 0.00 0.00 6102/6610983 make_side [876] + 0.00 0.00 11880/6610983 cansee_unit [684] + 0.00 0.00 12762/6610983 plan_monsters [52] + 0.00 0.00 36821/6610983 allocate_resource [752] + 0.00 0.00 63046/6610983 is_guardian_u [626] + 0.00 0.00 216875/6610983 bewegung_blockiert_von [631] + 0.00 0.01 923633/6610983 cr_output_unit [19] + 0.00 0.01 1211531/6610983 cansee [22] + 0.00 0.02 1348743/6610983 bufunit [17] + 0.00 0.02 1384664/6610983 guards [229] + 0.00 0.02 1394913/6610983 cansee_durchgezogen [170] +[211] 0.2 0.00 0.08 6610983 is_guard [211] + 0.02 0.06 6610983/8452306 is_guardian_r [186] + 0.00 0.01 329691/329691 getguard [652] +----------------------------------------------- + 0.00 0.00 15/47902 overload [1002] + 0.02 0.00 10344/47902 cansail [469] + 0.03 0.00 18693/47902 nr_ship [111] + 0.03 0.00 18850/47902 cr_output_ship [152] +[212] 0.2 0.07 0.00 47902 getshipweight [212] + 0.00 0.00 70174/279395 weight [459] +----------------------------------------------- + 0.00 0.04 35708/71416 reserve_cmd [324] + 0.00 0.04 35708/71416 reserve_self [325] +[213] 0.2 0.00 0.07 71416 reserve_i [213] + 0.01 0.05 71328/860263 use_pooled [39] + 0.00 0.00 142776/2281756 gettoken [195] + 0.00 0.00 68977/931076 change_resource [240] + 0.00 0.00 31520/57138 getint [699] + 0.00 0.00 71388/1787006 findparam [458] + 0.00 0.00 71388/1027665 init_order [613] + 0.00 0.00 71364/191379 finditemtype [735] + 0.00 0.00 71390/7417541 urace [436] + 0.00 0.00 4/8302761 get_resource [99] + 0.00 0.00 140305/140305 set_resvalue [1430] + 0.00 0.00 71388/203117 atoip [1416] +----------------------------------------------- + 7179079 get_modifier [55] + 0.00 0.00 377/12320804 manufacture [759] + 0.00 0.00 1705/12320804 build [691] + 0.00 0.01 116873/12320804 weapon_effskill [168] +[214] 0.2 0.01 0.06 7298034 skillmod [214] + 0.06 0.00 7298034/51974272 a_find [65] + 0.00 0.00 8/8 mod_elves_only [1239] + 0.00 0.00 248/248 sm_smithy [1613] + 65155 sm_familiar [520] +----------------------------------------------- + 0.00 0.07 1/1 process [7] +[215] 0.2 0.00 0.07 1 monthly_healing [215] + 0.00 0.06 595454/1381157 unit_max_hp [136] + 0.00 0.01 578591/578591 heal_factor [619] + 0.00 0.00 595144/129167539 u_race [89] + 0.00 0.00 91176/10190660 get_curse [143] + 0.00 0.00 5206/560926 bt_find [237] + 0.00 0.00 7542/47287 canswim [682] + 0.00 0.00 5206/424669 active_building [560] + 0.00 0.00 2988/752645 chance [495] + 0.00 0.00 1/12246335 ct_find [114] +----------------------------------------------- + +[216] 0.2 0.07 0.00 bin_r_str_buf [216] +----------------------------------------------- + 0.00 0.00 2/760673 new_ship [1229] + 0.00 0.00 13/760673 read_planes [1164] + 0.00 0.00 17/760673 recruit_dracoids [837] + 0.00 0.00 42/760673 loot_cmd [873] + 0.00 0.00 59/760673 steal_cmd [766] + 0.00 0.00 232/760673 defaultorders [249] + 0.00 0.00 406/760673 faction_setorigin [979] + 0.00 0.00 736/760673 monster_attacks [248] + 0.00 0.00 948/760673 tax_cmd [697] + 0.00 0.00 1670/760673 recruit [650] + 0.00 0.00 2889/760673 move_unit [421] + 0.00 0.00 2889/760673 create_unit [296] + 0.00 0.00 5757/760673 buy [707] + 0.00 0.00 7630/760673 addstrlist [769] + 0.00 0.00 12520/760673 sell [498] + 0.01 0.00 113844/760673 translist [430] + 0.02 0.00 178254/760673 new_region [275] + 0.04 0.00 432765/760673 plan_monsters [52] +[217] 0.2 0.07 0.00 760673 addlist [217] +----------------------------------------------- + +[218] 0.2 0.07 0.00 bin_w_int_pak [218] +----------------------------------------------- + 0.00 0.00 45/2247 count_migrants [731] + 0.01 0.00 481/2247 count_units [487] + 0.02 0.00 754/2247 checkunitnumber [402] + 0.03 0.00 967/2247 count_all [357] +[219] 0.2 0.06 0.01 2247 count_faction [219] + 0.01 0.00 3891194/129167539 u_race [89] + 0.00 0.00 2815/12246335 ct_find [114] + 0.00 0.00 2815/10190660 get_curse [143] + 0.00 0.00 2815/4201030 curse_active [543] + 0.00 0.00 2815/651711 oldcursename [1381] +----------------------------------------------- + 0.00 0.02 560985/2066777 create_data [252] + 0.00 0.05 1505792/2066777 parse_order [117] +[220] 0.2 0.00 0.07 2066777 parse_token_depr [220] + 0.05 0.02 2066777/5387327 parse_token [125] +----------------------------------------------- + 0.00 0.01 56927/546579 make_fighter [424] + 0.01 0.05 489652/546579 weapon_effskill [168] +[221] 0.2 0.01 0.06 546579 weapon_skill [221] + 0.02 0.02 551693/12320804 effskill [100] + 0.00 0.01 236296/71815034 get_race [12] + 0.01 0.00 2284/3147 i_canuse [569] + 0.00 0.00 1555209/129167539 u_race [89] +----------------------------------------------- + 0.00 0.02 923633/2275429 cr_output_unit [19] + 0.01 0.03 1351796/2275429 racename [133] +[222] 0.2 0.01 0.06 2275429 raceprefix [222] + 0.03 0.02 2275429/2277350 get_prefix [263] + 0.01 0.00 847828/51974272 a_find [65] +----------------------------------------------- + 0.01 0.06 799427/799427 parse_symbol [42] +[223] 0.2 0.01 0.06 799427 eval_unit [223] + 0.00 0.04 799425/2383101 unitname [142] + 0.01 0.00 799427/13102790 opstack_pop [176] + 0.00 0.00 799427/13102790 opstack_push [202] + 0.00 0.00 799427/13399069 balloc [363] + 0.00 0.00 2/24887945 locale_string [27] +----------------------------------------------- + 0.00 0.00 1/20777534 parse_inifile [1317] + 0.00 0.00 2/20777534 init_locale [948] + 0.00 0.00 2/20777534 default_order [902] + 0.00 0.00 73/20777534 hunger_damage [1223] + 0.00 0.00 279/20777534 MagicPower [1195] + 0.00 0.00 462/20777534 game_name [1168] + 0.00 0.00 1297/20777534 AllianceAuto [535] + 0.00 0.00 16597/20777534 entertain_cmd [665] + 0.01 0.02 10375461/20777534 AllianceRestricted [164] + 0.01 0.02 10383360/20777534 HelpMask [288] +[224] 0.2 0.02 0.05 20777534 config_get [224] + 0.05 0.00 20777534/26776263 get_param [235] +----------------------------------------------- + 0.00 0.00 4/2858912 damage_unit [1044] + 0.00 0.00 11/2858912 build_road [950] + 0.00 0.00 1230/2858912 build [691] + 0.00 0.00 1297/2858912 make_fighter [424] + 0.00 0.00 2938/2858912 allocate_resource [752] + 0.00 0.00 5384/2858912 teach_cmd [272] + 0.00 0.00 43034/2858912 get_food [88] + 0.00 0.00 85655/2858912 movement_speed [155] + 0.00 0.00 96637/2858912 walkingcapacity [403] + 0.01 0.01 595472/2858912 live [73] + 0.01 0.01 836342/2858912 study_cmd [105] + 0.02 0.01 1190908/2858912 ageing [185] +[225] 0.2 0.04 0.02 2858912 get_effect [225] + 0.02 0.00 2858912/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 234/1874928 travel_route [147] + 0.00 0.00 127676/1874928 describe [35] + 0.00 0.01 209572/1874928 cr_output_region [10] + 0.00 0.02 752225/1874928 rname [200] + 0.00 0.02 785221/1874928 trailinto [207] +[226] 0.2 0.01 0.05 1874928 terrain_name [226] + 0.02 0.00 1174371/12246335 ct_find [114] + 0.01 0.00 1174371/10190660 get_curse [143] + 0.01 0.00 1646640/51974272 a_find [65] + 0.00 0.00 1174371/4201030 curse_active [543] + 0.00 0.00 152504/152504 plain_name [715] +----------------------------------------------- + 0.00 0.00 127/1010116 msg_create_message [1080] + 0.00 0.00 957/1010116 parse_messages [832] + 0.00 0.00 41248/1010116 msg_feedback [647] + 0.04 0.02 967784/1010116 msg_message [132] +[227] 0.2 0.04 0.02 1010116 mt_find [227] + 0.02 0.00 1010116/32337529 hashstring [37] +----------------------------------------------- + 0.00 0.00 6/1009159 msg_send_region [1210] + 0.00 0.00 121/1009159 msg_send_faction [1042] + 0.00 0.00 41248/1009159 msg_feedback [647] + 0.00 0.06 967784/1009159 msg_message [132] +[228] 0.2 0.00 0.06 1009159 msg_create [228] + 0.01 0.04 1009159/1009159 log_orders [251] + 0.01 0.00 2481220/2481220 copy_arg [521] +----------------------------------------------- + 0.02 0.04 62581/62581 report_plaintext [4] +[229] 0.2 0.02 0.04 62581 guards [229] + 0.00 0.02 1384664/6610983 is_guard [211] + 0.01 0.00 27498/2742237 paragraph [26] + 0.00 0.01 67332/4374788 visible_faction [68] + 0.00 0.00 60360/24887945 locale_string [27] + 0.00 0.00 97114/34611296 strlcpy [45] + 0.00 0.00 34482/1295787 factionname [247] + 0.00 0.00 97114/36653945 wrptr [178] + 0.00 0.00 27498/2494242 newline [594] +----------------------------------------------- + 0.00 0.06 595478/595478 process [7] +[230] 0.2 0.00 0.06 595478 monster_kills_peasants [230] + 0.01 0.02 325825/325825 scared_by_monster [380] + 0.01 0.01 325282/325282 eaten_by_monster [468] + 0.01 0.00 595478/1121103 monster_is_waiting [407] + 0.00 0.00 1469625/129167539 u_race [89] + 0.00 0.00 11540/11540 absorbed_by_monster [804] +----------------------------------------------- + 0.02 0.04 1054200/1054200 travelthru_map [41] +[231] 0.2 0.02 0.04 1054200 count_cb [231] + 0.01 0.03 613860/1747682 cansee_durchgezogen [170] + 0.01 0.00 875741/3358315 ship_owner [438] +----------------------------------------------- + 0.00 0.00 1/593636 give_control_cmd [287] + 0.00 0.00 1/593636 display_cmd [859] + 0.00 0.00 3/593636 try_rename [1225] + 0.00 0.00 5/593636 name_cmd [835] + 0.00 0.00 6/593636 bewegung_blockiert_von [631] + 0.00 0.00 6/593636 restack_units [353] + 0.00 0.00 26/593636 renumber_cmd [780] + 0.00 0.00 401/593636 mayenter [936] + 0.00 0.00 8710/593636 maintain_buildings [339] + 0.00 0.00 9465/593636 expandselling [93] + 0.00 0.00 11409/593636 lighthouse_range [728] + 0.00 0.00 12521/593636 report_template [87] + 0.00 0.00 21463/593636 maintain [478] + 0.00 0.00 28665/593636 owner_buildingtyp [676] + 0.00 0.00 37894/593636 reorder_units [400] + 0.00 0.00 47440/593636 write_unit [97] + 0.00 0.01 92368/593636 score [23] + 0.00 0.01 104830/593636 cr_output_curses [69] + 0.00 0.01 104830/593636 cr_output_region [10] + 0.00 0.01 113592/593636 nr_curses [48] +[232] 0.2 0.01 0.05 593636 building_owner [232] + 0.05 0.00 209480/209572 building_owner_ex [253] +----------------------------------------------- + 0.00 0.00 39/13259934 display_item [1054] + 0.00 0.00 352/13259934 cr_resources [960] + 0.00 0.00 446/13259934 print_items [938] + 0.00 0.00 628/13259934 add_itemname_cb [980] + 0.00 0.00 648/13259934 add_resourcename_cb [977] + 0.00 0.00 1490/13259934 eval_resources [907] + 0.00 0.00 1539/13259934 report_plaintext [4] + 0.00 0.00 1543/13259934 make_cmd [383] + 0.00 0.00 1876/13259934 report_computer [9] + 0.00 0.00 2073/13259934 cr_output_curses [69] + 0.00 0.00 2096/13259934 a_writeeffect [1073] + 0.00 0.00 3203/13259934 cr_reportspell [756] + 0.00 0.00 3203/13259934 nr_spell [507] + 0.00 0.00 96621/13259934 describe [35] + 0.00 0.00 110167/13259934 cr_resource [488] + 0.00 0.00 169153/13259934 statistics [70] + 0.00 0.00 218078/13259934 cr_output_region [10] + 0.00 0.00 249352/13259934 writeregion [519] + 0.00 0.00 448410/13259934 write_items [511] + 0.00 0.00 470529/13259934 eval_resource [328] + 0.05 0.00 11478488/13259934 report_item [106] +[233] 0.2 0.06 0.00 13259934 resourcename [233] +----------------------------------------------- + 0.00 0.00 493/1826688 report_computer [9] + 0.00 0.00 7499/1826688 cr_regions [840] + 0.00 0.00 10477/1826688 report_template [87] + 0.00 0.00 132705/1826688 cr_region [662] + 0.01 0.00 211668/1826688 cr_output_region [10] + 0.02 0.00 513251/1826688 write_regionname [280] + 0.03 0.00 950595/1826688 f_regionid [161] +[234] 0.2 0.06 0.00 1826688 adjust_coordinates [234] + 0.00 0.00 1785077/1785077 faction_getorigin [1357] + 0.00 0.00 221718/221723 plane_center_x [1411] + 0.00 0.00 221718/221723 plane_center_y [1412] + 0.00 0.00 221718/734392 plane_width [1380] + 0.00 0.00 221718/734392 plane_height [1379] +----------------------------------------------- + 0.00 0.00 88/26776263 hunger_damage [1223] + 0.00 0.00 216069/26776263 check_param [793] + 0.00 0.00 717287/26776263 get_param_flt [713] + 0.01 0.00 5065285/26776263 get_param_int [422] + 0.05 0.00 20777534/26776263 config_get [224] +[235] 0.2 0.06 0.00 26776263 get_param [235] +----------------------------------------------- + 0.00 0.00 39/560965 bt_get_or_create [1114] + 0.06 0.00 560926/560965 bt_find [237] +[236] 0.2 0.06 0.00 560965 bt_find_i [236] +----------------------------------------------- + 0.00 0.00 1/560926 buy [707] + 0.00 0.00 1/560926 breedhorses [742] + 0.00 0.00 1/560926 produce [29] + 0.00 0.00 1/560926 demographics [50] + 0.00 0.00 1/560926 wormholes_update [906] + 0.00 0.00 2/560926 sell [498] + 0.00 0.00 3/560926 expandselling [93] + 0.00 0.00 5/560926 build_road [950] + 0.00 0.00 6/560926 remove_building [1153] + 0.00 0.00 232/560926 prepare_report [8] + 0.00 0.00 322/560926 can_takeoff [854] + 0.00 0.00 1302/560926 academy_can_teach [527] + 0.00 0.00 5206/560926 monthly_healing [215] + 0.00 0.00 6947/560926 sail [181] + 0.00 0.00 9680/560926 bewegung_blockiert_von [631] + 0.00 0.00 31155/560926 statistics [70] + 0.00 0.00 39810/560926 check_ship_allowed [657] + 0.00 0.00 46176/560926 read_game [62] + 0.00 0.04 420075/560926 study_cmd [105] +[237] 0.2 0.00 0.06 560926 bt_find [237] + 0.06 0.00 560926/560965 bt_find_i [236] +----------------------------------------------- + 0.00 0.06 45630/45630 cr_output_region [10] +[238] 0.2 0.00 0.06 45630 cr_output_resources [238] + 0.03 0.01 45630/108211 report_resources [210] + 0.00 0.03 174677/174677 cr_output_resource [378] + 0.00 0.00 91260/10053919 rtrees [302] + 0.00 0.00 3232/4488684 crtag [110] +----------------------------------------------- + 0.00 0.06 104830/104830 cr_output_region [10] +[239] 0.2 0.00 0.06 104830 cr_output_building [239] + 0.00 0.03 104830/386740 cr_output_curses_compat [144] + 0.00 0.01 104830/218422 report_building [397] + 0.00 0.01 104830/4434556 translate [75] + 0.00 0.00 104830/24887945 locale_string [27] +----------------------------------------------- + 0.00 0.00 12/931076 reduce_weight [404] + 0.00 0.00 68977/931076 reserve_i [213] + 0.00 0.05 862087/931076 use_pooled [39] +[240] 0.2 0.00 0.06 931076 change_resource [240] + 0.00 0.03 931076/8302761 get_resource [99] + 0.00 0.02 930757/9232125 res_changeitem [101] + 0.00 0.00 86/443 res_changepermaura [912] + 0.00 0.00 216/1199 res_changeaura [972] + 0.00 0.00 15/15 res_changepeasants [1200] + 0.00 0.00 2/2 res_changehp [1779] +----------------------------------------------- + 0.03 0.03 1/1 randomevents [91] +[241] 0.2 0.03 0.03 1 dissolve_units [241] + 0.00 0.02 1/6 remove_empty_units [146] + 0.01 0.00 595476/51974272 a_find [65] + 0.00 0.00 2126/7641081 genrand_int31 [171] + 0.00 0.00 41/967784 msg_message [132] + 0.00 0.00 41/392959 add_message [434] + 0.00 0.00 19/264251 rsetpeasants [545] + 0.00 0.00 41/3178 scale_number [969] + 0.00 0.00 19/2605004 rpeasants [435] + 0.00 0.00 4/71815034 get_race [12] + 0.00 0.00 45/129167539 u_race [89] + 0.00 0.00 20/10053919 rtrees [302] + 0.00 0.00 41/1009028 msg_release [1373] + 0.00 0.00 20/229715 rsettrees [1410] +----------------------------------------------- + 0.00 0.00 45/80630 sp_kampfzauber [957] + 0.00 0.00 580/80630 attack_firesword [785] + 0.00 0.00 7313/80630 sp_dragonodem [627] + 0.00 0.05 72692/80630 attack [84] +[242] 0.2 0.00 0.05 80630 terminate [242] + 0.00 0.01 153322/860166 weapon_effskill [168] + 0.00 0.02 100532/146997 dice_rand [409] + 0.00 0.00 154155/71815034 get_race [12] + 0.00 0.01 80630/80630 calculate_armor [645] + 0.00 0.00 10897/25088 kill_troop [532] + 0.00 0.00 17117/137709 CavalryBonus [491] + 0.00 0.00 92981/752645 chance [495] + 0.00 0.00 475770/129167539 u_race [89] + 0.00 0.00 39357/1474687 leftship [500] + 0.00 0.00 10900/5395063 i_get [130] + 0.00 0.00 72692/72692 rc_specialdamage [830] + 0.00 0.00 13338/7641081 genrand_int31 [171] + 0.00 0.00 3221/11241829 i_change [115] + 0.00 0.00 52/1381157 unit_max_hp [136] + 0.00 0.00 4/967784 msg_message [132] + 0.00 0.00 4/31214 message_faction [716] + 0.00 0.00 148748/1218663 select_weapon [1367] + 0.00 0.00 80630/1726748 is_riding [1358] + 0.00 0.00 4/1009028 msg_release [1373] +----------------------------------------------- + 0.04 0.01 6241702/6241702 getbuf_utf8 [72] +[243] 0.2 0.04 0.01 6241702 eatwhite [243] + 0.01 0.00 6696209/46391457 unicode_utf8_to_ucs4 [177] +----------------------------------------------- + 0.03 0.02 10846/10846 expandorders [197] +[244] 0.2 0.03 0.02 10846 scramble [244] + 0.02 0.00 2276433/11253756 genrand_int32 [150] +----------------------------------------------- + 0.00 0.05 515550/515550 parse_symbol [42] +[245] 0.2 0.00 0.05 515550 eval_region [245] + 0.00 0.05 515550/515911 write_regionname [280] + 0.00 0.00 515550/13102790 opstack_pop [176] + 0.00 0.00 515550/13102790 opstack_push [202] + 0.00 0.00 515550/13399069 balloc [363] +----------------------------------------------- + 0.03 0.02 1/1 randomevents [91] +[246] 0.2 0.03 0.02 1 demon_skillchanges [246] + 0.00 0.02 595476/71815034 get_race [12] + 0.00 0.00 595476/129167539 u_race [89] + 0.00 0.00 2148/2148 demon_skillchange [826] +----------------------------------------------- + 0.00 0.00 4/1295787 checkpasswd [1268] + 0.00 0.00 5/1295787 tolua_faction_tostring [1257] + 0.00 0.00 230/1295787 report_plaintext [4] + 0.00 0.00 232/1295787 write_reports [3] + 0.00 0.00 251/1295787 out_faction [615] + 0.00 0.00 3111/1295787 sidename [867] + 0.00 0.00 10794/1295787 list_address [635] + 0.00 0.00 34482/1295787 guards [229] + 0.00 0.00 46224/1295787 eval_faction [685] + 0.00 0.00 55330/1295787 show_allies [429] + 0.00 0.05 1145124/1295787 bufunit [17] +[247] 0.2 0.00 0.05 1295787 factionname [247] + 0.00 0.05 1295787/5100840 itoa36 [116] + 0.00 0.00 1295787/5461936 slprintf [548] +----------------------------------------------- + 0.00 0.00 10/160206 get_money_for_dragon [1087] + 0.04 0.01 160196/160206 plan_monsters [52] +[248] 0.1 0.04 0.01 160206 monster_attacks [248] + 0.01 0.00 11080/1437425 cansee [22] + 0.00 0.00 752/752 monster_attack [764] + 0.00 0.00 736/760673 addlist [217] + 0.00 0.00 752/7120688 get_money [187] + 0.00 0.00 1042/1042 in_safe_building [1585] +----------------------------------------------- + 0.03 0.02 1/1 process [7] +[249] 0.1 0.03 0.02 1 defaultorders [249] + 0.01 0.00 1131212/55492327 getkeyword [54] + 0.00 0.01 524/524 remove_exclusive [571] + 0.00 0.00 232/1481407 parse_order [117] + 0.00 0.00 232/760673 addlist [217] + 0.00 0.00 262/2281756 gettoken [195] + 0.00 0.00 262/1027665 init_order [613] + 0.00 0.00 262/1936876 free_order [1356] + 0.00 0.00 1/11194781 keyword_disabled [1348] +----------------------------------------------- + 0.04 0.01 178254/178254 process [7] +[250] 0.1 0.04 0.01 178254 do_contact [250] + 0.01 0.00 1133099/55492327 getkeyword [54] + 0.00 0.00 147/147 contact_cmd [965] +----------------------------------------------- + 0.01 0.04 1009159/1009159 msg_create [228] +[251] 0.1 0.01 0.04 1009159 log_orders [251] + 0.00 0.04 41255/1380398 nr_render [25] + 0.00 0.00 41255/3780355 nr_section [113] + 0.00 0.00 41255/49235 log_debug [1245] +----------------------------------------------- + 0.02 0.03 1929215/1929215 create_order_i [175] +[252] 0.1 0.02 0.03 1929215 create_data [252] + 0.00 0.02 560985/2066777 parse_token_depr [220] + 0.01 0.01 560985/996009 get_skill [423] + 0.00 0.00 58/2934859 skillname [122] + 0.00 0.00 1252028/1252028 mkdata [1366] +----------------------------------------------- + 0.00 0.00 92/209572 building_update_owner [1010] + 0.05 0.00 209480/209572 building_owner [232] +[253] 0.1 0.05 0.00 209572 building_owner_ex [253] + 0.00 0.00 209544/216069 config_token [794] +----------------------------------------------- + 0.05 0.00 96482/96482 travel_i [92] +[254] 0.1 0.05 0.00 96482 get_followers [254] + 0.00 0.00 2822/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 22778/5329742 parser_end [849] + 0.05 0.00 5306964/5329742 parse_token [125] +[255] 0.1 0.05 0.00 5329742 eatwhitespace_c [255] + 0.00 0.00 5132/46391457 unicode_utf8_to_ucs4 [177] +----------------------------------------------- + 0.00 0.00 150/12560453 is_migrant [1047] + 0.00 0.00 230/12560453 report_computer [9] + 0.00 0.00 298/12560453 plan_dragon [273] + 0.00 0.00 410/12560453 rc_specialdamage [830] + 0.00 0.00 14447/12560453 heal_factor [619] + 0.00 0.00 16132/12560453 magic_lowskill [897] + 0.00 0.00 377253/12560453 guard_flags [690] + 0.00 0.00 469309/12560453 rc_skillmod [140] + 0.02 0.00 4503145/12560453 omniscient [470] + 0.03 0.00 7179079/12560453 skill_mod [264] +[256] 0.1 0.05 0.00 12560453 rc_changed [256] +----------------------------------------------- + 0.00 0.00 1/2868601 use_bloodpotion [935] + 0.00 0.00 3/2868601 trigger_changerace [1297] + 0.01 0.00 596221/2868601 write_unit [97] + 0.02 0.00 923633/2868601 cr_output_unit [19] + 0.02 0.00 1348743/2868601 bufunit [17] +[257] 0.1 0.05 0.00 2868601 u_irace [257] +----------------------------------------------- + +[258] 0.1 0.05 0.00 qli_init [258] +----------------------------------------------- + 0.00 0.00 4/4625636 mailfaction [1106] + 0.00 0.00 12/4625636 tolua_faction_get [1246] + 0.00 0.00 150/4625636 setstealth_cmd [182] + 0.00 0.00 233/4625636 readfaction [767] + 0.00 0.00 287/4625636 factionorders [983] + 0.00 0.00 791/4625636 getfaction [937] + 0.00 0.00 5925/4625636 addally [913] + 0.00 0.00 30872/4625636 resolve_faction [820] + 0.00 0.00 39836/4625636 read_of [524] + 0.00 0.00 49522/4625636 read_groups [782] + 0.00 0.01 595125/4625636 read_unit [74] + 0.01 0.03 3902879/4625636 get_or_create_monsters [292] +[259] 0.1 0.01 0.04 4625636 findfaction [259] + 0.04 0.00 4625636/4625636 ffindhash [315] +----------------------------------------------- + 0.00 0.00 10/2818494 spawn_dragons [411] + 0.00 0.00 47/2818494 display_race [963] + 0.00 0.00 71/2818494 report_summary [614] + 0.00 0.00 92/2818494 spawn_undead [629] + 0.00 0.00 230/2818494 report_computer [9] + 0.00 0.00 230/2818494 report_plaintext [4] + 0.00 0.00 251/2818494 out_faction [615] + 0.00 0.00 272/2818494 init_locale [948] + 0.00 0.00 356/2818494 cr_race [949] + 0.00 0.00 666/2818494 generic_name [962] + 0.00 0.00 1520/2818494 eval_race [882] + 0.00 0.01 537193/2818494 unit_getname [332] + 0.01 0.01 925760/2818494 cr_output_unit [19] + 0.01 0.01 1351796/2818494 racename [133] +[260] 0.1 0.02 0.03 2818494 rc_name_s [260] + 0.03 0.00 2818494/2818494 rc_name [364] +----------------------------------------------- + 0.00 0.00 2/4133717 b_namequestportal [1279] + 0.00 0.00 10/4133717 init_locale [948] + 0.00 0.00 18/4133717 parse_calendar [1252] + 0.00 0.00 44/4133717 curse_name [1140] + 0.00 0.00 47/4133717 display_item [1054] + 0.00 0.00 58/4133717 skill_key [1205] + 0.00 0.00 61/4133717 json_keyword [1127] + 0.00 0.00 86/4133717 display_race [963] + 0.00 0.00 140/4133717 nr_spell_syntax [732] + 0.00 0.00 464/4133717 report_computer [9] + 0.00 0.00 567/4133717 report_plaintext [4] + 0.00 0.00 1088/4133717 spskill [53] + 0.00 0.00 1911/4133717 cinfo_magicresistance [824] + 0.00 0.00 2081/4133717 cr_reportspell [756] + 0.00 0.00 2252/4133717 cinfo_ship [812] + 0.00 0.00 4162/4133717 spell_info [841] + 0.00 0.00 5907/4133717 cinfo_simple [751] + 0.00 0.00 8974/4133717 hp_status [206] + 0.00 0.00 15359/4133717 cinfo_building [686] + 0.00 0.00 20072/4133717 cr_skill [672] + 0.00 0.00 33909/4133717 cr_output_spells [639] + 0.00 0.00 86400/4133717 spell_name [646] + 0.00 0.00 93450/4133717 b_nameroad [642] + 0.00 0.00 97017/4133717 cr_borders [135] + 0.00 0.00 108347/4133717 racename [133] + 0.00 0.01 716432/4133717 cr_output_unit [19] + 0.01 0.03 2934859/4133717 skillname [122] +[261] 0.1 0.01 0.04 4133717 mkname [261] + 0.04 0.00 4133717/4136059 mkname_buf [316] +----------------------------------------------- + 0.00 0.00 87/1441945 age_stonecircle [1021] + 0.00 0.00 91/1441945 study_cmd [105] + 0.00 0.00 75870/1441945 movement_speed [155] + 0.00 0.01 174965/1441945 cr_output_unit [19] + 0.00 0.02 595454/1441945 regenerate_aura [346] + 0.00 0.02 595478/1441945 magic [157] +[262] 0.1 0.00 0.05 1441945 is_mage [262] + 0.00 0.05 1441945/2426021 get_mage [198] +----------------------------------------------- + 0.00 0.00 1921/2277350 report_computer [9] + 0.03 0.02 2275429/2277350 raceprefix [222] +[263] 0.1 0.03 0.02 2277350 get_prefix [263] + 0.02 0.00 2277350/51974272 a_find [65] +----------------------------------------------- + 0.02 0.03 7179079/7179079 rc_skillmod [140] +[264] 0.1 0.02 0.03 7179079 skill_mod [264] + 0.03 0.00 7179079/12560453 rc_changed [256] + 0.00 0.00 2/71815034 get_race [12] + 0.00 0.00 722366/1511812 newterrain [1359] +----------------------------------------------- + 0.02 0.03 9163148/9163148 res_changeitem [101] +[265] 0.1 0.02 0.03 9163148 golem_factor [265] + 0.03 0.00 18326296/56052475 get_resourcetype [194] + 0.00 0.00 45992/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 39/779486 display_item [1054] + 0.00 0.00 47/779486 display_race [963] + 0.00 0.00 58/779486 dragon_name [1095] + 0.00 0.00 117/779486 count_particles [1089] + 0.00 0.00 407/779486 make_name [970] + 0.03 0.02 778818/779486 describe_race [267] +[266] 0.1 0.03 0.02 779486 locale_getstring [266] + 0.02 0.00 779486/32337529 hashstring [37] +----------------------------------------------- + 0.00 0.02 379049/778818 read_unit [74] + 0.00 0.02 399769/778818 u_description [347] +[267] 0.1 0.00 0.05 778818 describe_race [267] + 0.03 0.02 778818/779486 locale_getstring [266] +----------------------------------------------- + 0.00 0.05 883617/883617 parse_symbol [42] +[268] 0.1 0.00 0.05 883617 eval_int [268] + 0.00 0.03 883617/884940 itoa10 [338] + 0.01 0.00 883617/13102790 opstack_pop [176] + 0.01 0.00 883617/13102790 opstack_push [202] + 0.00 0.00 883617/13399069 balloc [363] +----------------------------------------------- + 0.00 0.05 317735/317735 plan_monsters [52] +[269] 0.1 0.00 0.05 317735 monster_learn [269] + 0.00 0.02 317467/447808 create_order [341] + 0.00 0.02 317467/2934859 skillname [122] + 0.00 0.00 317467/7641081 genrand_int31 [171] + 0.00 0.00 317735/748527 unit_can_study [709] +----------------------------------------------- + 0.01 0.04 595896/595896 process [7] +[270] 0.1 0.01 0.04 595896 update_long_order [270] + 0.02 0.00 575221/635885 copy_order [441] + 0.01 0.00 1132975/55492327 getkeyword [54] + 0.00 0.00 152977/1644867 free_orders [306] + 0.00 0.00 595896/1629412 LongHunger [536] + 0.00 0.00 451283/2985733 is_repeated [552] + 0.00 0.00 1178/15102 cmistake [718] + 0.00 0.00 56/3110 default_order [902] + 0.00 0.00 1132609/1132609 is_long [1370] + 0.00 0.00 581697/1291427 set_order [1365] +----------------------------------------------- + 0.01 0.00 178254/1006923 new_region [275] + 0.01 0.00 369586/1006923 r_connect [474] + 0.02 0.00 459083/1006923 findregion [420] +[271] 0.1 0.04 0.01 1006923 rfindhash [271] + 0.01 0.00 1006923/2903884 jenkins_hash [439] +----------------------------------------------- + 0.00 0.05 5384/5384 process [7] +[272] 0.1 0.00 0.05 5384 teach_cmd [272] + 0.01 0.01 16132/16132 teach_unit [426] + 0.01 0.00 34486/34486 effskill_study [504] + 0.00 0.00 17577/282847 getunit [205] + 0.00 0.00 5384/14326 replace_order [526] + 0.00 0.00 17247/435022 getskill [387] + 0.00 0.00 9353/9953180 alliedunit [31] + 0.00 0.00 17417/5100840 itoa36 [116] + 0.00 0.00 5384/447808 create_order [341] + 0.00 0.00 17417/34611296 strlcpy [45] + 0.00 0.00 28057/1027665 init_order [613] + 0.00 0.00 22843/22843 parser_end [849] + 0.00 0.00 5384/69432 getparam [681] + 0.00 0.00 1323/41248 msg_feedback [647] + 0.00 0.00 17417/55492327 getkeyword [54] + 0.00 0.00 5384/2858912 get_effect [225] + 0.00 0.00 5380/12246335 ct_find [114] + 0.00 0.00 5380/10190660 get_curse [143] + 0.00 0.00 1323/392959 add_message [434] + 0.00 0.00 412/2426021 get_mage [198] + 0.00 0.00 5384/129167539 u_race [89] + 0.00 0.00 167/167 academy_teaching_bonus [1128] + 0.00 0.00 5384/18647447 getplane [596] + 0.00 0.00 42/54318 getstrtoken [710] + 0.00 0.00 42/534930 isparam [668] + 0.00 0.00 17289/17289 parser_pushstate [1507] + 0.00 0.00 17289/17289 parser_popstate [1506] + 0.00 0.00 5384/1936876 free_order [1356] + 0.00 0.00 1323/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.05 298/298 plan_monsters [52] +[273] 0.1 0.00 0.05 298 plan_dragon [273] + 0.00 0.02 249/252 path_exists [431] + 0.00 0.01 40/40 set_new_dragon_target [486] + 0.00 0.01 249/249 make_movement_order [522] + 0.00 0.00 17/17 recruit_dracoids [837] + 0.00 0.00 249/2480226 old_race [14] + 0.00 0.00 49/133 income [885] + 0.00 0.00 136/83859 reduce_weight [404] + 0.00 0.00 39/39 random_growl [1065] + 0.00 0.00 119/447808 create_order [341] + 0.00 0.00 119/2934859 skillname [122] + 0.00 0.00 49/49 get_money_for_dragon [1087] + 0.00 0.00 306/752645 chance [495] + 0.00 0.00 360/7641081 genrand_int31 [171] + 0.00 0.00 298/51974272 a_find [65] + 0.00 0.00 44/71815034 get_race [12] + 0.00 0.00 298/12560453 rc_changed [256] + 0.00 0.00 460/129167539 u_race [89] + 0.00 0.00 74/2605004 rpeasants [435] + 0.00 0.00 43/7120688 get_money [187] + 0.00 0.00 74/4666665 rmoney [452] + 0.00 0.00 119/21345834 skill_enabled [365] +----------------------------------------------- + 0.00 0.00 209/1481616 setstealth_cmd [182] + 0.03 0.02 1481407/1481616 parse_order [117] +[274] 0.1 0.03 0.02 1481616 get_keyword [274] + 0.01 0.00 1481616/4457785 transliterate [358] + 0.01 0.00 1481616/4558423 get_translations [437] + 0.00 0.00 1481322/11194781 keyword_disabled [1348] +----------------------------------------------- + 0.00 0.05 178254/178254 readregion [209] +[275] 0.1 0.00 0.05 178254 new_region [275] + 0.02 0.00 178254/178254 hash_uid [442] + 0.02 0.00 178254/760673 addlist [217] + 0.01 0.00 178254/1006923 rfindhash [271] + 0.00 0.00 178254/178290 rhash [737] + 0.00 0.00 178254/3587241 pnormalize [1350] +----------------------------------------------- + 0.00 0.05 1/1 process [7] +[276] 0.1 0.00 0.05 1 quit [276] + 0.00 0.03 1/1 remove_idle_players [391] + 0.00 0.02 1/6 remove_empty_units [146] + 0.00 0.00 237/16493 NewbieImmunity [900] + 0.00 0.00 4/967784 msg_message [132] + 0.00 0.00 4/392959 add_message [434] + 0.00 0.00 4/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.05 178254/178254 produce [29] +[277] 0.1 0.00 0.05 178254 expandwork [277] + 0.00 0.04 189233/490896 wage [174] + 0.00 0.00 342640/2605004 rpeasants [435] + 0.00 0.00 10979/34409 add_income [625] + 0.00 0.00 178254/2186159 rsetmoney [553] + 0.00 0.00 178254/4666665 rmoney [452] + 0.00 0.00 10979/2599554 change_money [337] + 0.00 0.00 10979/129167539 u_race [89] + 0.00 0.00 503/7641081 genrand_int31 [171] + 0.00 0.00 82525/508632 rule_blessed_harvest [1327] +----------------------------------------------- + 0.00 0.05 663/663 produce [29] +[278] 0.1 0.00 0.05 663 expandtax [278] + 0.02 0.00 1524933/2599554 change_money [337] + 0.01 0.00 3049883/4666665 rmoney [452] + 0.01 0.00 1524933/2186159 rsetmoney [553] + 0.00 0.00 663/10852 expandorders [197] + 0.00 0.00 948/34409 add_income [625] +----------------------------------------------- + 0.00 0.00 38/221899 renumber_cmd [780] + 0.00 0.00 59/221899 expandstealing [807] + 0.00 0.05 221802/221899 unitorders [46] +[279] 0.1 0.00 0.05 221899 findunitg [279] + 0.04 0.00 221899/1118718 ufindhash [109] +----------------------------------------------- + 0.00 0.00 361/515911 regionname [987] + 0.00 0.05 515550/515911 eval_region [245] +[280] 0.1 0.00 0.05 515911 write_regionname [280] + 0.01 0.02 513251/1552289 rname [200] + 0.02 0.00 513251/1826688 adjust_coordinates [234] + 0.00 0.00 513251/5461936 slprintf [548] + 0.00 0.00 513251/18647447 getplane [596] + 0.00 0.00 2660/34611296 strlcpy [45] + 0.00 0.00 513251/3587241 pnormalize [1350] +----------------------------------------------- + 0.00 0.00 2364/4851739 give_item [126] + 0.00 0.00 24010/4851739 give_cmd [102] + 0.00 0.00 671315/4851739 get_pooled [104] + 0.03 0.01 4154050/4851739 use_pooled [39] +[281] 0.1 0.03 0.02 4851739 get_reservation [281] + 0.01 0.00 9703478/56052475 get_resourcetype [194] + 0.00 0.00 20370/129167539 u_race [89] +----------------------------------------------- + 0.00 0.04 1/1 process [7] +[282] 0.1 0.00 0.04 1 new_units [282] + 0.00 0.02 754/754 checkunitnumber [402] + 0.00 0.01 754/2889 create_unit [296] + 0.01 0.00 1136686/55492327 getkeyword [54] + 0.00 0.00 754/228907 getid [483] + 0.00 0.00 754/2281756 gettoken [195] + 0.00 0.00 754/779419 a_add [555] + 0.00 0.00 754/1474687 leftship [500] + 0.00 0.00 754/1027665 init_order [613] + 0.00 0.00 754/779868 a_new [1376] + 0.00 0.00 754/599650 setstatus [1390] +----------------------------------------------- + 0.00 0.00 39714/300501 sail [181] + 0.00 0.01 105958/300501 travel_route [147] + 0.01 0.02 154829/300501 movewhere [350] +[283] 0.1 0.01 0.03 300501 move_blocked [283] + 0.00 0.03 300501/2225796 get_borders [120] + 0.00 0.00 282968/12246335 ct_find [114] + 0.00 0.00 282968/10190660 get_curse [143] + 0.00 0.00 282968/4201030 curse_active [543] + 0.00 0.00 37024/37024 b_blocknone [1471] + 0.00 0.00 2/2 b_blockquestportal [1770] +----------------------------------------------- + 0.01 0.03 1/1 randomevents [91] +[284] 0.1 0.01 0.03 1 rotting_herbs [284] + 0.02 0.00 595476/6010308 i_find [127] + 0.00 0.01 595476/1177511 it_find [385] + 0.00 0.00 22496/147217 normalvariate [376] + 0.00 0.00 22496/11241829 i_change [115] + 0.00 0.00 1/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.04 1/1 randomevents [91] +[285] 0.1 0.00 0.04 1 icebergs [285] + 0.01 0.01 178254/178263 drown [394] + 0.01 0.00 1/1 move_icebergs [534] + 0.01 0.00 1/1 create_icebergs [538] +----------------------------------------------- + 0.00 0.00 45033/4198692 report_template [87] + 0.00 0.00 106798/4198692 help_feed [678] + 0.01 0.03 4046861/4198692 get_food [88] +[286] 0.1 0.01 0.03 4198692 lifestyle [286] + 0.00 0.02 1677644/3902878 get_monsters [293] + 0.01 0.01 2521048/2765718 maintenance_cost [481] + 0.00 0.00 2521048/18647447 getplane [596] +----------------------------------------------- + 0.00 0.04 131765/131765 process [7] +[287] 0.1 0.00 0.04 131765 give_control_cmd [287] + 0.00 0.04 131765/282847 getunit [205] + 0.00 0.00 131765/2281756 gettoken [195] + 0.00 0.00 131765/1027665 init_order [613] + 0.00 0.00 131764/534930 isparam [668] + 0.00 0.00 6/102705 can_give_to [600] + 0.00 0.00 3/967784 msg_message [132] + 0.00 0.00 3/15102 cmistake [718] + 0.00 0.00 3/392959 add_message [434] + 0.00 0.00 1/593636 building_owner [232] + 0.00 0.00 5/3358315 ship_owner [438] + 0.00 0.00 3/3 give_control [1763] + 0.00 0.00 3/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 677/10383360 ally_cmd [877] + 0.00 0.00 1297/10383360 AllianceAuto [535] + 0.00 0.00 5925/10383360 addally [913] + 0.01 0.03 10375461/10383360 AllianceRestricted [164] +[288] 0.1 0.01 0.03 10383360 HelpMask [288] + 0.01 0.02 10383360/20777534 config_get [224] +----------------------------------------------- + 0.00 0.04 96527/96527 travel [81] +[289] 0.1 0.00 0.04 96527 make_route [289] + 0.00 0.03 209781/252446 movewhere [350] + 0.00 0.01 113254/113487 next_region [601] + 0.00 0.01 209781/2281756 gettoken [195] + 0.00 0.00 4/392959 add_message [434] + 0.00 0.00 4/955 movement_error [1193] + 0.00 0.00 113254/192815 add_regionlist [1419] + 0.00 0.00 4/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 14502/1065211 eval_ship [740] + 0.00 0.01 180598/1065211 nr_ship [111] + 0.00 0.02 434165/1065211 cb_cr_travelthru_ship [204] + 0.00 0.02 435946/1065211 cb_write_travelthru [169] +[290] 0.1 0.00 0.04 1065211 shipname [290] + 0.00 0.04 1065211/1065211 write_shipname [291] +----------------------------------------------- + 0.00 0.04 1065211/1065211 shipname [290] +[291] 0.1 0.00 0.04 1065211 write_shipname [291] + 0.00 0.04 1065211/5100840 itoa36 [116] + 0.00 0.00 1065211/5461936 slprintf [548] +----------------------------------------------- + 0.00 0.00 1/3902879 spawn_dragons [411] + 0.00 0.04 3902878/3902879 get_monsters [293] +[292] 0.1 0.00 0.04 3902879 get_or_create_monsters [292] + 0.01 0.03 3902879/4625636 findfaction [259] +----------------------------------------------- + 0.00 0.00 1/3902878 tolua_planmonsters [51] + 0.00 0.00 1/3902878 spawn_braineaters [505] + 0.00 0.00 1/3902878 report_plaintext [4] + 0.00 0.00 1/3902878 remove_idle_players [391] + 0.00 0.00 1/3902878 update_spells [381] + 0.00 0.00 1/3902878 make_zombie [1267] + 0.00 0.00 1/3902878 spawn_undead [629] + 0.00 0.00 5/3902878 chaos [848] + 0.00 0.00 82/3902878 age_undead [1196] + 0.00 0.00 84/3902878 loot_cmd [873] + 0.00 0.00 176/3902878 list_address [635] + 0.00 0.00 653/3902878 age_ghoul [1024] + 0.00 0.00 665/3902878 age_zombie [1019] + 0.00 0.00 725/3902878 age_skeleton [1008] + 0.00 0.00 983/3902878 loot_items [810] + 0.00 0.00 39959/3902878 can_start_guarding [679] + 0.00 0.00 83768/3902878 canwalk [633] + 0.00 0.00 419410/3902878 randomevents [91] + 0.00 0.00 419518/3902878 produceexp_ex [323] + 0.00 0.00 419518/3902878 plan_monsters [52] + 0.00 0.01 839681/3902878 make_summary [21] + 0.00 0.02 1677644/3902878 lifestyle [286] +[293] 0.1 0.00 0.04 3902878 get_monsters [293] + 0.00 0.04 3902878/3902879 get_or_create_monsters [292] +----------------------------------------------- + 0.00 0.04 1/1 demographics [50] +[294] 0.1 0.00 0.04 1 immigration [294] + 0.00 0.04 178254/490896 wage [174] + 0.00 0.00 185509/2605004 rpeasants [435] + 0.00 0.00 178254/2765718 maintenance_cost [481] + 0.00 0.00 23630/71815034 get_race [12] + 0.00 0.00 17728/438629 maxworkingpeasants [473] + 0.00 0.00 14329/264251 rsetpeasants [545] + 0.00 0.00 7074/1336242 rng_injectable_double [396] + 0.00 0.00 51382/129167539 u_race [89] + 0.00 0.00 1/4984610 config_get_int [348] + 0.00 0.00 1/64 log_info [1339] +----------------------------------------------- + 0.00 0.04 178254/178254 process [7] +[295] 0.1 0.00 0.04 178254 enter_2 [295] + 0.03 0.01 178254/713016 do_enter [128] +----------------------------------------------- + 0.00 0.00 1/2889 sp_summon_familiar [1025] + 0.00 0.00 1/2889 sp_summonshadowlords [1034] + 0.00 0.00 2/2889 summon_allies [925] + 0.00 0.00 5/2889 chaos [848] + 0.00 0.00 6/2889 tolua_unit_create [916] + 0.00 0.00 6/2889 sp_summonundead [896] + 0.00 0.00 10/2889 spawn_dragons [411] + 0.00 0.00 17/2889 recruit_dracoids [837] + 0.00 0.00 20/2889 spawn_seaserpent [831] + 0.00 0.00 38/2889 sp_viewreality [784] + 0.00 0.00 92/2889 spawn_undead [629] + 0.00 0.01 639/2889 spawn_braineaters [505] + 0.00 0.01 754/2889 new_units [282] + 0.00 0.02 1298/2889 add_recruits [371] +[296] 0.1 0.00 0.04 2889 create_unit [296] + 0.00 0.04 2889/2889 createunitid [317] + 0.00 0.00 2889/109785 move_unit [421] + 0.00 0.00 2806/2931 name_unit [803] + 0.00 0.00 2889/1381157 unit_max_hp [136] + 0.00 0.00 2889/760673 addlist [217] + 0.00 0.00 2889/3110 default_order [902] + 0.00 0.00 2494/779419 a_add [555] + 0.00 0.00 2062/2275967 get_racename [368] + 0.00 0.00 2598/51974272 a_find [65] + 0.00 0.00 2062/2421 set_racename [1015] + 0.00 0.00 535/1270 set_group [1048] + 0.00 0.00 2097/129167539 u_race [89] + 0.00 0.00 2889/24935046 faction_alive [451] + 0.00 0.00 2889/598129 u_setfaction [1111] + 0.00 0.00 2889/1291427 set_order [1365] + 0.00 0.00 2889/600145 u_setrace [1389] + 0.00 0.00 2889/603524 set_number [1387] + 0.00 0.00 2063/779868 a_new [1376] + 0.00 0.00 2062/599650 setstatus [1390] + 0.00 0.00 837/48565 u_set_building [1460] + 0.00 0.00 431/433 make_otherfaction [1603] + 0.00 0.00 431/1380007 get_otherfaction [1362] + 0.00 0.00 35/27640 u_set_ship [1485] +----------------------------------------------- + 0.01 0.03 178254/178254 do_battle [64] +[297] 0.1 0.01 0.03 178254 start_battle [297] + 0.00 0.02 2858/3203 join_battle [425] + 0.01 0.00 1129818/55492327 getkeyword [54] + 0.00 0.00 1443/1437425 cansee [22] + 0.00 0.00 1487/282847 getunit [205] + 0.00 0.00 1432/9953180 alliedunit [31] + 0.00 0.00 2974/10190660 get_curse [143] + 0.00 0.00 1486/1474687 leftship [500] + 0.00 0.00 1429/51974272 a_find [65] + 0.00 0.00 7/15361 is_guarded [377] + 0.00 0.00 1487/1027665 init_order [613] + 0.00 0.00 1518/1629412 LongHunger [536] + 0.00 0.00 1431/16669 IsImmune [901] + 0.00 0.00 57/41248 msg_feedback [647] + 0.00 0.00 2974/4201030 curse_active [543] + 0.00 0.00 1518/129167539 u_race [89] + 0.00 0.00 32/15102 cmistake [718] + 0.00 0.00 57/392959 add_message [434] + 0.00 0.00 1518/18647447 getplane [596] + 0.00 0.00 206/206 make_battle [1282] + 0.00 0.00 2/16493 NewbieImmunity [900] + 0.00 0.00 1429/2073 set_enemy [1562] + 0.00 0.00 55/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.04 102149/102149 cr_output_region [10] +[298] 0.1 0.00 0.04 102149 cr_output_travelthru [298] + 0.01 0.04 204298/3398582 travelthru_map [41] +----------------------------------------------- + 0.00 0.00 13/841675 write_planes [1207] + 0.00 0.00 1692/841675 write_groups [920] + 0.04 0.00 839970/841675 write_attribs [301] +[299] 0.1 0.04 0.00 841675 a_write [299] + 0.00 0.00 4024/4024 curse_write [930] + 0.00 0.00 1564/1564 write_handler [955] + 0.00 0.00 1522/1522 a_write_unit [998] + 0.00 0.00 2096/2096 a_writeeffect [1073] + 0.00 0.00 58524/58524 a_writeint [1447] + 0.00 0.00 56646/56646 write_group [1449] + 0.00 0.00 39955/39955 write_of [1467] + 0.00 0.00 34420/34420 a_writeshorts [1473] + 0.00 0.00 14111/14111 shiptrail_write [1511] + 0.00 0.00 8187/8187 write_seenspell [1523] + 0.00 0.00 7220/7220 a_writestring [1529] + 0.00 0.00 2089/2089 write_mage [1560] + 0.00 0.00 1117/1117 write_targetregion [1584] + 0.00 0.00 66/66 a_writechars [1663] + 0.00 0.00 56/56 dict_write [1677] + 0.00 0.00 2/2 wormhole_write [1785] + 0.00 0.00 1/1 a_writekeys [1787] +----------------------------------------------- + 0.00 0.04 32670/32670 demographics [50] +[300] 0.1 0.00 0.04 32670 growing_herbs [300] + 0.01 0.03 3017598/7641081 genrand_int31 [171] + 0.00 0.00 3112897/3166898 rherbs [1351] + 0.00 0.00 62629/101322 rsetherbs [1438] +----------------------------------------------- + 0.00 0.00 232/839970 writefaction [762] + 0.00 0.00 65263/839970 write_game [83] + 0.00 0.01 178254/839970 writeregion [519] + 0.00 0.03 596221/839970 write_unit [97] +[301] 0.1 0.00 0.04 839970 write_attribs [301] + 0.04 0.00 839970/841675 a_write [299] +----------------------------------------------- + 0.00 0.00 1/10053919 breedtrees [1148] + 0.00 0.00 6/10053919 sp_mallornhain [968] + 0.00 0.00 9/10053919 sp_hain [931] + 0.00 0.00 20/10053919 dissolve_units [241] + 0.00 0.00 51/10053919 potion_water_of_life [945] + 0.00 0.00 58/10053919 terraform_region [932] + 0.00 0.00 2772/10053919 tolua_region_get_resource [976] + 0.00 0.00 91260/10053919 cr_output_resources [238] + 0.00 0.00 182290/10053919 report_resources [210] + 0.00 0.00 196020/10053919 writeregion [519] + 0.00 0.00 249356/10053919 growing_trees [624] + 0.00 0.00 255352/10053919 describe [35] + 0.00 0.00 877258/10053919 maxworkingpeasants [473] + 0.03 0.00 8199466/10053919 r_isforest [199] +[302] 0.1 0.04 0.00 10053919 rtrees [302] +----------------------------------------------- + 0.00 0.00 40231/7851812 centre [789] + 0.04 0.00 7811581/7851812 paragraph [26] +[303] 0.1 0.04 0.00 7851812 write_spaces [303] +----------------------------------------------- + 0.04 0.00 4568249/4568249 parse_symbol [42] +[304] 0.1 0.04 0.00 4568249 find_variable [304] +----------------------------------------------- + 0.04 0.00 3573165/3573165 ql_set_insert_ex [156] +[305] 0.1 0.04 0.00 3573165 cmp_faction [305] +----------------------------------------------- + 0.00 0.00 1/1644867 tolua_unit_clear_orders [1313] + 0.00 0.00 6/1644867 make_undead_unit [1188] + 0.00 0.00 114/1644867 u_setfaction [1111] + 0.00 0.00 56948/1644867 unitorders [46] + 0.00 0.00 152977/1644867 update_long_order [270] + 0.01 0.00 419518/1644867 plan_monsters [52] + 0.01 0.00 420178/1644867 clear_npc_orders [531] + 0.01 0.00 595125/1644867 read_unit [74] +[306] 0.1 0.04 0.00 1644867 free_orders [306] + 0.00 0.00 810550/1936876 free_order [1356] +----------------------------------------------- + 0.00 0.00 46/3016 steal_cmd [766] + 0.00 0.00 146/3016 createunitid [317] + 0.04 0.00 2824/3016 newunitid [319] +[307] 0.1 0.04 0.00 3016 dfindhash [307] +----------------------------------------------- + +[308] 0.1 0.04 0.00 cb_find_prefix [308] +----------------------------------------------- + +[309] 0.1 0.04 0.00 class_index_event [309] +----------------------------------------------- + +[310] 0.1 0.04 0.00 fs_read [310] +----------------------------------------------- + +[311] 0.1 0.04 0.00 pack_int [311] +----------------------------------------------- + +[312] 0.1 0.04 0.00 ql_find [312] +----------------------------------------------- + +[313] 0.1 0.04 0.00 tolua_unitlist_next [313] +----------------------------------------------- + +[314] 0.1 0.04 0.00 unicode_ucs4_to_utf8 [314] +----------------------------------------------- + 0.04 0.00 4625636/4625636 findfaction [259] +[315] 0.1 0.04 0.00 4625636 ffindhash [315] +----------------------------------------------- + 0.00 0.00 2342/4136059 xml_readstrings [863] + 0.04 0.00 4133717/4136059 mkname [261] +[316] 0.1 0.04 0.00 4136059 mkname_buf [316] +----------------------------------------------- + 0.00 0.04 2889/2889 create_unit [296] +[317] 0.1 0.00 0.04 2889 createunitid [317] + 0.00 0.04 2743/2818 newunitid [319] + 0.00 0.00 146/3016 dfindhash [307] + 0.00 0.00 754/1118718 ufindhash [109] + 0.00 0.00 2889/598069 uhash [667] + 0.00 0.00 146/3002 forbiddenid [1280] +----------------------------------------------- + 0.00 0.00 8/598234 spy_message [1038] + 0.00 0.04 598226/598234 bufunit [17] +[318] 0.1 0.00 0.04 598234 report_status [318] + 0.01 0.01 598292/24887945 locale_string [27] + 0.01 0.00 598234/34611296 strlcpy [45] + 0.00 0.00 116/987128 strlcat [1374] +----------------------------------------------- + 0.00 0.00 32/2818 make_curse [802] + 0.00 0.00 43/2818 renumber_cmd [780] + 0.00 0.04 2743/2818 createunitid [317] +[319] 0.1 0.00 0.04 2818 newunitid [319] + 0.04 0.00 2824/3016 dfindhash [307] + 0.00 0.00 5523/1118718 ufindhash [109] + 0.00 0.00 2818/7641081 genrand_int31 [171] + 0.00 0.00 2818/3002 forbiddenid [1280] +----------------------------------------------- + 0.00 0.00 233/628037 readfaction [767] + 0.00 0.00 32679/628037 readregion [209] + 0.02 0.02 595125/628037 read_unit [74] +[320] 0.1 0.02 0.02 628037 read_items [320] + 0.00 0.01 448447/1177511 it_find [385] + 0.01 0.00 448447/11241829 i_change [115] +----------------------------------------------- + 0.03 0.01 301257/301257 cr_render [196] +[321] 0.1 0.03 0.01 301257 crt_find [321] + 0.01 0.00 301257/32337529 hashstring [37] +----------------------------------------------- + 0.00 0.00 1/472418 breedtrees [1148] + 0.00 0.00 8/472418 spy_cmd [990] + 0.00 0.00 21/472418 build_road [950] + 0.00 0.00 59/472418 steal_cmd [766] + 0.00 0.00 152/472418 magic [157] + 0.00 0.00 170/472418 breedhorses [742] + 0.00 0.00 349/472418 research_cmd [886] + 0.00 0.00 1040/472418 build [691] + 0.00 0.00 2825/472418 split_allocations [743] + 0.00 0.00 5896/472418 herbsearch [493] + 0.00 0.00 6133/472418 produce [29] + 0.00 0.00 9105/472418 move_ship [374] + 0.00 0.00 10581/472418 travel_route [147] + 0.00 0.00 16560/472418 expandentertainment [637] + 0.00 0.03 419518/472418 plan_monsters [52] +[322] 0.1 0.00 0.04 472418 produceexp [322] + 0.00 0.04 472418/472418 produceexp_ex [323] +----------------------------------------------- + 0.00 0.04 472418/472418 produceexp [322] +[323] 0.1 0.00 0.04 472418 produceexp_ex [323] + 0.02 0.00 472366/472366 produceexp_days [406] + 0.00 0.01 472366/892307 learn_skill [471] + 0.00 0.00 419518/3902878 get_monsters [293] + 0.00 0.00 52873/129167539 u_race [89] +----------------------------------------------- + 0.00 0.04 35708/35708 process [7] +[324] 0.1 0.00 0.04 35708 reserve_cmd [324] + 0.00 0.04 35708/71416 reserve_i [213] +----------------------------------------------- + 0.00 0.04 35708/35708 process [7] +[325] 0.1 0.00 0.04 35708 reserve_self [325] + 0.00 0.04 35708/71416 reserve_i [213] +----------------------------------------------- + 0.03 0.01 1/1 movement [47] +[326] 0.1 0.03 0.01 1 move_pirates [326] + 0.00 0.00 5049/5049 piracy_cmd [660] + 0.00 0.00 178254/178254 age_traveldir [720] + 0.00 0.00 38489/55492327 getkeyword [54] + 0.00 0.00 178254/178254 age_piracy [959] +----------------------------------------------- + 0.01 0.03 127676/127676 report_plaintext [4] +[327] 0.1 0.01 0.03 127676 write_travelthru [327] + 0.00 0.01 57367/57367 count_travelthru [518] + 0.00 0.01 54735/3398582 travelthru_map [41] + 0.00 0.00 54735/24887945 locale_string [27] + 0.00 0.00 54735/34611296 strlcpy [45] + 0.00 0.00 54735/54735 init_cb [1453] +----------------------------------------------- + 0.00 0.04 470529/470529 parse_symbol [42] +[328] 0.1 0.00 0.04 470529 eval_resource [328] + 0.01 0.01 470529/24887945 locale_string [27] + 0.01 0.00 941058/13102790 opstack_pop [176] + 0.00 0.00 470529/13102790 opstack_push [202] + 0.00 0.00 470529/13259934 resourcename [233] + 0.00 0.00 470529/13399069 balloc [363] +----------------------------------------------- + 0.00 0.00 2/8892 sp_viewreality [784] + 0.00 0.00 365/8892 cr_output_region [10] + 0.00 0.03 8525/8892 describe [35] +[329] 0.1 0.00 0.04 8892 astralregions [329] + 0.02 0.00 162996/162996 inhabitable [454] + 0.00 0.01 163381/459083 findregion [420] + 0.00 0.01 214975/514146 koor_distance [476] + 0.00 0.00 8892/8892 r_astral_to_standard [783] + 0.00 0.00 17784/987488 is_astral [479] + 0.00 0.00 163381/18647447 getplane [596] + 0.00 0.00 163381/3587241 pnormalize [1350] + 0.00 0.00 39832/192815 add_regionlist [1419] +----------------------------------------------- + 0.01 0.03 32670/32670 demographics [50] +[330] 0.1 0.01 0.03 32670 horses [330] + 0.02 0.01 124547/147217 normalvariate [376] + 0.00 0.00 32670/438629 maxworkingpeasants [473] + 0.00 0.00 29173/12246335 ct_find [114] + 0.00 0.00 29173/10190660 get_curse [143] + 0.00 0.00 5134/369586 r_connect [474] + 0.00 0.00 8246/51974272 a_find [65] + 0.00 0.00 29173/4201030 curse_active [543] + 0.00 0.00 376714/1160345 rhorses [1369] + 0.00 0.00 195073/257693 rsethorses [1408] + 0.00 0.00 62267/62267 get_migrants [1445] + 0.00 0.00 29173/651711 oldcursename [1381] +----------------------------------------------- + 0.02 0.02 595898/595898 process [7] +[331] 0.1 0.02 0.02 595898 follow_unit [331] + 0.01 0.00 1135305/55492327 getkeyword [54] + 0.00 0.00 595258/1629412 LongHunger [536] + 0.00 0.00 816/1437425 cansee [22] + 0.00 0.00 900/888603 findunit [123] + 0.00 0.00 900/284005 read_unitid [413] + 0.00 0.00 1425/69432 getparam [681] + 0.00 0.00 525/228907 getid [483] + 0.00 0.00 894/779419 a_add [555] + 0.00 0.00 1425/1027665 init_order [613] + 0.00 0.00 1039/3358315 ship_owner [438] + 0.00 0.00 519/115276 can_move [736] + 0.00 0.00 631/51974272 a_find [65] + 0.00 0.00 5/15102 cmistake [718] + 0.00 0.00 13/1297 hunted_dir [1055] + 0.00 0.00 894/894 make_follow [1589] + 0.00 0.00 703/1291427 set_order [1365] + 0.00 0.00 525/28818 findship [1483] +----------------------------------------------- + 0.00 0.00 86/3351853 tolua_unit_get_name [1194] + 0.00 0.00 45033/3351853 report_template [87] + 0.00 0.01 923633/3351853 cr_output_unit [19] + 0.00 0.03 2383101/3351853 write_unitname [148] +[332] 0.1 0.00 0.04 3351853 unit_getname [332] + 0.01 0.01 537193/24887945 locale_string [27] + 0.00 0.01 537193/2818494 rc_name_s [260] +----------------------------------------------- + 7791002 parse_symbol [42] + 0.48 0.57 1379793/1380398 translate [28] +[333] 0.1 0.03 0.01 9170795 parse [333] + 0.00 0.01 832876/832876 parse_int [649] + 5612941 parse_symbol [42] + 2724978 parse_string [86] +----------------------------------------------- + 4953357 effskill [100] + 0.00 0.00 20/12320804 target_resists_magic [1154] + 0.00 0.00 48/12320804 spy_message [1038] + 0.05 0.09 1953681/12320804 spskill [53] +[334] 0.1 0.04 0.00 6907106 eff_skill [334] + 6907105 get_modifier [55] +----------------------------------------------- + +[335] 0.1 0.04 0.00 cb_get_kv [335] +----------------------------------------------- + 0.00 0.03 595472/595472 live [73] +[336] 0.1 0.00 0.03 595472 age_unit [336] + 0.00 0.02 595472/71815034 get_race [12] + 0.00 0.01 595472/987488 is_astral [479] + 0.00 0.00 1194391/129167539 u_race [89] + 0.00 0.00 1363/1363 age_skeleton [1008] + 0.00 0.00 688/688 age_zombie [1019] + 0.00 0.00 708/708 age_ghoul [1024] + 0.00 0.00 295/295 age_dragon [1098] + 0.00 0.00 182/182 age_firedragon [1123] + 0.00 0.00 266/266 age_undead [1196] + 0.00 0.00 1/1 age_illusion [1308] +----------------------------------------------- + 0.00 0.00 17/2599554 recruit_dracoids [837] + 0.00 0.00 38/2599554 expandstealing [807] + 0.00 0.00 4800/2599554 expandloot [816] + 0.00 0.00 10979/2599554 expandwork [277] + 0.00 0.00 16560/2599554 expandentertainment [637] + 0.00 0.00 32382/2599554 help_feed [678] + 0.00 0.00 283759/2599554 expandselling [93] + 0.01 0.00 726086/2599554 get_food [88] + 0.02 0.00 1524933/2599554 expandtax [278] +[337] 0.1 0.03 0.00 2599554 change_money [337] + 0.00 0.00 2599554/56052475 get_resourcetype [194] + 0.00 0.00 87928/257723 i_remove [1407] + 0.00 0.00 87928/374425 i_free [1400] + 0.00 0.00 86907/822780 i_new [1375] + 0.00 0.00 86907/87004 i_add [1442] +----------------------------------------------- + 0.00 0.00 17/884940 create_order [341] + 0.00 0.00 48/884940 spy_message [1038] + 0.00 0.00 1258/884940 report_template [87] + 0.00 0.03 883617/884940 eval_int [268] +[338] 0.1 0.00 0.03 884940 itoa10 [338] + 0.03 0.00 884940/5985780 itoab [107] +----------------------------------------------- + 0.01 0.02 178254/178254 process [7] +[339] 0.1 0.01 0.02 178254 maintain_buildings [339] + 0.00 0.02 44190/44190 maintain [478] + 0.00 0.00 178254/12246335 ct_find [114] + 0.00 0.00 8710/967784 msg_message [132] + 0.00 0.00 8710/593636 building_owner [232] + 0.00 0.00 46175/10190660 get_curse [143] + 0.00 0.00 8710/392959 add_message [434] + 0.00 0.00 46175/4201030 curse_active [543] + 0.00 0.00 295/12265 r_addmessage [779] + 0.00 0.00 8710/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.03 3438/3438 prepare_report [8] +[340] 0.1 0.00 0.03 3438 prepare_lighthouse [340] + 0.02 0.01 3438/3438 get_regions_distance [372] + 0.00 0.00 87604/745269 add_seen_nb [386] + 0.00 0.00 3438/3438 lighthouse_range [728] +----------------------------------------------- + 0.00 0.00 2/447808 create_ship [1014] + 0.00 0.00 2/447808 default_order [902] + 0.00 0.00 8/447808 do_combatmagic [825] + 0.00 0.00 17/447808 recruit_dracoids [837] + 0.00 0.00 23/447808 do_combatspell [702] + 0.00 0.00 43/447808 get_money_for_dragon [1087] + 0.00 0.00 99/447808 piracy_cmd [660] + 0.00 0.00 119/447808 plan_dragon [273] + 0.00 0.00 133/447808 travel [81] + 0.00 0.00 325/447808 build_building [696] + 0.00 0.00 736/447808 monster_attack [764] + 0.00 0.00 5384/447808 teach_cmd [272] + 0.00 0.00 8450/447808 cycle_route [375] + 0.00 0.00 31277/447808 plan_monsters [52] + 0.00 0.01 83723/447808 monster_move [129] + 0.00 0.02 317467/447808 monster_learn [269] +[341] 0.1 0.00 0.03 447808 create_order [341] + 0.01 0.01 447808/1929215 create_order_i [175] + 0.01 0.00 425391/34611296 strlcpy [45] + 0.00 0.00 425391/36653945 wrptr [178] + 0.00 0.00 1196/5100840 itoa36 [116] + 0.00 0.00 17/884940 itoa10 [338] +----------------------------------------------- + 0.03 0.00 1/1 movement [47] +[342] 0.1 0.03 0.00 1 move_hunters [342] + 0.00 0.00 475/475 follow_ship [749] + 0.00 0.00 85384/55492327 getkeyword [54] + 0.00 0.00 597/69432 getparam [681] + 0.00 0.00 475/115276 can_move [736] + 0.00 0.00 597/1027665 init_order [613] + 0.00 0.00 475/1629412 LongHunger [536] +----------------------------------------------- + 0.01 0.00 112140/297010 castle_name_i [513] + 0.02 0.00 184870/297010 buildingeffsize [367] +[343] 0.1 0.03 0.00 297010 bt_effsize [343] + 0.00 0.00 297010/4984610 config_get_int [348] +----------------------------------------------- + 0.01 0.00 3115/13500 drifting_ships [490] + 0.01 0.00 3135/13500 sinkships [475] + 0.02 0.00 7250/13500 ship_ready [354] +[344] 0.1 0.03 0.00 13500 crew_skill [344] + 0.00 0.00 20459/12320804 effskill [100] +----------------------------------------------- + 0.01 0.00 136/388 path_find [523] + 0.01 0.01 252/388 path_exists [431] +[345] 0.1 0.02 0.01 388 internal_path_find [345] + 0.01 0.00 132629/162862 allowed_dragon [564] + 0.00 0.00 67291/369586 r_connect [474] + 0.00 0.00 125069/152803 new_node [1427] + 0.00 0.00 388/428 free_nodes [1604] + 0.00 0.00 48/157830 allowed_fly [1425] +----------------------------------------------- + 0.01 0.02 1/1 process [7] +[346] 0.1 0.01 0.02 1 regenerate_aura [346] + 0.00 0.02 595454/1441945 is_mage [262] + 0.00 0.00 1870/5358 max_spellpoints [755] + 0.00 0.00 508/967784 msg_message [132] + 0.00 0.00 1870/1873 set_spellpoints [933] + 0.00 0.00 1870/4915 get_spellpoints [872] + 0.00 0.00 508/508 regeneration [942] + 0.00 0.00 508/392959 add_message [434] + 0.00 0.00 508/752645 chance [495] + 0.00 0.00 508/12246335 ct_find [114] + 0.00 0.00 508/10190660 get_curse [143] + 0.00 0.00 1/4984610 config_get_int [348] + 0.00 0.00 508/26995 inside_building [1486] + 0.00 0.00 508/26164 building_is_active [1488] + 0.00 0.00 508/651711 oldcursename [1381] + 0.00 0.00 508/432940 curse_geteffect [1395] + 0.00 0.00 508/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.01 923633/2272376 cr_output_unit [19] + 0.00 0.02 1348743/2272376 bufunit [17] +[347] 0.1 0.00 0.03 2272376 u_description [347] + 0.00 0.02 399769/778818 describe_race [267] + 0.01 0.00 2554959/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 1/4984610 report_computer [9] + 0.00 0.00 1/4984610 recruit_init [1334] + 0.00 0.00 1/4984610 tax_cmd [697] + 0.00 0.00 1/4984610 immigration [294] + 0.00 0.00 1/4984610 demographics [50] + 0.00 0.00 1/4984610 nmr_death [1333] + 0.00 0.00 1/4984610 regenerate_aura [346] + 0.00 0.00 1/4984610 rotting_herbs [284] + 0.00 0.00 1/4984610 roqf_factor [1329] + 0.00 0.00 1/4984610 rule_blessed_harvest [1327] + 0.00 0.00 1/4984610 rule_alliance_limit [1332] + 0.00 0.00 1/4984610 rule_faction_limit [1331] + 0.00 0.00 1/4984610 rule_give [1328] + 0.00 0.00 1/4984610 allied_skilllimit [1330] + 0.00 0.00 2/4984610 rule_stealth_anon [1325] + 0.00 0.00 2/4984610 potion_water_of_life [945] + 0.00 0.00 2/4984610 processorders [6] + 0.00 0.00 2/4984610 rule_region_owners [1323] + 0.00 0.00 2/4984610 game_id [1324] + 0.00 0.00 4/4984610 init_processor [1310] + 0.00 0.00 12/4984610 demon_skillchange [826] + 0.00 0.00 16/4984610 init_rules [1272] + 0.00 0.00 27/4984610 NMRTimeout [1264] + 0.00 0.00 29/4984610 study_cost [433] + 0.00 0.00 42/4984610 loot_cmd [873] + 0.00 0.00 47/4984610 walkingcapacity [403] + 0.00 0.00 105/4984610 terraform_resources [986] + 0.00 0.00 111/4984610 LongHunger [536] + 0.00 0.00 118/4984610 rule_transfermen [1204] + 0.00 0.00 191/4984610 CheckOverload [1180] + 0.00 0.00 207/4984610 rule_force_leave [1175] + 0.00 0.00 225/4984610 spellpower [1000] + 0.00 0.00 226/4984610 fumble [973] + 0.00 0.00 226/4984610 skill_limit [1172] + 0.00 0.00 231/4984610 RemoveNMRNewbie [1171] + 0.00 0.00 348/4984610 begin_potion [1096] + 0.00 0.00 457/4984610 FactionSpells [1136] + 0.00 0.00 587/4984610 build_building [696] + 0.00 0.00 688/4984610 can_leave [1112] + 0.00 0.00 702/4984610 max_transfers [1109] + 0.00 0.00 1085/4984610 get_friends [895] + 0.00 0.00 1398/4984610 nmr_warnings [878] + 0.00 0.00 1725/4984610 max_magicians [915] + 0.00 0.00 3659/4984610 ExpensiveMigrants [1004] + 0.00 0.00 14510/4984610 sail [181] + 0.00 0.00 16493/4984610 NewbieImmunity [900] + 0.00 0.00 30250/4984610 peasants [658] + 0.00 0.00 32679/4984610 rule_auto_taxation [855] + 0.00 0.00 40046/4984610 rule_stealth_other [530] + 0.00 0.00 41882/4984610 GiveRestriction [836] + 0.00 0.00 47562/4984610 rule_random_progress [829] + 0.00 0.00 66058/4984610 ShipSpeedBonus [806] + 0.00 0.00 163027/4984610 markets_module [748] + 0.00 0.00 178254/4984610 drifting_ships [490] + 0.00 0.00 178257/4984610 get_food [88] + 0.00 0.00 189341/4984610 rule_autowork [738] + 0.00 0.00 297010/4984610 bt_effsize [343] + 0.00 0.00 472366/4984610 produceexp_days [406] + 0.00 0.00 835616/4984610 study_cmd [105] + 0.00 0.00 987612/4984610 get_astralplane [482] + 0.00 0.01 1381157/4984610 unit_max_hp [136] +[348] 0.1 0.01 0.02 4984610 config_get_int [348] + 0.01 0.01 4984610/5065285 get_param_int [422] +----------------------------------------------- + 0.00 0.03 1594/1594 economics [78] +[349] 0.1 0.00 0.03 1594 expandrecruit [349] + 0.00 0.03 1594/1594 do_recruiting [351] + 0.00 0.00 1594/264251 rsetpeasants [545] + 0.00 0.00 1594/2605004 rpeasants [435] + 0.00 0.00 4782/4782 select_recruitment [1079] + 0.00 0.00 1594/1594 free_recruitments [1568] +----------------------------------------------- + 0.00 0.01 42665/252446 sail [181] + 0.00 0.03 209781/252446 make_route [289] +[350] 0.1 0.00 0.03 252446 movewhere [350] + 0.01 0.02 154829/300501 move_blocked [283] + 0.00 0.01 159343/293362 get_direction [496] + 0.00 0.00 10913/369586 r_connect [474] + 0.00 0.00 1/1 get_translation [1304] +----------------------------------------------- + 0.00 0.03 1594/1594 expandrecruit [349] +[351] 0.1 0.00 0.03 1594 do_recruiting [351] + 0.00 0.03 1667/1667 add_recruits [371] + 0.00 0.00 1670/860263 use_pooled [39] + 0.00 0.00 1670/541982 get_pooled [104] + 0.00 0.00 3340/56052475 get_resourcetype [194] + 0.00 0.00 1670/129167539 u_race [89] + 0.00 0.00 60/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.03 574/574 do_battle [64] +[352] 0.1 0.00 0.03 574 battle_flee [352] + 0.00 0.02 116914/116914 fleechance [408] + 0.00 0.01 14191/14191 flee [638] + 0.00 0.00 58461/752645 chance [495] + 0.00 0.00 8962/1381157 unit_max_hp [136] + 0.00 0.00 3743/71815034 get_race [12] + 0.00 0.00 8132/129167539 u_race [89] + 0.00 0.00 8962/8962 hpflee [1519] +----------------------------------------------- + 0.02 0.01 1/1 process [7] +[353] 0.1 0.02 0.01 1 restack_units [353] + 0.01 0.00 1130203/55492327 getkeyword [54] + 0.00 0.00 20/888603 findunit [123] + 0.00 0.00 20/228907 getid [483] + 0.00 0.00 20/2281756 gettoken [195] + 0.00 0.00 6/593636 building_owner [232] + 0.00 0.00 20/1787006 findparam [458] + 0.00 0.00 20/1027665 init_order [613] + 0.00 0.00 2/3358315 ship_owner [438] +----------------------------------------------- + 0.00 0.03 7254/7254 sail [181] +[354] 0.1 0.00 0.03 7254 ship_ready [354] + 0.02 0.00 7250/13500 crew_skill [344] + 0.00 0.01 7230/10344 cansail [469] + 0.00 0.00 7254/12320804 effskill [100] + 0.00 0.00 7254/3358315 ship_owner [438] + 0.00 0.00 61/15102 cmistake [718] + 0.00 0.00 4/41248 msg_feedback [647] + 0.00 0.00 4/392959 add_message [434] + 0.00 0.00 7250/13500 enoughsailors [1512] + 0.00 0.00 4/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 698/1956810 transfermen [899] + 0.00 0.00 2419/1956810 set_level [774] + 0.00 0.00 2423/1956810 learn_skill [471] + 0.03 0.00 1951270/1956810 read_unit [74] +[355] 0.1 0.03 0.00 1956810 add_skill [355] + 0.00 0.00 1725/1725 max_magicians [915] +----------------------------------------------- + 0.03 0.00 1/1 tolua_process_orders [5] +[356] 0.1 0.03 0.00 1 reset_game [356] + 0.00 0.00 1/3 init_locales [947] +----------------------------------------------- + 0.00 0.00 1/967 promotion_cmd [917] + 0.00 0.00 45/967 count_maxmigrants [730] + 0.00 0.01 230/967 report_computer [9] + 0.00 0.01 230/967 report_plaintext [4] + 0.00 0.01 461/967 maxheroes [492] +[357] 0.1 0.00 0.03 967 count_all [357] + 0.03 0.00 967/2247 count_faction [219] +----------------------------------------------- + 0.00 0.00 174/4457785 findresourcetype [1181] + 0.00 0.00 371/4457785 add_translation [1145] + 0.00 0.00 628/4457785 add_itemname_cb [980] + 0.00 0.00 648/4457785 add_resourcename_cb [977] + 0.00 0.00 191379/4457785 finditemtype [735] + 0.01 0.00 995991/4457785 get_skill [423] + 0.01 0.00 1481616/4457785 get_keyword [274] + 0.01 0.00 1786978/4457785 findparam [458] +[358] 0.1 0.03 0.00 4457785 transliterate [358] + 0.00 0.00 130/46391457 unicode_utf8_to_ucs4 [177] +----------------------------------------------- + 0.03 0.00 195108/195108 report_template [87] +[359] 0.1 0.03 0.00 195108 rps_nowrap [359] +----------------------------------------------- + 0.01 0.00 51976/130250 cr_output_region [10] + 0.02 0.00 78274/130250 report_plaintext [4] +[360] 0.1 0.03 0.00 130250 r_getmessages [360] +----------------------------------------------- + +[361] 0.1 0.03 0.00 a_select [361] +----------------------------------------------- + +[362] 0.1 0.03 0.00 ql_foreachx [362] +----------------------------------------------- + 0.00 0.00 78/13399069 eval_weight [1102] + 0.00 0.00 124/13399069 eval_unit_dative [1076] + 0.00 0.00 604/13399069 eval_spell [961] + 0.00 0.00 834/13399069 eval_resources [907] + 0.00 0.00 1196/13399069 eval_localize [922] + 0.00 0.00 1520/13399069 eval_race [882] + 0.00 0.00 19545/13399069 eval_ship [740] + 0.00 0.00 25857/13399069 eval_int36 [729] + 0.00 0.00 40099/13399069 eval_skill [671] + 0.00 0.00 46224/13399069 eval_faction [685] + 0.00 0.00 67213/13399069 eval_building [494] + 0.00 0.00 108560/13399069 eval_trail [634] + 0.00 0.00 123513/13399069 eval_order [472] + 0.00 0.00 127674/13399069 eval_trailto [369] + 0.00 0.00 127788/13399069 eval_direction [608] + 0.00 0.00 470529/13399069 eval_resource [328] + 0.00 0.00 515550/13399069 eval_region [245] + 0.00 0.00 799427/13399069 eval_unit [223] + 0.00 0.00 883617/13399069 eval_int [268] + 0.01 0.00 2725583/13399069 parse_string [86] + 0.01 0.00 3656767/13399069 add_variable [607] + 0.01 0.00 3656767/13399069 translate [28] +[363] 0.1 0.03 0.00 13399069 balloc [363] +----------------------------------------------- + 0.03 0.00 2818494/2818494 rc_name_s [260] +[364] 0.1 0.03 0.00 2818494 rc_name [364] +----------------------------------------------- + 0.00 0.00 58/21345834 sp_summon_familiar [1025] + 0.00 0.00 119/21345834 plan_dragon [273] + 0.00 0.00 222/21345834 steal_cmd [766] + 0.00 0.00 231/21345834 setstealth_cmd [182] + 0.00 0.00 569/21345834 u_seteffstealth [1199] + 0.00 0.00 2127/21345834 cr_output_unit [19] + 0.00 0.00 2129/21345834 read_unit [74] + 0.00 0.00 2457/21345834 set_level [774] + 0.00 0.00 3387/21345834 lighthouse_range [728] + 0.00 0.00 6428/21345834 cansee_unit [684] + 0.00 0.00 8034/21345834 u_geteffstealth [919] + 0.00 0.00 23237/21345834 check_leuchtturm [786] + 0.00 0.00 33139/21345834 statistics [70] + 0.00 0.00 36937/21345834 cr_output_region [10] + 0.00 0.00 45891/21345834 get_level [934] + 0.00 0.00 419518/21345834 plan_monsters [52] + 0.00 0.00 1188531/21345834 eff_stealth [163] + 0.00 0.00 2363341/21345834 cansee [22] + 0.01 0.00 7179079/21345834 rc_skillmod [140] + 0.01 0.00 10030400/21345834 effskill [100] +[365] 0.1 0.03 0.00 21345834 skill_enabled [365] +----------------------------------------------- + 0.00 0.00 1/451774 reshow_other [823] + 0.00 0.00 1/451774 usetprivate [1041] + 0.00 0.00 8/451774 melt_iceberg [1082] + 0.00 0.00 23/451774 set_group [1048] + 0.00 0.00 40/451774 plan_monsters [52] + 0.00 0.00 40/451774 deathcounts [843] + 0.00 0.00 105/451774 change_effect [982] + 0.00 0.00 4738/451774 expandselling [93] + 0.00 0.00 5679/451774 expandbuying [49] + 0.00 0.00 23562/451774 a_age [418] + 0.01 0.02 417577/451774 study_cmd [105] +[366] 0.1 0.01 0.02 451774 a_remove [366] + 0.01 0.00 451774/451774 a_unlink [559] + 0.01 0.00 451774/454395 a_free [558] +----------------------------------------------- + 0.00 0.00 3/184870 bewegung_blockiert_von [631] + 0.00 0.00 3778/184870 expandselling [93] + 0.00 0.00 11599/184870 building_protection [708] + 0.01 0.02 169490/184870 default_wage [173] +[367] 0.1 0.01 0.02 184870 buildingeffsize [367] + 0.02 0.00 184870/297010 bt_effsize [343] +----------------------------------------------- + 0.00 0.00 1529/2275967 give_men [857] + 0.00 0.00 2062/2275967 create_unit [296] + 0.00 0.01 923633/2275967 cr_output_unit [19] + 0.01 0.01 1348743/2275967 bufunit [17] +[368] 0.1 0.01 0.02 2275967 get_racename [368] + 0.02 0.00 2275967/51974272 a_find [65] +----------------------------------------------- + 0.00 0.03 127674/127674 parse_symbol [42] +[369] 0.1 0.00 0.03 127674 eval_trailto [369] + 0.00 0.01 127674/146950 f_regionid_s [477] + 0.00 0.01 127674/785221 trailinto [207] + 0.00 0.00 127674/13102790 opstack_pop [176] + 0.00 0.00 127674/13102790 opstack_push [202] + 0.00 0.00 127674/13399069 balloc [363] +----------------------------------------------- + 0.02 0.01 1/1 randomevents [91] +[370] 0.1 0.02 0.01 1 orc_growth [370] + 0.01 0.00 187111/2624955 has_skill [193] + 0.00 0.00 91483/12246335 ct_find [114] + 0.00 0.00 91483/10190660 get_curse [143] +----------------------------------------------- + 0.00 0.03 1667/1667 do_recruiting [351] +[371] 0.1 0.00 0.03 1667 add_recruits [371] + 0.00 0.02 1298/2889 create_unit [296] + 0.00 0.01 1298/1794 remove_unit [499] + 0.00 0.00 1667/2375 equip_unit [775] + 0.00 0.00 1298/1936 transfermen [899] + 0.00 0.00 369/1381157 unit_max_hp [136] + 0.00 0.00 1667/34611296 strlcpy [45] + 0.00 0.00 4632/129167539 u_race [89] + 0.00 0.00 58/967784 msg_message [132] + 0.00 0.00 58/392959 add_message [434] + 0.00 0.00 3334/987128 strlcat [1374] + 0.00 0.00 1667/2742 get_equipment [1551] + 0.00 0.00 369/603524 set_number [1387] + 0.00 0.00 58/1009028 msg_release [1373] +----------------------------------------------- + 0.02 0.01 3438/3438 prepare_lighthouse [340] +[372] 0.1 0.02 0.01 3438 get_regions_distance [372] + 0.00 0.01 200928/298951 distance [599] + 0.00 0.00 88016/1087065 get_neighbours [480] +----------------------------------------------- + +[373] 0.1 0.00 0.03 ql_set_find_ex [373] + 0.03 0.00 2506526/7252744 cmp_transfer [203] +----------------------------------------------- + 0.00 0.00 1/6963 move_iceberg [1094] + 0.00 0.00 15/6963 drifting_ships [490] + 0.02 0.01 6947/6963 sail [181] +[374] 0.1 0.02 0.01 6963 move_ship [374] + 0.00 0.00 10653/109785 move_unit [421] + 0.00 0.00 6962/6962 leave_trail [704] + 0.00 0.00 6952/113844 translist [430] + 0.00 0.00 10679/106919 mark_travelthru [610] + 0.00 0.00 10679/12320804 effskill [100] + 0.00 0.00 9105/472418 produceexp [322] +----------------------------------------------- + 0.00 0.00 6947/103187 sail [181] + 0.00 0.03 96240/103187 travel_route [147] +[375] 0.1 0.00 0.03 103187 cycle_route [375] + 0.00 0.00 133973/24887945 locale_string [27] + 0.00 0.01 133973/293362 get_direction [496] + 0.01 0.00 8450/14326 replace_order [526] + 0.00 0.00 142423/2281756 gettoken [195] + 0.00 0.00 63020/17451017 strlcpy_w [67] + 0.00 0.00 103187/55492327 getkeyword [54] + 0.00 0.00 8450/447808 create_order [341] + 0.00 0.00 8450/1027665 init_order [613] + 0.00 0.00 188092/987128 strlcat [1374] + 0.00 0.00 8450/1936876 free_order [1356] +----------------------------------------------- + 0.00 0.00 174/147217 peasant_luck_effect [984] + 0.00 0.00 22496/147217 rotting_herbs [284] + 0.02 0.01 124547/147217 horses [330] +[376] 0.1 0.02 0.01 147217 normalvariate [376] + 0.00 0.01 403284/1336242 rng_injectable_double [396] +----------------------------------------------- + 0.00 0.00 7/15361 start_battle [297] + 0.00 0.00 30/15361 buy [707] + 0.00 0.00 39/15361 sell [498] + 0.00 0.00 42/15361 loot_cmd [873] + 0.00 0.00 66/15361 travel [81] + 0.00 0.00 278/15361 entertain_cmd [665] + 0.00 0.00 956/15361 tax_cmd [697] + 0.00 0.00 1716/15361 recruit [650] + 0.00 0.01 3100/15361 create_item [617] + 0.00 0.01 3141/15361 do_work [612] + 0.00 0.01 5986/15361 herbsearch [493] +[377] 0.1 0.00 0.03 15361 is_guarded [377] + 0.00 0.02 1841323/8452306 is_guardian_r [186] + 0.00 0.01 70836/70836 is_guardian_u [626] +----------------------------------------------- + 0.00 0.03 174677/174677 cr_output_resources [238] +[378] 0.1 0.00 0.03 174677 cr_output_resource [378] + 0.01 0.01 174677/4434556 translate [75] + 0.00 0.00 174677/24887945 locale_string [27] + 0.00 0.00 174677/32337529 hashstring [37] +----------------------------------------------- + 0.00 0.00 112/94420 give_unit [952] + 0.01 0.02 94308/94420 give_item [126] +[379] 0.1 0.01 0.02 94420 add_give [379] + 0.00 0.01 80478/967784 msg_message [132] + 0.00 0.00 80478/392959 add_message [434] + 0.00 0.00 1141/15102 cmistake [718] + 0.00 0.00 80478/1009028 msg_release [1373] +----------------------------------------------- + 0.01 0.02 325825/325825 monster_kills_peasants [230] +[380] 0.1 0.01 0.02 325825 scared_by_monster [380] + 0.00 0.01 197727/201744 lovar [644] + 0.00 0.00 325825/7641081 genrand_int31 [171] + 0.00 0.00 325825/51974272 a_find [65] + 0.00 0.00 255939/2605004 rpeasants [435] + 0.00 0.00 325825/129167539 u_race [89] + 0.00 0.00 3152/3152 scareaway [768] + 0.00 0.00 2699/967784 msg_message [132] + 0.00 0.00 2699/392959 add_message [434] + 0.00 0.00 2699/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.03 1/1 processorders [6] +[381] 0.1 0.00 0.03 1 update_spells [381] + 0.02 0.01 231/231 faction_getmages [382] + 0.00 0.00 396/396 show_new_spells [889] + 0.00 0.00 1717/2426021 get_mage [198] + 0.00 0.00 165/12320804 effskill [100] + 0.00 0.00 224/457 FactionSpells [1136] + 0.00 0.00 1/3902878 get_monsters [293] + 0.00 0.00 231/3203 faction_get_spellbook [1543] +----------------------------------------------- + 0.02 0.01 231/231 update_spells [381] +[382] 0.1 0.02 0.01 231 faction_getmages [382] + 0.00 0.01 176043/2426021 get_mage [198] + 0.00 0.00 1717/12320804 effskill [100] +----------------------------------------------- + 0.00 0.03 10600/10600 process [7] +[383] 0.1 0.00 0.03 10600 make_cmd [383] + 0.00 0.01 5988/5988 herbsearch [493] + 0.00 0.01 3626/3626 create_item [617] + 0.00 0.00 621/621 build_building [696] + 0.00 0.00 15176/2281756 gettoken [195] + 0.00 0.00 312/312 continue_ship [813] + 0.00 0.00 4259/4261 findbuildingtype [866] + 0.00 0.00 4259/4259 findshiptype [869] + 0.00 0.00 3086/24887945 locale_string [27] + 0.00 0.00 10600/1787006 findparam [458] + 0.00 0.00 10600/1027665 init_order [613] + 0.00 0.00 41/41 build_road [950] + 0.00 0.00 621/228907 getid [483] + 0.00 0.00 4259/191379 finditemtype [735] + 0.00 0.00 2/2 create_ship [1014] + 0.00 0.00 1543/13259934 resourcename [233] + 0.00 0.00 41/293362 get_direction [496] + 0.00 0.00 10/41248 msg_feedback [647] + 0.00 0.00 976/18647447 getplane [596] + 0.00 0.00 10/392959 add_message [434] + 0.00 0.00 10/1009028 msg_release [1373] +----------------------------------------------- + 0.01 0.02 1/1 movement [47] +[384] 0.1 0.01 0.02 1 init_transportation [384] + 0.02 0.00 1693146/55492327 getkeyword [54] + 0.00 0.00 145/282847 getunit [205] + 0.00 0.00 37/37 transport [1011] + 0.00 0.00 4/1437425 cansee [22] + 0.00 0.00 33/279395 weight [459] + 0.00 0.00 111/1027665 init_order [613] + 0.00 0.00 74/115276 can_move [736] + 0.00 0.00 4/41248 msg_feedback [647] + 0.00 0.00 74/1629412 LongHunger [536] + 0.00 0.00 4/15102 cmistake [718] + 0.00 0.00 20/779419 a_add [555] + 0.00 0.00 4/392959 add_message [434] + 0.00 0.00 20/779868 a_new [1376] + 0.00 0.00 4/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1/1177511 giveitem_read [1262] + 0.00 0.00 7/1177511 has_ao_healing [1269] + 0.00 0.00 9/1177511 default_spoil [1144] + 0.00 0.00 15/1177511 init_oldpotions [1235] + 0.00 0.00 66/1177511 add_items [1169] + 0.00 0.00 121/1177511 tolua_unit_add_item [1103] + 0.00 0.00 185/1177511 it_get_or_create [1115] + 0.00 0.00 242/1177511 canfly [1031] + 0.00 0.00 47287/1177511 canswim [682] + 0.00 0.00 85655/1177511 movement_speed [155] + 0.00 0.01 448447/1177511 read_items [320] + 0.00 0.01 595476/1177511 rotting_herbs [284] +[385] 0.1 0.00 0.03 1177511 it_find [385] + 0.02 0.00 1177511/1177511 it_alias [453] + 0.01 0.00 1177511/2032164 rt_find [597] +----------------------------------------------- + 0.00 0.00 61444/745269 cb_add_seen [94] + 0.00 0.00 87604/745269 prepare_lighthouse [340] + 0.01 0.01 596221/745269 prepare_report [8] +[386] 0.1 0.01 0.02 745269 add_seen_nb [386] + 0.01 0.00 745269/1087065 get_neighbours [480] + 0.00 0.00 1490538/3383689 update_interval [551] + 0.00 0.00 1014205/1014205 add_seen [1372] +----------------------------------------------- + 0.00 0.00 17247/435022 teach_cmd [272] + 0.00 0.02 417775/435022 study_cmd [105] +[387] 0.1 0.00 0.03 435022 getskill [387] + 0.00 0.01 435022/2281756 gettoken [195] + 0.00 0.00 435012/996009 get_skill [423] +----------------------------------------------- + 0.00 0.00 13/840577 read_planes [1164] + 0.00 0.00 233/840577 readfaction [767] + 0.00 0.00 1694/840577 read_groups [782] + 0.00 0.00 65258/840577 read_game [62] + 0.00 0.01 178254/840577 readregion [209] + 0.00 0.02 595125/840577 read_unit [74] +[388] 0.1 0.00 0.03 840577 read_attribs [388] + 0.00 0.03 840577/840577 a_read_orig [389] + 0.00 0.00 1/1 a_upgradekeys [1314] +----------------------------------------------- + 0.00 0.03 840577/840577 read_attribs [388] +[389] 0.1 0.00 0.03 840577 a_read_orig [389] + 0.00 0.03 251814/251814 a_read_i [390] + 0.00 0.00 251814/251874 __at_hashkey [3279] +----------------------------------------------- + 0.00 0.03 251814/251814 a_read_orig [389] +[390] 0.1 0.00 0.03 251814 a_read_i [390] + 0.00 0.01 39836/39836 read_of [524] + 0.01 0.00 251814/251814 at_find [563] + 0.00 0.00 251365/779419 a_add [555] + 0.00 0.00 4020/4020 curse_read [770] + 0.00 0.00 1557/1557 read_handler [799] + 0.00 0.00 1138/1138 read_targetregion [870] + 0.00 0.00 760/760 read_familiar [893] + 0.00 0.00 760/760 read_magician [894] + 0.00 0.00 2491/2491 a_readeffect [1052] + 0.00 0.00 449/454395 a_free [558] + 0.00 0.00 2/2 wormhole_read [1238] + 0.00 0.00 251814/779868 a_new [1376] + 0.00 0.00 58412/58518 a_readint [1448] + 0.00 0.00 56503/56503 read_group [1451] + 0.00 0.00 34382/34382 a_readshorts [1474] + 0.00 0.00 34220/34220 shiptrail_read [1475] + 0.00 0.00 8191/8191 read_seenspell [1522] + 0.00 0.00 7085/7085 a_readprivate [1531] + 0.00 0.00 2091/2091 read_mage [1559] + 0.00 0.00 136/136 a_readstring [1642] + 0.00 0.00 106/106 a_readkey [1648] + 0.00 0.00 68/68 a_readchars [1660] + 0.00 0.00 56/56 dict_read [1676] +----------------------------------------------- + 0.00 0.03 1/1 quit [276] +[391] 0.1 0.00 0.03 1 remove_idle_players [391] + 0.02 0.01 1/1 destroyfaction [392] + 0.00 0.00 231/231 RemoveNMRNewbie [1171] + 0.00 0.00 1/3902878 get_monsters [293] + 0.00 0.00 1/27 NMRTimeout [1264] + 0.00 0.00 1/1 nmr_death [1333] + 0.00 0.00 2/64 log_info [1339] +----------------------------------------------- + 0.02 0.01 1/1 remove_idle_players [391] +[392] 0.1 0.02 0.01 1 destroyfaction [392] + 0.01 0.00 595441/51974272 a_find [65] + 0.00 0.00 9/1803 gift_items [891] + 0.00 0.00 9/264251 rsetpeasants [545] + 0.00 0.00 1/40046 rule_stealth_other [530] + 0.00 0.00 9/7120688 get_money [187] + 0.00 0.00 9/2605004 rpeasants [435] + 0.00 0.00 18/129167539 u_race [89] + 0.00 0.00 9/2186159 rsetmoney [553] + 0.00 0.00 9/4666665 rmoney [452] + 0.00 0.00 39954/1380007 get_otherfaction [1362] + 0.00 0.00 9/1160345 rhorses [1369] + 0.00 0.00 9/257693 rsethorses [1408] + 0.00 0.00 9/603524 set_number [1387] + 0.00 0.00 1/1342832 handle_event [1363] + 0.00 0.00 1/1 funhash [1806] +----------------------------------------------- + 0.00 0.02 843545/843545 parse_symbol [42] +[393] 0.1 0.00 0.02 843545 eval_if [393] + 0.02 0.00 2530635/13102790 opstack_pop [176] + 0.01 0.00 843545/13102790 opstack_push [202] +----------------------------------------------- + 0.00 0.00 9/178263 melt_iceberg [1082] + 0.01 0.01 178254/178263 icebergs [285] +[394] 0.1 0.01 0.01 178263 drown [394] + 0.01 0.00 127590/1375380 remove_empty_units_in_region [134] + 0.00 0.00 7544/47287 canswim [682] + 0.00 0.00 7560/71815034 get_race [12] + 0.00 0.00 7560/129167539 u_race [89] + 0.00 0.00 3/967784 msg_message [132] + 0.00 0.00 3/242 canfly [1031] + 0.00 0.00 3/392959 add_message [434] + 0.00 0.00 3/3178 scale_number [969] + 0.00 0.00 3/1009028 msg_release [1373] +----------------------------------------------- + 0.01 0.01 1336242/1336242 rng_injectable_double [396] +[395] 0.1 0.01 0.01 1336242 genrand_real2 [395] + 0.01 0.00 1336242/11253756 genrand_int32 [150] +----------------------------------------------- + 0.00 0.00 58/1336242 peasant_luck_effect [984] + 0.00 0.00 1016/1336242 regeneration [942] + 0.00 0.00 7074/1336242 immigration [294] + 0.00 0.00 25985/1336242 plagues [781] + 0.00 0.00 30250/1336242 peasants [658] + 0.00 0.00 32878/1336242 demographics [50] + 0.00 0.00 83094/1336242 ntimespprob [723] + 0.00 0.01 403284/1336242 normalvariate [376] + 0.00 0.01 752603/1336242 chance [495] +[396] 0.1 0.00 0.02 1336242 rng_injectable_double [396] + 0.01 0.01 1336242/1336242 genrand_real2 [395] +----------------------------------------------- + 0.00 0.01 104830/218422 cr_output_building [239] + 0.00 0.01 113592/218422 nr_building [141] +[397] 0.1 0.00 0.02 218422 report_building [397] + 0.01 0.01 218422/218425 buildingtype [414] + 0.00 0.00 218422/1106528 is_building_type [554] +----------------------------------------------- + 0.01 0.01 655564/655564 parse_symbol [42] +[398] 0.1 0.01 0.01 655564 eval_eq [398] + 0.01 0.00 1311128/13102790 opstack_pop [176] + 0.00 0.00 655564/13102790 opstack_push [202] +----------------------------------------------- + 0.00 0.02 1/1 tolua_write_reports [1] +[399] 0.1 0.00 0.02 1 init_reports [399] + 0.02 0.00 178254/178254 reorder_units [400] + 0.00 0.00 1/1 check_messages_exist [1141] + 0.00 0.00 1/2 create_directories [1294] +----------------------------------------------- + 0.02 0.00 178254/178254 init_reports [399] +[400] 0.1 0.02 0.00 178254 reorder_units [400] + 0.00 0.00 37894/593636 building_owner [232] + 0.00 0.00 18974/3358315 ship_owner [438] +----------------------------------------------- + 0.00 0.02 1766225/1766225 nr_curses [48] +[401] 0.1 0.00 0.02 1766225 nr_curses_i [401] + 0.00 0.01 15186/1380398 nr_render [25] + 0.01 0.00 15186/2742237 paragraph [26] + 0.00 0.00 13217/26045 msg_curse [664] + 0.00 0.00 2069/967784 msg_message [132] + 0.00 0.00 15186/2494242 newline [594] + 0.00 0.00 15186/1009028 msg_release [1373] + 0.00 0.00 13217/26045 curse_cansee [1489] +----------------------------------------------- + 0.00 0.02 754/754 new_units [282] +[402] 0.1 0.00 0.02 754 checkunitnumber [402] + 0.02 0.00 754/2247 count_faction [219] + 0.00 0.00 754/754 rule_alliance_limit [1332] + 0.00 0.00 754/1214 rule_faction_limit [1331] +----------------------------------------------- + 0.00 0.00 12778/96637 canwalk [633] + 0.00 0.02 83859/96637 reduce_weight [404] +[403] 0.1 0.00 0.02 96637 walkingcapacity [403] + 0.00 0.01 179414/12320804 effskill [100] + 0.00 0.00 96637/71815034 get_race [12] + 0.00 0.00 96637/5395063 i_get [130] + 0.00 0.00 96637/2858912 get_effect [225] + 0.00 0.00 193274/2032164 rt_find [597] + 0.00 0.00 193321/129167539 u_race [89] + 0.00 0.00 96637/96637 personcapacity [795] + 0.00 0.00 47/4984610 config_get_int [348] + 0.00 0.00 96637/130867 get_transporters [1431] +----------------------------------------------- + 0.00 0.00 136/83859 plan_dragon [273] + 0.00 0.02 83723/83859 monster_move [129] +[404] 0.1 0.00 0.02 83859 reduce_weight [404] + 0.00 0.02 83859/96637 walkingcapacity [403] + 0.00 0.00 83859/8302761 get_resource [99] + 0.00 0.00 83871/56052475 get_resourcetype [194] + 0.00 0.00 47/47 give_peasants [1060] + 0.00 0.00 12/931076 change_resource [240] +----------------------------------------------- + 0.02 0.00 1/1 randomevents [91] +[405] 0.1 0.02 0.00 1 godcurse [405] + 0.00 0.00 91155/12246335 ct_find [114] + 0.00 0.00 91155/10190660 get_curse [143] + 0.00 0.00 91155/4201030 curse_active [543] + 0.00 0.00 91155/651711 oldcursename [1381] +----------------------------------------------- + 0.02 0.00 472366/472366 produceexp_ex [323] +[406] 0.1 0.02 0.00 472366 produceexp_days [406] + 0.00 0.00 472366/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 249/1121103 make_movement_order [522] + 0.00 0.00 752/1121103 monster_attack [764] + 0.00 0.00 105106/1121103 monster_move [129] + 0.01 0.00 419518/1121103 plan_monsters [52] + 0.01 0.00 595478/1121103 monster_kills_peasants [230] +[407] 0.1 0.02 0.00 1121103 monster_is_waiting [407] + 0.00 0.00 1121103/129167539 u_race [89] +----------------------------------------------- + 0.00 0.02 116914/116914 battle_flee [352] +[408] 0.1 0.00 0.02 116914 fleechance [408] + 0.00 0.01 116914/116914 horse_fleeing_bonus [604] + 0.00 0.01 116914/12320804 effskill [100] + 0.00 0.00 116914/71815034 get_race [12] + 0.00 0.00 116914/51974272 a_find [65] + 0.00 0.00 116914/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 23/146997 equip_items [1121] + 0.00 0.00 60/146997 damage_unit [1044] + 0.00 0.00 174/146997 terraform_resources [986] + 0.00 0.00 1560/146997 equip_unit_mask [776] + 0.00 0.00 2491/146997 hunger [808] + 0.00 0.01 42157/146997 attack [84] + 0.00 0.02 100532/146997 terminate [242] +[409] 0.1 0.00 0.02 146997 dice_rand [409] + 0.02 0.00 146997/146997 term_eval [410] +----------------------------------------------- + 0.02 0.00 146997/146997 dice_rand [409] +[410] 0.1 0.02 0.00 146997 term_eval [410] + 0.00 0.00 204245/7641081 genrand_int31 [171] +----------------------------------------------- + 0.02 0.00 1/1 tolua_spawn_dragons [412] +[411] 0.1 0.02 0.00 1 spawn_dragons [411] + 0.00 0.00 139786/7641081 genrand_int31 [171] + 0.00 0.00 20/20 spawn_seaserpent [831] + 0.00 0.00 10/2889 create_unit [296] + 0.00 0.00 12205/21517 chaosfactor [1077] + 0.00 0.00 10/2375 equip_unit [775] + 0.00 0.00 10/967784 msg_message [132] + 0.00 0.00 10/2931 name_unit [803] + 0.00 0.00 10/361 regionname [987] + 0.00 0.00 10/392959 add_message [434] + 0.00 0.00 10/24887945 locale_string [27] + 0.00 0.00 10/10 nrand [1232] + 0.00 0.00 10/71815034 get_race [12] + 0.00 0.00 10/752645 chance [495] + 0.00 0.00 10/2818494 rc_name_s [260] + 0.00 0.00 20/129167539 u_race [89] + 0.00 0.00 1/3902879 get_or_create_monsters [292] + 0.00 0.00 10/49235 log_debug [1245] + 0.00 0.00 139323/1511812 newterrain [1359] + 0.00 0.00 10/2742 get_equipment [1551] + 0.00 0.00 10/1009028 msg_release [1373] +----------------------------------------------- + +[412] 0.1 0.00 0.02 tolua_spawn_dragons [412] + 0.02 0.00 1/1 spawn_dragons [411] +----------------------------------------------- + 0.00 0.00 111/284005 steal_cmd [766] + 0.00 0.00 147/284005 contact_cmd [965] + 0.00 0.00 900/284005 follow_unit [331] + 0.00 0.02 282847/284005 getunit [205] +[413] 0.1 0.00 0.02 284005 read_unitid [413] + 0.00 0.01 284005/2281756 gettoken [195] + 0.01 0.00 281303/688711 atoi36 [440] + 0.00 0.00 283968/534930 isparam [668] + 0.00 0.00 2665/2665 read_newunitid [739] +----------------------------------------------- + 0.00 0.00 3/218425 new_building [1059] + 0.01 0.01 218422/218425 report_building [397] +[414] 0.1 0.01 0.01 218425 buildingtype [414] + 0.00 0.01 112140/112140 castle_name [512] + 0.00 0.00 15060/1106528 is_building_type [554] +----------------------------------------------- + 0.02 0.00 1/1 tolua_update_guards [416] +[415] 0.1 0.02 0.00 1 update_guards [415] + 0.00 0.00 31357/55350 can_start_guarding [679] + 0.00 0.00 31351/51974272 a_find [65] + 0.00 0.00 6/337987 setguard [815] +----------------------------------------------- + +[416] 0.1 0.00 0.02 tolua_update_guards [416] + 0.02 0.00 1/1 update_guards [415] +----------------------------------------------- + 0.00 0.00 32670/669051 peasants [658] + 0.00 0.00 33139/669051 statistics [70] + 0.00 0.00 36937/669051 cr_output_region [10] + 0.00 0.00 127676/669051 describe [35] + 0.00 0.01 438629/669051 maxworkingpeasants [473] +[417] 0.1 0.00 0.02 669051 production [417] + 0.01 0.00 669051/12246335 ct_find [114] + 0.01 0.00 669051/10190660 get_curse [143] + 0.00 0.00 669051/4201030 curse_active [543] +----------------------------------------------- + 0.00 0.00 46184/839202 age_building [712] + 0.00 0.00 178254/839202 age_region [659] + 0.01 0.00 614764/839202 ageing [185] +[418] 0.1 0.02 0.00 839202 a_age [418] + 0.00 0.00 23562/451774 a_remove [366] + 0.00 0.00 106/106 age_reduceproduction [1017] + 0.00 0.00 2/2 wormhole_age [1130] + 0.00 0.00 37453/37453 shiptrail_age [1468] + 0.00 0.00 4052/4052 curse_age [1538] + 0.00 0.00 1522/1522 age_unit [1573] + 0.00 0.00 186/186 leftship_age [1635] +----------------------------------------------- + 0.00 0.02 230/230 report_plaintext [4] +[419] 0.1 0.00 0.02 230 allies [419] + 0.00 0.02 1888/1888 show_allies [429] + 0.00 0.00 1888/2742237 paragraph [26] + 0.00 0.00 1888/24887945 locale_string [27] + 0.00 0.00 1888/2494242 newline [594] +----------------------------------------------- + 0.00 0.00 1/459083 tolua_get_region [1296] + 0.00 0.00 5/459083 cast_cmd [760] + 0.00 0.00 125/459083 tpregion [1085] + 0.00 0.00 8892/459083 r_astral_to_standard [783] + 0.00 0.01 108425/459083 update_lighthouse [605] + 0.00 0.01 163381/459083 astralregions [329] + 0.00 0.01 178254/459083 readregion [209] +[420] 0.1 0.00 0.02 459083 findregion [420] + 0.02 0.00 459083/1006923 rfindhash [271] +----------------------------------------------- + 0.00 0.00 1/109785 wormhole_age [1130] + 0.00 0.00 2/109785 sp_enterastral [1045] + 0.00 0.00 2889/109785 create_unit [296] + 0.00 0.00 10653/109785 move_ship [374] + 0.00 0.02 96240/109785 travel_route [147] +[421] 0.1 0.00 0.02 109785 move_unit [421] + 0.00 0.02 106892/113844 translist [430] + 0.00 0.00 209/2887 leave [432] + 0.00 0.00 109781/3383689 update_interval [551] + 0.00 0.00 2889/760673 addlist [217] + 0.00 0.00 106892/337987 setguard [815] +----------------------------------------------- + 0.00 0.00 45/5065285 count_maxmigrants [730] + 0.00 0.00 80630/5065285 armor_bonus [819] + 0.01 0.01 4984610/5065285 config_get_int [348] +[422] 0.1 0.01 0.01 5065285 get_param_int [422] + 0.01 0.00 5065285/26776263 get_param [235] +----------------------------------------------- + 0.00 0.00 12/996009 forget_cmd [1093] + 0.00 0.00 435012/996009 getskill [387] + 0.01 0.01 560985/996009 create_data [252] +[423] 0.1 0.01 0.01 996009 get_skill [423] + 0.01 0.00 995991/4457785 transliterate [358] + 0.00 0.00 995991/4558423 get_translations [437] +----------------------------------------------- + 0.00 0.00 2/1297 summon_allies [925] + 0.00 0.02 1295/1297 join_battle [425] +[424] 0.1 0.00 0.02 1297 make_fighter [424] + 0.01 0.00 1297/1297 AllianceAuto [535] + 0.00 0.01 56927/546579 weapon_skill [221] + 0.00 0.00 863/3147 i_canuse [569] + 0.00 0.00 17902/7641081 genrand_int31 [171] + 0.00 0.00 2909/12320804 effskill [100] + 0.00 0.00 552/552 make_side [876] + 0.00 0.00 2594/83224 trollbelts [677] + 0.00 0.00 2594/5395063 i_get [130] + 0.00 0.00 1297/2858912 get_effect [225] + 0.00 0.00 7054/129167539 u_race [89] + 0.00 0.00 489/71815034 get_race [12] + 0.00 0.00 1593/51974272 a_find [65] + 0.00 0.00 406/12246335 ct_find [114] + 0.00 0.00 3891/56052475 get_resourcetype [194] + 0.00 0.00 406/10190660 get_curse [143] + 0.00 0.00 1729/4301501 statusrow [550] + 0.00 0.00 326/7910500 r_isforest [199] + 0.00 0.00 110533/110533 weapon_weight [1435] + 0.00 0.00 3531/2379316 resource2weapon [1353] + 0.00 0.00 1297/1297 add_tactics [1579] + 0.00 0.00 1295/1295 find_side [1581] + 0.00 0.00 768/1429 set_attacker [1576] + 0.00 0.00 314/314 CavalrySkill [1608] + 0.00 0.00 156/1380007 get_otherfaction [1362] +----------------------------------------------- + 0.00 0.00 345/3203 join_allies [693] + 0.00 0.02 2858/3203 start_battle [297] +[425] 0.1 0.00 0.02 3203 join_battle [425] + 0.00 0.02 1295/1297 make_fighter [424] + 0.00 0.00 1774/51974272 a_find [65] + 0.00 0.00 661/1429 set_attacker [1576] +----------------------------------------------- + 0.01 0.01 16132/16132 teach_cmd [272] +[426] 0.1 0.01 0.01 16132 teach_unit [426] + 0.01 0.00 1302/1302 academy_can_teach [527] + 0.00 0.00 11749/779419 a_add [555] + 0.00 0.00 16132/51974272 a_find [65] + 0.00 0.00 16132/16132 magic_lowskill [897] + 0.00 0.00 11749/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 99/597806 eff_spelllevel [845] + 0.00 0.00 365/597806 unit_getspell [758] + 0.00 0.00 492/597806 u_hasspell [951] + 0.00 0.00 1711/597806 cr_output_spells [639] + 0.00 0.02 595139/597806 bufunit [17] +[427] 0.1 0.00 0.02 597806 unit_get_spellbook [427] + 0.00 0.02 597806/2426021 get_mage [198] + 0.00 0.00 2972/3203 faction_get_spellbook [1543] +----------------------------------------------- + 0.00 0.02 230/230 report_computer [9] +[428] 0.1 0.00 0.02 230 report_crtypes [428] + 0.02 0.00 7964/7964 nrt_string [443] + 0.00 0.00 7964/5168717 nrt_find [98] + 0.00 0.00 7964/618305 escape_string [556] + 0.00 0.00 7964/7964 nrt_section [1524] +----------------------------------------------- + 0.00 0.02 1888/1888 allies [419] +[429] 0.1 0.00 0.02 1888 show_allies [429] + 0.01 0.00 110660/10375491 alliedgroup [34] + 0.01 0.00 293954/34611296 strlcpy [45] + 0.00 0.00 65837/24887945 locale_string [27] + 0.00 0.00 55330/1295787 factionname [247] + 0.00 0.00 293954/36653945 wrptr [178] +----------------------------------------------- + 0.00 0.00 6952/113844 move_ship [374] + 0.00 0.02 106892/113844 move_unit [421] +[430] 0.1 0.00 0.02 113844 translist [430] + 0.01 0.00 113844/760673 addlist [217] + 0.01 0.00 113844/113845 choplist [565] +----------------------------------------------- + 0.00 0.00 3/252 farcasting [842] + 0.00 0.02 249/252 plan_dragon [273] +[431] 0.1 0.00 0.02 252 path_exists [431] + 0.01 0.01 252/388 internal_path_find [345] +----------------------------------------------- + 0.00 0.00 2/2887 summon_allies [925] + 0.00 0.00 2/2887 create_ship [1014] + 0.00 0.00 9/2887 build_building [696] + 0.00 0.00 136/2887 aftermath [701] + 0.00 0.00 191/2887 enter_ship [733] + 0.00 0.00 209/2887 move_unit [421] + 0.00 0.00 222/2887 leave_cmd [721] + 0.00 0.00 323/2887 enter_building [695] + 0.01 0.01 1793/2887 remove_unit [499] +[432] 0.1 0.01 0.01 2887 leave [432] + 0.00 0.01 224/224 leave_ship [540] + 0.00 0.00 1125/1125 leave_building [1009] + 0.00 0.00 734/95593 can_leave [1112] +----------------------------------------------- + 0.00 0.00 404/418134 academy_can_teach [527] + 0.02 0.00 417730/418134 study_cmd [105] +[433] 0.1 0.02 0.00 418134 study_cost [433] + 0.00 0.00 724/45891 get_level [934] + 0.00 0.00 29/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 1/392959 report_action [860] + 0.00 0.00 1/392959 sp_summon_familiar [1025] + 0.00 0.00 1/392959 sp_summonshadowlords [1034] + 0.00 0.00 1/392959 allocate_resource [752] + 0.00 0.00 1/392959 plant [1184] + 0.00 0.00 1/392959 planttrees [1206] + 0.00 0.00 1/392959 breedtrees [1148] + 0.00 0.00 1/392959 promotion_cmd [917] + 0.00 0.00 1/392959 age_stonecircle [1021] + 0.00 0.00 1/392959 verify_building [1255] + 0.00 0.00 1/392959 cast_cmd [760] + 0.00 0.00 1/392959 use_skillpotion [1233] + 0.00 0.00 2/392959 msg_to_ship_inmates [1286] + 0.00 0.00 2/392959 travel [81] + 0.00 0.00 2/392959 sp_bloodsacrifice [1209] + 0.00 0.00 2/392959 sp_charmingsong [993] + 0.00 0.00 2/392959 magic [157] + 0.00 0.00 2/392959 create_icebergs [538] + 0.00 0.00 2/392959 make_wormhole [1150] + 0.00 0.00 3/392959 begin_potion [1096] + 0.00 0.00 3/392959 give_control_cmd [287] + 0.00 0.00 3/392959 drown [394] + 0.00 0.00 3/392959 melt_iceberg [1082] + 0.00 0.00 3/392959 use_healingpotion [1119] + 0.00 0.00 4/392959 wormhole_age [1130] + 0.00 0.00 4/392959 caught_target [1003] + 0.00 0.00 4/392959 init_transportation [384] + 0.00 0.00 4/392959 make_route [289] + 0.00 0.00 4/392959 ship_ready [354] + 0.00 0.00 4/392959 give_men [857] + 0.00 0.00 4/392959 quit [276] + 0.00 0.00 4/392959 move_iceberg [1094] + 0.00 0.00 4/392959 factionorders [983] + 0.00 0.00 5/392959 buy [707] + 0.00 0.00 5/392959 sp_flying_ship [1064] + 0.00 0.00 6/392959 msg_send_region [1210] + 0.00 0.00 10/392959 make_cmd [383] + 0.00 0.00 10/392959 tax_cmd [697] + 0.00 0.00 10/392959 spy_cmd [990] + 0.00 0.00 10/392959 spawn_dragons [411] + 0.00 0.00 12/392959 sp_summonundead [896] + 0.00 0.00 12/392959 forget_cmd [1093] + 0.00 0.00 13/392959 volcano_destruction [1022] + 0.00 0.00 15/392959 do_fumble [1062] + 0.00 0.00 19/392959 enter_building [695] + 0.00 0.00 22/392959 spy_message [1038] + 0.00 0.00 24/392959 cancast [833] + 0.00 0.00 33/392959 travel_i [92] + 0.00 0.00 37/392959 volcano_update [981] + 0.00 0.00 37/392959 build_road [950] + 0.00 0.00 38/392959 expandstealing [807] + 0.00 0.00 39/392959 deliverMail [966] + 0.00 0.00 39/392959 display_item [1054] + 0.00 0.00 39/392959 random_growl [1065] + 0.00 0.00 41/392959 dissolve_units [241] + 0.00 0.00 47/392959 caddmessage [1070] + 0.00 0.00 51/392959 potion_water_of_life [945] + 0.00 0.00 51/392959 chaos [848] + 0.00 0.00 55/392959 nmr_warnings [878] + 0.00 0.00 56/392959 use_bloodpotion [935] + 0.00 0.00 57/392959 start_battle [297] + 0.00 0.00 58/392959 add_recruits [371] + 0.00 0.00 76/392959 steal_cmd [766] + 0.00 0.00 84/392959 do_work [612] + 0.00 0.00 88/392959 hunger [808] + 0.00 0.00 100/392959 age_reduceproduction [1017] + 0.00 0.00 110/392959 peasants [658] + 0.00 0.00 115/392959 build_ship [839] + 0.00 0.00 119/392959 syntax_error [1036] + 0.00 0.00 120/392959 plagues [781] + 0.00 0.00 121/392959 msg_send_faction [1042] + 0.00 0.00 149/392959 create_potion [821] + 0.00 0.00 170/392959 breedhorses [742] + 0.00 0.00 170/392959 guard_on_cmd [656] + 0.00 0.00 266/392959 spawn_undead [629] + 0.00 0.00 328/392959 mail_cmd [844] + 0.00 0.00 345/392959 end_potion [814] + 0.00 0.00 349/392959 research_cmd [886] + 0.00 0.00 377/392959 manufacture [759] + 0.00 0.00 508/392959 regenerate_aura [346] + 0.00 0.00 567/392959 eaten_by_monster [468] + 0.00 0.00 581/392959 build_building [696] + 0.00 0.00 681/392959 absorbed_by_monster [804] + 0.00 0.00 1225/392959 give_item [126] + 0.00 0.00 1323/392959 teach_cmd [272] + 0.00 0.00 2699/392959 scared_by_monster [380] + 0.00 0.00 2938/392959 split_allocations [743] + 0.00 0.00 5049/392959 piracy_cmd [660] + 0.00 0.00 5966/392959 herbsearch [493] + 0.00 0.00 7043/392959 sail [181] + 0.00 0.00 8710/392959 maintain_buildings [339] + 0.00 0.00 8797/392959 cmistake [718] + 0.00 0.00 11358/392959 expandbuying [49] + 0.00 0.00 12265/392959 r_addmessage [779] + 0.00 0.00 12448/392959 expandselling [93] + 0.00 0.00 14939/392959 maintain [478] + 0.00 0.00 20258/392959 study_cmd [105] + 0.00 0.00 29028/392959 give_cmd [102] + 0.00 0.00 31214/392959 message_faction [716] + 0.00 0.00 34409/392959 add_income [625] + 0.00 0.00 80478/392959 add_give [379] + 0.00 0.00 96460/392959 travel_route [147] +[434] 0.1 0.02 0.00 392959 add_message [434] + 0.00 0.00 392959/392959 msg_addref [1399] +----------------------------------------------- + 0.00 0.00 9/2605004 destroyfaction [392] + 0.00 0.00 19/2605004 dissolve_units [241] + 0.00 0.00 30/2605004 res_changepeasants [1200] + 0.00 0.00 45/2605004 region_getresource [1058] + 0.00 0.00 71/2605004 transfermen [899] + 0.00 0.00 74/2605004 plan_dragon [273] + 0.00 0.00 120/2605004 plagues [781] + 0.00 0.00 172/2605004 randomevents [91] + 0.00 0.00 246/2605004 battle_effects [1125] + 0.00 0.00 1594/2605004 expandrecruit [349] + 0.00 0.00 2692/2605004 eaten_by_monster [468] + 0.00 0.00 3455/2605004 absorbed_by_monster [804] + 0.00 0.00 4690/2605004 expandselling [93] + 0.00 0.00 5494/2605004 expandbuying [49] + 0.00 0.00 6569/2605004 scareaway [768] + 0.00 0.00 14863/2605004 sell [498] + 0.00 0.00 31670/2605004 spawn_undead [629] + 0.00 0.00 32670/2605004 demographics [50] + 0.00 0.00 32670/2605004 writeregion [519] + 0.00 0.00 33139/2605004 statistics [70] + 0.00 0.00 54055/2605004 report_plaintext [4] + 0.00 0.00 67774/2605004 peasants [658] + 0.00 0.00 91145/2605004 report_resources [210] + 0.00 0.00 119504/2605004 cr_output_region [10] + 0.00 0.00 144763/2605004 calculate_emigration [603] + 0.00 0.00 178254/2605004 get_food [88] + 0.00 0.00 179832/2605004 describe [35] + 0.00 0.00 185509/2605004 immigration [294] + 0.00 0.00 255939/2605004 scared_by_monster [380] + 0.00 0.00 342640/2605004 expandwork [277] + 0.00 0.00 361137/2605004 produce [29] + 0.00 0.00 454160/2605004 make_summary [21] +[435] 0.1 0.02 0.00 2605004 rpeasants [435] +----------------------------------------------- + 0.00 0.00 71390/7417541 reserve_i [213] + 0.00 0.00 116873/7417541 weapon_effskill [168] + 0.00 0.00 771861/7417541 armedmen [151] + 0.00 0.00 1849529/7417541 get_pooled [104] + 0.01 0.00 4607888/7417541 use_pooled [39] +[436] 0.1 0.02 0.00 7417541 urace [436] +----------------------------------------------- + 0.00 0.00 1/4558423 get_translation [1304] + 0.00 0.00 2/4558423 register_special_direction [1259] + 0.00 0.00 2/4558423 init_directions [1143] + 0.00 0.00 2/4558423 init_terrains_translation [1129] + 0.00 0.00 2/4558423 init_options_translation [1157] + 0.00 0.00 4/4558423 init_locale [948] + 0.00 0.00 6/4558423 findoption [1241] + 0.00 0.00 6/4558423 init_translations [1033] + 0.00 0.00 6/4558423 free_locales [1311] + 0.00 0.00 107/4558423 init_keyword [1179] + 0.00 0.00 338/4558423 findrace [1030] + 0.00 0.00 293362/4558423 get_direction [496] + 0.00 0.00 995991/4558423 get_skill [423] + 0.01 0.00 1481616/4558423 get_keyword [274] + 0.01 0.00 1786978/4558423 findparam [458] +[437] 0.1 0.02 0.00 4558423 get_translations [437] +----------------------------------------------- + 0.00 0.00 1/3358315 move_iceberg [1094] + 0.00 0.00 2/3358315 restack_units [353] + 0.00 0.00 5/3358315 give_control_cmd [287] + 0.00 0.00 6/3358315 validate_pirate [1051] + 0.00 0.00 10/3358315 name_cmd [835] + 0.00 0.00 17/3358315 display_cmd [859] + 0.00 0.00 18/3358315 leave_ship [540] + 0.00 0.00 24/3358315 is_moving_ship [1231] + 0.00 0.00 31/3358315 renumber_cmd [780] + 0.00 0.00 195/3358315 mayboard [1046] + 0.00 0.00 322/3358315 piracy_cmd [660] + 0.00 0.00 475/3358315 follow_ship [749] + 0.00 0.00 1039/3358315 follow_unit [331] + 0.00 0.00 3128/3358315 drifting_ships [490] + 0.00 0.00 7093/3358315 report_template [87] + 0.00 0.00 7254/3358315 ship_ready [354] + 0.00 0.00 7269/3358315 move_cmd [66] + 0.00 0.00 15828/3358315 sinkships [475] + 0.00 0.00 17286/3358315 movement [47] + 0.00 0.00 18974/3358315 reorder_units [400] + 0.00 0.00 27416/3358315 write_unit [97] + 0.00 0.00 38156/3358315 score [23] + 0.00 0.00 66134/3358315 shipspeed [669] + 0.00 0.00 179761/3358315 cr_output_curses [69] + 0.00 0.00 179761/3358315 cr_output_region [10] + 0.00 0.00 180598/3358315 nr_curses [48] + 0.01 0.00 875741/3358315 count_cb [231] + 0.01 0.00 1731771/3358315 travelthru_cansee [180] +[438] 0.1 0.02 0.00 3358315 ship_owner [438] + 0.00 0.00 1511/1529 ship_owner_ex [1571] +----------------------------------------------- + 0.00 0.00 36/2903884 runhash [1247] + 0.00 0.00 1848/2903884 uunhash [1049] + 0.00 0.00 178290/2903884 rhash [737] + 0.00 0.00 598069/2903884 uhash [667] + 0.01 0.00 1006923/2903884 rfindhash [271] + 0.01 0.00 1118718/2903884 ufindhash [109] +[439] 0.1 0.02 0.00 2903884 jenkins_hash [439] +----------------------------------------------- + 0.00 0.00 2/688711 tolua_atoi36 [1299] + 0.00 0.00 3/688711 tolua_getkey [1281] + 0.00 0.00 4/688711 parse_ids [852] + 0.00 0.00 4/688711 forbiddenid [1280] + 0.00 0.00 5/688711 tolua_toid [1274] + 0.00 0.00 6/688711 addparam_building [1261] + 0.00 0.00 16/688711 addparam_unit [1214] + 0.00 0.00 22/688711 addparam_ship [1212] + 0.00 0.00 69/688711 renumber_cmd [780] + 0.00 0.00 209/688711 setstealth_cmd [182] + 0.01 0.00 178254/688711 tolua_region_getkey [628] + 0.01 0.00 228814/688711 getid [483] + 0.01 0.00 281303/688711 read_unitid [413] +[440] 0.1 0.02 0.00 688711 atoi36 [440] +----------------------------------------------- + 0.00 0.00 303/635885 create_castorder [1066] + 0.00 0.00 1670/635885 recruit [650] + 0.00 0.00 3110/635885 default_order [902] + 0.00 0.00 14326/635885 replace_order [526] + 0.00 0.00 41255/635885 var_copy_order [734] + 0.02 0.00 575221/635885 update_long_order [270] +[441] 0.1 0.02 0.00 635885 copy_order [441] +----------------------------------------------- + 0.02 0.00 178254/178254 new_region [275] +[442] 0.1 0.02 0.00 178254 hash_uid [442] +----------------------------------------------- + 0.02 0.00 7964/7964 report_crtypes [428] +[443] 0.1 0.02 0.00 7964 nrt_string [443] +----------------------------------------------- + 0.00 0.00 1/30 tolua_settings_eressea_settings_set00 [773] + 0.00 0.00 1/30 disable_feature [771] + 0.02 0.00 28/30 json_settings [467] +[444] 0.1 0.02 0.00 30 config_set [444] + 0.00 0.00 30/33 set_param [1689] +----------------------------------------------- + +[445] 0.1 0.02 0.00 bin_w_brk [445] +----------------------------------------------- + +[446] 0.1 0.02 0.00 bin_w_str [446] +----------------------------------------------- + +[447] 0.1 0.02 0.00 fs_readln [447] +----------------------------------------------- + +[448] 0.1 0.02 0.00 ql_push [448] +----------------------------------------------- + +[449] 0.1 0.02 0.00 tolua_unit_get_faction [449] +----------------------------------------------- + +[450] 0.1 0.02 0.00 wang_hash [450] +----------------------------------------------- + 0.00 0.00 2889/24935046 create_unit [296] + 0.00 0.00 4181205/24935046 remove_empty_units_in_region [134] + 0.02 0.00 20750952/24935046 alliedgroup [34] +[451] 0.1 0.02 0.00 24935046 faction_alive [451] +----------------------------------------------- + 0.00 0.00 9/4666665 destroyfaction [392] + 0.00 0.00 17/4666665 give_money [484] + 0.00 0.00 36/4666665 expandloot [816] + 0.00 0.00 38/4666665 gift_items [891] + 0.00 0.00 41/4666665 region_getresource [1058] + 0.00 0.00 59/4666665 get_money_for_dragon [1087] + 0.00 0.00 74/4666665 plan_dragon [273] + 0.00 0.00 4629/4666665 expandselling [93] + 0.00 0.00 12922/4666665 plagues [781] + 0.00 0.00 16560/4666665 expandentertainment [637] + 0.00 0.00 27694/4666665 all_money [529] + 0.00 0.00 31725/4666665 statistics [70] + 0.00 0.00 32670/4666665 peasants [658] + 0.00 0.00 32670/4666665 writeregion [519] + 0.00 0.00 36937/4666665 cr_output_region [10] + 0.00 0.00 79772/4666665 entertainmoney [643] + 0.00 0.00 91145/4666665 report_resources [210] + 0.00 0.00 97652/4666665 make_summary [21] + 0.00 0.00 178254/4666665 expandwork [277] + 0.00 0.00 222964/4666665 describe [35] + 0.00 0.00 356508/4666665 produce [29] + 0.00 0.00 394406/4666665 expandbuying [49] + 0.01 0.00 3049883/4666665 expandtax [278] +[452] 0.1 0.02 0.00 4666665 rmoney [452] +----------------------------------------------- + 0.02 0.00 1177511/1177511 it_find [385] +[453] 0.1 0.02 0.00 1177511 it_alias [453] +----------------------------------------------- + 0.02 0.00 162996/162996 astralregions [329] +[454] 0.1 0.02 0.00 162996 inhabitable [454] +----------------------------------------------- + 0.00 0.00 230/20836359 show_alliances_cr [1248] + 0.00 0.00 230/20836359 report_computer [9] + 0.00 0.00 460/20836359 report_plaintext [4] + 0.00 0.00 464/20836359 get_addresses [20] + 0.02 0.00 20834975/20836359 autoalliance [179] +[455] 0.1 0.02 0.00 20836359 f_get_alliance [455] +----------------------------------------------- + 0.02 0.00 10375461/10375461 alliedgroup [34] +[456] 0.1 0.02 0.00 10375461 ally_mode [456] +----------------------------------------------- + 0.00 0.00 1/1206547 tolua_get_region [1296] + 0.00 0.00 178254/1206547 readregion [209] + 0.02 0.00 1028292/1206547 koor_distance [476] +[457] 0.1 0.02 0.00 1206547 findplane [457] +----------------------------------------------- + 0.00 0.00 20/1787006 restack_units [353] + 0.00 0.00 115/1787006 combatspell_cmd [898] + 0.00 0.00 176/1787006 breed_cmd [741] + 0.00 0.00 322/1787006 cast_cmd [760] + 0.00 0.00 461/1787006 setstealth_cmd [182] + 0.00 0.00 677/1787006 ally_cmd [877] + 0.00 0.00 1700/1787006 status_cmd [904] + 0.00 0.00 6530/1787006 findparam_ex [926] + 0.00 0.00 7650/1787006 getparam [681] + 0.00 0.00 10600/1787006 make_cmd [383] + 0.00 0.00 15797/1787006 sell [498] + 0.00 0.00 45456/1787006 give_cmd [102] + 0.00 0.00 71388/1787006 reserve_i [213] + 0.00 0.00 279151/1787006 readorders [43] + 0.00 0.00 362487/1787006 isparam [668] + 0.00 0.01 984476/1787006 unitorders [46] +[458] 0.1 0.00 0.02 1787006 findparam [458] + 0.01 0.00 1786978/4457785 transliterate [358] + 0.01 0.00 1786978/4558423 get_translations [437] +----------------------------------------------- + 0.00 0.00 2/279395 sp_enterastral [1045] + 0.00 0.00 33/279395 init_transportation [384] + 0.00 0.00 34221/279395 eff_weight [683] + 0.00 0.00 70174/279395 getshipweight [212] + 0.01 0.01 174965/279395 cr_output_unit [19] +[459] 0.1 0.01 0.01 279395 weight [459] + 0.00 0.01 279395/5395063 i_get [130] + 0.00 0.00 279395/129167539 u_race [89] + 0.00 0.00 279395/56052475 get_resourcetype [194] +----------------------------------------------- + 0.00 0.02 1/1 tolua_config_eressea_config_read00 [461] +[460] 0.1 0.00 0.02 1 config_read [460] + 0.00 0.02 1/1 config_parse [462] + 0.00 0.00 1/573 join_path [1016] +----------------------------------------------- + +[461] 0.1 0.00 0.02 tolua_config_eressea_config_read00 [461] + 0.00 0.02 1/1 config_read [460] +----------------------------------------------- + 0.00 0.02 1/1 config_read [460] +[462] 0.1 0.00 0.02 1 config_parse [462] + 0.00 0.02 1/1 json_config [464] + 0.00 0.00 1/3 init_locales [947] +----------------------------------------------- +[463] 0.1 0.00 0.02 1+4 [463] + 0.00 0.02 4 json_config [464] + 0.00 0.00 1 json_include [1283] +----------------------------------------------- + 3 json_include [1283] + 0.00 0.02 1/1 config_parse [462] +[464] 0.1 0.00 0.02 4 json_config [464] + 0.00 0.02 1/1 json_settings [467] + 0.00 0.00 1/1 json_disable_features [772] + 0.00 0.00 1/1 json_keywords [1124] + 0.00 0.00 1/1 json_terrains [1190] + 0.00 0.00 4/5 reset_locales [1751] + 0.00 0.00 1/1 json_prefixes [1812] + 0.00 0.00 1/1 init_terrains [1810] + 1 json_include [1283] +----------------------------------------------- + 0.00 0.01 96240/192556 travel_route [147] + 0.00 0.01 96316/192556 movement_speed [155] +[465] 0.1 0.00 0.02 192556 canride [465] + 0.01 0.01 192556/12320804 effskill [100] + 0.00 0.00 21443/21443 ridingcapacity [694] + 0.00 0.00 21443/34221 eff_weight [683] + 0.00 0.00 577668/56052475 get_resourcetype [194] + 0.00 0.00 192570/129167539 u_race [89] +----------------------------------------------- + 0.01 0.01 967902/967902 travelthru_map [41] +[466] 0.1 0.01 0.01 967902 cb_cr_travelthru_unit [466] + 0.00 0.00 94066/1996097 travelthru_cansee [180] + 0.00 0.00 75486/2383101 unitname [142] +----------------------------------------------- + 0.00 0.02 1/1 json_config [464] +[467] 0.1 0.00 0.02 1 json_settings [467] + 0.02 0.00 28/30 config_set [444] +----------------------------------------------- + 0.01 0.01 325282/325282 monster_kills_peasants [230] +[468] 0.1 0.01 0.01 325282 eaten_by_monster [468] + 0.00 0.00 325282/7641081 genrand_int31 [171] + 0.00 0.00 325282/51974272 a_find [65] + 0.00 0.00 325282/129167539 u_race [89] + 0.00 0.00 325282/56052475 get_resourcetype [194] + 0.00 0.00 567/967784 msg_message [132] + 0.00 0.00 1714/201744 lovar [644] + 0.00 0.00 567/392959 add_message [434] + 0.00 0.00 567/264251 rsetpeasants [545] + 0.00 0.00 2692/2605004 rpeasants [435] + 0.00 0.00 567/37974 deathcounts [843] + 0.00 0.00 567/1009028 msg_release [1373] + 0.00 0.00 1/1511812 newterrain [1359] +----------------------------------------------- + 0.00 0.01 3114/10344 drifting_ships [490] + 0.00 0.01 7230/10344 ship_ready [354] +[469] 0.1 0.00 0.02 10344 cansail [469] + 0.02 0.00 10344/47902 getshipweight [212] + 0.00 0.00 10344/47887 shipcapacity [567] +----------------------------------------------- + 0.00 0.00 160572/4503145 cr_output_ship [152] + 0.00 0.00 761036/4503145 bufunit [17] + 0.00 0.01 1335533/4503145 cansee [22] + 0.00 0.01 2246004/4503145 cr_output_unit [19] +[470] 0.1 0.00 0.02 4503145 omniscient [470] + 0.02 0.00 4503145/12560453 rc_changed [256] + 0.00 0.00 2/71815034 get_race [12] +----------------------------------------------- + 0.00 0.00 7/892307 use_skillpotion [1233] + 0.00 0.00 167/892307 academy_teaching_bonus [1128] + 0.00 0.00 2190/892307 demon_skillchange [826] + 0.00 0.01 417577/892307 study_cmd [105] + 0.00 0.01 472366/892307 produceexp_ex [323] +[471] 0.1 0.00 0.02 892307 learn_skill [471] + 0.00 0.01 45090/47535 sk_set [510] + 0.00 0.01 479588/7641081 genrand_int31 [171] + 0.00 0.00 2423/1956810 add_skill [355] + 0.00 0.00 447624/595705 unit_skill [1391] +----------------------------------------------- + 0.00 0.02 123513/123513 parse_symbol [42] +[472] 0.1 0.00 0.02 123513 eval_order [472] + 0.00 0.01 123513/1470505 write_order [121] + 0.00 0.00 123513/13102790 opstack_pop [176] + 0.00 0.00 123513/13102790 opstack_push [202] + 0.00 0.00 123513/13399069 balloc [363] +----------------------------------------------- + 0.00 0.00 17728/438629 immigration [294] + 0.00 0.00 32670/438629 horses [330] + 0.00 0.00 65214/438629 demographics [50] + 0.00 0.01 144763/438629 calculate_emigration [603] + 0.00 0.01 178254/438629 produce [29] +[473] 0.1 0.00 0.02 438629 maxworkingpeasants [473] + 0.00 0.01 438629/669051 production [417] + 0.00 0.00 877258/10053919 rtrees [302] +----------------------------------------------- + 0.00 0.00 1/369586 tolua_region_get_next [1302] + 0.00 0.00 1/369586 move_iceberg [1094] + 0.00 0.00 1/369586 rroad [508] + 0.00 0.00 8/369586 sail [181] + 0.00 0.00 8/369586 rrandneighbour [1221] + 0.00 0.00 10/369586 terraform_region [932] + 0.00 0.00 15/369586 chaos [848] + 0.00 0.00 36/369586 build_road [950] + 0.00 0.00 58/369586 drift_target [1053] + 0.00 0.00 291/369586 describe [35] + 0.00 0.00 2656/369586 scareaway [768] + 0.00 0.00 5134/369586 horses [330] + 0.00 0.00 10913/369586 movewhere [350] + 0.00 0.00 21148/369586 piracy_cmd [660] + 0.00 0.00 25793/369586 regions_in_range [675] + 0.00 0.00 46456/369586 calculate_emigration [603] + 0.00 0.00 51044/369586 cr_borders [135] + 0.00 0.00 67291/369586 internal_path_find [345] + 0.00 0.01 138722/369586 get_neighbours [480] +[474] 0.1 0.00 0.02 369586 r_connect [474] + 0.01 0.00 369586/1006923 rfindhash [271] + 0.00 0.00 369586/18647447 getplane [596] + 0.00 0.00 369586/3587241 pnormalize [1350] +----------------------------------------------- + 0.01 0.01 178254/178254 process [7] +[475] 0.1 0.01 0.01 178254 sinkships [475] + 0.01 0.00 3135/13500 crew_skill [344] + 0.00 0.00 15828/3358315 ship_owner [438] + 0.00 0.00 96/717218 config_get_flt [714] + 0.00 0.00 3135/13500 enoughsailors [1512] + 0.00 0.00 96/160 damage_ship [1641] + 0.00 0.00 5/6 remove_ship [1748] +----------------------------------------------- + 0.00 0.00 220/514146 farcasting [842] + 0.00 0.01 214975/514146 astralregions [329] + 0.00 0.01 298951/514146 distance [599] +[476] 0.0 0.00 0.02 514146 koor_distance [476] + 0.02 0.00 1028292/1206547 findplane [457] + 0.00 0.00 512674/734392 plane_width [1380] + 0.00 0.00 512674/734392 plane_height [1379] + 0.00 0.00 512663/512663 koor_distance_orig [1394] + 0.00 0.00 11/11 koor_distance_wrap_xy [1724] +----------------------------------------------- + 0.00 0.00 19276/146950 eval_trail [634] + 0.00 0.01 127674/146950 eval_trailto [369] +[477] 0.0 0.00 0.02 146950 f_regionid_s [477] + 0.00 0.02 146950/950595 f_regionid [161] +----------------------------------------------- + 0.00 0.02 44190/44190 maintain_buildings [339] +[478] 0.0 0.00 0.02 44190 maintain [478] + 0.00 0.01 13492/541982 get_pooled [104] + 0.00 0.00 6386/860263 use_pooled [39] + 0.00 0.00 14939/967784 msg_message [132] + 0.00 0.00 21463/593636 building_owner [232] + 0.00 0.00 14939/392959 add_message [434] + 0.00 0.00 6524/216069 config_token [794] + 0.00 0.00 14939/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 125/987488 tpregion [1085] + 0.00 0.00 125/987488 r_standard_to_astral [1067] + 0.00 0.00 8892/987488 r_astral_to_standard [783] + 0.00 0.00 17784/987488 astralregions [329] + 0.00 0.00 38612/987488 cr_output_region [10] + 0.00 0.00 62581/987488 describe [35] + 0.00 0.00 85643/987488 movement_speed [155] + 0.00 0.00 178254/987488 spawn_braineaters [505] + 0.00 0.01 595472/987488 age_unit [336] +[479] 0.0 0.00 0.02 987488 is_astral [479] + 0.00 0.02 987488/987612 get_astralplane [482] + 0.00 0.00 987488/18647447 getplane [596] +----------------------------------------------- + 0.00 0.00 30/1087065 treeman_neighbour [1201] + 0.00 0.00 84017/1087065 random_neighbour [153] + 0.00 0.00 88016/1087065 get_regions_distance [372] + 0.00 0.00 169733/1087065 travelthru_add [609] + 0.01 0.00 745269/1087065 add_seen_nb [386] +[480] 0.0 0.01 0.01 1087065 get_neighbours [480] + 0.00 0.01 138722/369586 r_connect [474] +----------------------------------------------- + 0.00 0.00 66416/2765718 peasants [658] + 0.00 0.00 178254/2765718 immigration [294] + 0.01 0.01 2521048/2765718 lifestyle [286] +[481] 0.0 0.01 0.01 2765718 maintenance_cost [481] + 0.01 0.00 2521048/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 124/987612 age_stonecircle [1021] + 0.00 0.02 987488/987612 is_astral [479] +[482] 0.0 0.00 0.02 987612 get_astralplane [482] + 0.01 0.00 987612/987612 getplanebyname [595] + 0.00 0.00 987612/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 20/228907 restack_units [353] + 0.00 0.00 22/228907 mail_cmd [844] + 0.00 0.00 287/228907 factionorders [983] + 0.00 0.00 307/228907 getship [1018] + 0.00 0.00 474/228907 follow_ship [749] + 0.00 0.00 525/228907 follow_unit [331] + 0.00 0.00 621/228907 make_cmd [383] + 0.00 0.00 639/228907 do_enter [128] + 0.00 0.00 754/228907 new_units [282] + 0.00 0.00 791/228907 getfaction [937] + 0.00 0.00 2665/228907 read_newunitid [739] + 0.00 0.01 221802/228907 unitorders [46] +[483] 0.0 0.00 0.02 228907 getid [483] + 0.00 0.01 228907/2281756 gettoken [195] + 0.01 0.00 228814/688711 atoi36 [440] +----------------------------------------------- + 0.02 0.00 51003/51003 give_item [126] +[484] 0.0 0.02 0.00 51003 give_money [484] + 0.00 0.00 22/860263 use_pooled [39] + 0.00 0.00 22/283711 item2resource [561] + 0.00 0.00 17/2186159 rsetmoney [553] + 0.00 0.00 17/4666665 rmoney [452] +----------------------------------------------- + 0.02 0.00 464/464 prepare_report [8] +[485] 0.0 0.02 0.00 464 firstregion [485] +----------------------------------------------- + 0.00 0.01 40/40 plan_dragon [273] +[486] 0.0 0.00 0.01 40 set_new_dragon_target [486] + 0.00 0.01 27694/27694 dragon_affinity_value [516] + 0.00 0.00 40/40 regions_in_range [675] + 0.00 0.00 25/779419 a_add [555] + 0.00 0.00 26/51974272 a_find [65] + 0.00 0.00 25/25 make_targetregion [1701] +----------------------------------------------- + 0.00 0.01 230/481 report_plaintext [4] + 0.00 0.01 251/481 out_faction [615] +[487] 0.0 0.00 0.01 481 count_units [487] + 0.01 0.00 481/2247 count_faction [219] +----------------------------------------------- + 0.00 0.01 110167/110167 cr_render [196] +[488] 0.0 0.00 0.01 110167 cr_resource [488] + 0.00 0.01 110167/4434556 translate [75] + 0.00 0.00 110167/24887945 locale_string [27] + 0.00 0.00 110167/13259934 resourcename [233] +----------------------------------------------- + 0.01 0.00 41095/41095 cr_render [196] +[489] 0.0 0.01 0.00 41095 cr_order [489] + 0.00 0.00 41086/2006524 get_command [108] +----------------------------------------------- + 0.00 0.01 178254/178254 movement [47] +[490] 0.0 0.00 0.01 178254 drifting_ships [490] + 0.01 0.00 3115/13500 crew_skill [344] + 0.00 0.01 3114/10344 cansail [469] + 0.00 0.00 178254/4984610 config_get_int [348] + 0.00 0.00 178254/717218 config_get_flt [714] + 0.00 0.00 3116/12320804 effskill [100] + 0.00 0.00 15/6963 move_ship [374] + 0.00 0.00 15/15 overload [1002] + 0.00 0.00 3128/3358315 ship_owner [438] + 0.00 0.00 15/15 drift_target [1053] + 0.00 0.00 12/967784 msg_message [132] + 0.00 0.00 22/12246335 ct_find [114] + 0.00 0.00 15/6962 set_coast [875] + 0.00 0.00 22/10190660 get_curse [143] + 0.00 0.00 12/12 msg_to_ship_inmates [1286] + 0.00 0.00 30/30 overload_start [1295] + 0.00 0.00 22/4201030 curse_active [543] + 0.00 0.00 3115/13500 enoughsailors [1512] + 0.00 0.00 22/651711 oldcursename [1381] + 0.00 0.00 15/192815 add_regionlist [1419] + 0.00 0.00 15/109377 free_regionlist [1436] + 0.00 0.00 15/160 damage_ship [1641] + 0.00 0.00 1/6 remove_ship [1748] +----------------------------------------------- + 0.00 0.00 17117/137709 terminate [242] + 0.00 0.01 120592/137709 weapon_effskill [168] +[491] 0.0 0.00 0.01 137709 CavalryBonus [491] + 0.00 0.01 137709/12320804 effskill [100] + 0.00 0.00 120592/71815034 get_race [12] + 0.00 0.00 120592/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 1/461 promotion_cmd [917] + 0.00 0.01 230/461 report_computer [9] + 0.00 0.01 230/461 report_plaintext [4] +[492] 0.0 0.00 0.01 461 maxheroes [492] + 0.00 0.01 461/967 count_all [357] +----------------------------------------------- + 0.00 0.01 5988/5988 make_cmd [383] +[493] 0.0 0.00 0.01 5988 herbsearch [493] + 0.00 0.01 5986/15361 is_guarded [377] + 0.00 0.00 5966/5966 ntimespprob [723] + 0.00 0.00 5966/967784 msg_message [132] + 0.00 0.00 5896/472418 produceexp [322] + 0.00 0.00 5988/12320804 effskill [100] + 0.00 0.00 5966/392959 add_message [434] + 0.00 0.00 5896/11241829 i_change [115] + 0.00 0.00 22/15102 cmistake [718] + 0.00 0.00 20639/3166898 rherbs [1351] + 0.00 0.00 5966/101322 rsetherbs [1438] + 0.00 0.00 5966/1009028 msg_release [1373] +----------------------------------------------- + 0.01 0.00 67213/67213 parse_symbol [42] +[494] 0.0 0.01 0.00 67213 eval_building [494] + 0.00 0.00 67213/180818 buildingname [621] + 0.00 0.00 67213/13102790 opstack_pop [176] + 0.00 0.00 67213/13102790 opstack_push [202] + 0.00 0.00 67213/13399069 balloc [363] +----------------------------------------------- + 0.00 0.00 2/752645 do_fumble [1062] + 0.00 0.00 3/752645 target_resists_magic [1154] + 0.00 0.00 10/752645 spawn_dragons [411] + 0.00 0.00 20/752645 bewegung_blockiert_von [631] + 0.00 0.00 24/752645 spy_cmd [990] + 0.00 0.00 29/752645 terraform_region [932] + 0.00 0.00 38/752645 equip_unit_mask [776] + 0.00 0.00 43/752645 get_money_for_dragon [1087] + 0.00 0.00 98/752645 age_stonecircle [1021] + 0.00 0.00 126/752645 create_icebergs [538] + 0.00 0.00 138/752645 terraform_resources [986] + 0.00 0.00 306/752645 plan_dragon [273] + 0.00 0.00 508/752645 regenerate_aura [346] + 0.00 0.00 1062/752645 loot_quota [1013] + 0.00 0.00 2988/752645 monthly_healing [215] + 0.00 0.00 58461/752645 battle_flee [352] + 0.00 0.00 92981/752645 terminate [242] + 0.00 0.01 595808/752645 plan_monsters [52] +[495] 0.0 0.00 0.01 752645 chance [495] + 0.00 0.01 752603/1336242 rng_injectable_double [396] +----------------------------------------------- + 0.00 0.00 1/293362 destroy_road [1230] + 0.00 0.00 4/293362 movement_error [1193] + 0.00 0.00 41/293362 make_cmd [383] + 0.00 0.01 133973/293362 cycle_route [375] + 0.00 0.01 159343/293362 movewhere [350] +[496] 0.0 0.00 0.01 293362 get_direction [496] + 0.01 0.00 293362/302482 findtoken [501] + 0.00 0.00 293362/4558423 get_translations [437] +----------------------------------------------- + 0.00 0.00 174965/1523708 cr_output_unit [19] + 0.00 0.01 1348743/1523708 bufunit [17] +[497] 0.0 0.00 0.01 1523708 uprivate [497] + 0.01 0.00 1523708/51974272 a_find [65] +----------------------------------------------- + 0.00 0.01 15797/15797 produce [29] +[498] 0.0 0.00 0.01 15797 sell [498] + 0.00 0.01 15796/541982 get_pooled [104] + 0.00 0.00 28293/12320804 effskill [100] + 0.00 0.00 31531/2281756 gettoken [195] + 0.00 0.00 12520/760673 addlist [217] + 0.00 0.00 15763/71815034 get_race [12] + 0.00 0.00 3277/15102 cmistake [718] + 0.00 0.00 15797/1787006 findparam [458] + 0.00 0.00 15797/1027665 init_order [613] + 0.00 0.00 14863/2605004 rpeasants [435] + 0.00 0.00 12520/51974272 a_find [65] + 0.00 0.00 15731/191379 finditemtype [735] + 0.00 0.00 39/15361 is_guarded [377] + 0.00 0.00 15763/129167539 u_race [89] + 0.00 0.00 2503/779419 a_add [555] + 0.00 0.00 15763/8506411 besieged [547] + 0.00 0.00 2/560926 bt_find [237] + 0.00 0.00 16651/1511812 newterrain [1359] + 0.00 0.00 15797/204314 bt_changed [1415] + 0.00 0.00 15731/21500 resource2luxury [1499] + 0.00 0.00 15730/308950 r_demand [1404] + 0.00 0.00 2503/779868 a_new [1376] + 0.00 0.00 1112/75797 buildingtype_exists [1443] +----------------------------------------------- + 0.00 0.00 3/1794 chaos [848] + 0.00 0.00 493/1794 remove_empty_units_in_region [134] + 0.00 0.01 1298/1794 add_recruits [371] +[499] 0.0 0.00 0.01 1794 remove_unit [499] + 0.01 0.01 1793/2887 leave [432] + 0.00 0.00 1794/1118718 ufindhash [109] + 0.00 0.00 1794/1803 gift_items [891] + 0.00 0.00 1793/1848 uunhash [1049] + 0.00 0.00 1/1 make_zombie [1267] + 0.00 0.00 1794/1342832 handle_event [1363] + 0.00 0.00 3/603524 set_number [1387] +----------------------------------------------- + 0.00 0.00 567/1474687 give_men [857] + 0.00 0.00 623/1474687 aftermath [701] + 0.00 0.00 754/1474687 new_units [282] + 0.00 0.00 1486/1474687 start_battle [297] + 0.00 0.00 1865/1474687 transfermen [899] + 0.00 0.00 39357/1474687 terminate [242] + 0.00 0.00 94655/1474687 travel [81] + 0.00 0.01 1335380/1474687 cansee [22] +[500] 0.0 0.00 0.01 1474687 leftship [500] + 0.01 0.00 1474687/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 1/302482 get_translation [1304] + 0.00 0.00 6/302482 findoption [1241] + 0.00 0.00 255/302482 unit_getspell [758] + 0.00 0.00 338/302482 findrace [1030] + 0.00 0.00 4259/302482 findshiptype [869] + 0.00 0.00 4261/302482 findbuildingtype [866] + 0.01 0.00 293362/302482 get_direction [496] +[501] 0.0 0.01 0.00 302482 findtoken [501] + 0.00 0.00 1232688/46391457 unicode_utf8_to_ucs4 [177] + 0.00 0.00 6664/49235 log_debug [1245] +----------------------------------------------- + 0.00 0.01 96450/96450 travel_i [92] +[502] 0.0 0.00 0.01 96450 cap_route [502] + 0.00 0.01 108335/108335 roadto [606] + 0.00 0.00 108335/263302 reldirection [528] +----------------------------------------------- + 0.01 0.00 780/780 do_battle [64] +[503] 0.0 0.01 0.00 780 battle_report [503] + 0.00 0.00 25201/17451017 strlcpy_w [67] + 0.00 0.00 2594/12398 fbattlerecord [688] + 0.00 0.00 2594/967784 msg_message [132] + 0.00 0.00 7058/18788 sideabkz [745] + 0.00 0.00 7336/24887945 locale_string [27] + 0.00 0.00 5188/31214 message_faction [716] + 0.00 0.00 7336/5461936 slprintf [548] + 0.00 0.00 7336/7336 get_alive [1528] + 0.00 0.00 7336/24449 seematrix [1491] + 0.00 0.00 7336/22301 army_index [1498] + 0.00 0.00 2594/1009028 msg_release [1373] +----------------------------------------------- + 0.01 0.00 34486/34486 teach_cmd [272] +[504] 0.0 0.01 0.00 34486 effskill_study [504] + 0.00 0.00 34169/12320804 get_modifier [55] + 0.00 0.00 34486/595705 unit_skill [1391] +----------------------------------------------- + 0.00 0.01 1/1 tolua_spawn_braineaters [506] +[505] 0.0 0.00 0.01 1 spawn_braineaters [505] + 0.00 0.01 639/2889 create_unit [296] + 0.00 0.00 178254/987488 is_astral [479] + 0.00 0.00 639/2375 equip_unit [775] + 0.00 0.00 1918/7641081 genrand_int31 [171] + 0.00 0.00 639/71815034 get_race [12] + 0.00 0.00 1/3902878 get_monsters [293] + 0.00 0.00 639/2742 get_equipment [1551] +----------------------------------------------- + +[506] 0.0 0.00 0.01 tolua_spawn_braineaters [506] + 0.00 0.01 1/1 spawn_braineaters [505] +----------------------------------------------- + 0.00 0.01 2081/2081 report_plaintext [4] +[507] 0.0 0.00 0.01 2081 nr_spell [507] + 0.01 0.00 19851/2742237 paragraph [26] + 0.00 0.00 30518/24887945 locale_string [27] + 0.00 0.00 2081/2081 nr_spell_syntax [732] + 0.00 0.00 2081/86400 spell_name [646] + 0.00 0.00 2081/4162 spell_info [841] + 0.00 0.00 6243/34611296 strlcpy [45] + 0.00 0.00 9352/9352 write_spell_modifier [964] + 0.00 0.00 12000/36653945 wrptr [178] + 0.00 0.00 2081/37931 centre [789] + 0.00 0.00 6243/2494242 newline [594] + 0.00 0.00 3203/13259934 resourcename [233] +----------------------------------------------- + 0.00 0.00 1/143730 destroy_road [1230] + 0.00 0.00 60/143730 build_road [950] + 0.00 0.00 46655/143730 roadto [606] + 0.00 0.01 97014/143730 cr_borders [135] +[508] 0.0 0.00 0.01 143730 rroad [508] + 0.00 0.01 143730/2225796 get_borders [120] + 0.00 0.00 1/369586 r_connect [474] +----------------------------------------------- + 0.00 0.00 27/47562 reduce_skill [1091] + 0.00 0.01 47535/47562 sk_set [510] +[509] 0.0 0.00 0.01 47562 skill_weeks [509] + 0.00 0.01 889716/7641081 genrand_int31 [171] + 0.00 0.00 47562/47562 rule_random_progress [829] +----------------------------------------------- + 0.00 0.00 2445/47535 set_level [774] + 0.00 0.01 45090/47535 learn_skill [471] +[510] 0.0 0.00 0.01 47535 sk_set [510] + 0.00 0.01 47535/47562 skill_weeks [509] +----------------------------------------------- + 0.00 0.00 232/629123 writefaction [762] + 0.00 0.00 32670/629123 writeregion [519] + 0.01 0.00 596221/629123 write_unit [97] +[511] 0.0 0.01 0.00 629123 write_items [511] + 0.00 0.00 448410/13259934 resourcename [233] +----------------------------------------------- + 0.00 0.01 112140/112140 buildingtype [414] +[512] 0.0 0.00 0.01 112140 castle_name [512] + 0.00 0.01 112140/112140 castle_name_i [513] +----------------------------------------------- + 0.00 0.01 112140/112140 castle_name [512] +[513] 0.0 0.00 0.01 112140 castle_name_i [513] + 0.01 0.00 112140/297010 bt_effsize [343] +----------------------------------------------- + 0.01 0.00 1/1 randomevents [91] +[514] 0.0 0.01 0.00 1 chaos_update [514] + 0.00 0.00 178254/179235 get_chaoscount [717] + 0.00 0.00 18025/7641081 genrand_int31 [171] + 0.00 0.00 3597/3597 chaos [848] + 0.00 0.00 18025/18059 add_chaoscount [1198] +----------------------------------------------- + 0.01 0.00 178254/178254 process [7] +[515] 0.0 0.01 0.00 178254 do_siege [515] + 0.00 0.00 204065/55492327 getkeyword [54] +----------------------------------------------- + 0.00 0.01 27694/27694 set_new_dragon_target [486] +[516] 0.0 0.00 0.01 27694 dragon_affinity_value [516] + 0.01 0.00 27694/27694 all_money [529] + 0.00 0.00 27694/71815034 get_race [12] + 0.00 0.00 27694/27694 dice [787] + 0.00 0.00 27694/129167539 u_race [89] +----------------------------------------------- + 0.01 0.00 116804/116804 parse_symbol [42] +[517] 0.0 0.01 0.00 116804 eval_isnull [517] + 0.00 0.00 116804/13102790 opstack_pop [176] + 0.00 0.00 116804/13102790 opstack_push [202] +----------------------------------------------- + 0.00 0.01 57367/57367 write_travelthru [327] +[518] 0.0 0.00 0.01 57367 count_travelthru [518] + 0.00 0.01 57367/3398582 travelthru_map [41] +----------------------------------------------- + 0.00 0.01 178254/178254 write_game [83] +[519] 0.0 0.00 0.01 178254 writeregion [519] + 0.00 0.01 178254/839970 write_attribs [301] + 0.00 0.00 249352/13259934 resourcename [233] + 0.00 0.00 196020/10053919 rtrees [302] + 0.00 0.00 32670/629123 write_items [511] + 0.00 0.00 32670/2605004 rpeasants [435] + 0.00 0.00 32670/4666665 rmoney [452] + 0.00 0.00 178254/178254 region_getinfo [1424] + 0.00 0.00 32670/1160345 rhorses [1369] + 0.00 0.00 32670/3166898 rherbs [1351] + 0.00 0.00 32670/65345 region_get_morale [1444] + 0.00 0.00 32670/32670 write_owner [1480] +----------------------------------------------- + 65155 skillmod [214] +[520] 0.0 0.01 0.00 65155 sm_familiar [520] + 0.00 0.00 26823/298951 distance [599] + 0.00 0.00 54349/54351 get_familiar [796] + 54349 effskill [100] +----------------------------------------------- + 0.01 0.00 2481220/2481220 msg_create [228] +[521] 0.0 0.01 0.00 2481220 copy_arg [521] + 0.00 0.00 41255/41255 var_copy_order [734] + 0.00 0.00 54163/54163 var_copy_string [1454] + 0.00 0.00 214/214 var_copy_items [1627] + 0.00 0.00 206/206 var_copy_resources [1632] +----------------------------------------------- + 0.00 0.01 249/249 plan_dragon [273] +[522] 0.0 0.00 0.01 249 make_movement_order [522] + 0.00 0.01 136/136 path_find [523] + 0.00 0.00 527/24887945 locale_string [27] + 0.00 0.00 136/1481407 parse_order [117] + 0.00 0.00 391/263302 reldirection [528] + 0.00 0.00 527/34611296 strlcpy [45] + 0.00 0.00 249/1121103 monster_is_waiting [407] + 0.00 0.00 527/36653945 wrptr [178] + 0.00 0.00 136/2009097 keyword [1355] +----------------------------------------------- + 0.00 0.01 136/136 make_movement_order [522] +[523] 0.0 0.00 0.01 136 path_find [523] + 0.01 0.00 136/388 internal_path_find [345] +----------------------------------------------- + 0.00 0.01 39836/39836 a_read_i [390] +[524] 0.0 0.00 0.01 39836 read_of [524] + 0.01 0.00 39836/40046 rule_stealth_other [530] + 0.00 0.00 39836/4625636 findfaction [259] +----------------------------------------------- + 0.00 0.01 206/206 do_battle [64] +[525] 0.0 0.00 0.01 206 print_stats [525] + 0.00 0.01 552/552 print_fighters [616] + 0.00 0.00 5420/12398 fbattlerecord [688] + 0.00 0.00 11178/18788 sideabkz [745] + 0.00 0.00 8758/24887945 locale_string [27] + 0.00 0.00 2317/967784 msg_message [132] + 0.00 0.00 4336/31214 message_faction [716] + 0.00 0.00 2082/3111 sidename [867] + 0.00 0.00 355/1486 message_all [834] + 0.00 0.00 11693/5461936 slprintf [548] + 0.00 0.00 13861/24449 seematrix [1491] + 0.00 0.00 13861/22301 army_index [1498] + 0.00 0.00 2317/1009028 msg_release [1373] + 0.00 0.00 149/2854 is_attacker [1550] +----------------------------------------------- + 0.00 0.00 2/14326 create_ship [1014] + 0.00 0.00 490/14326 build_building [696] + 0.00 0.00 5384/14326 teach_cmd [272] + 0.01 0.00 8450/14326 cycle_route [375] +[526] 0.0 0.01 0.00 14326 replace_order [526] + 0.00 0.00 14326/635885 copy_order [441] + 0.00 0.00 14326/1936876 free_order [1356] +----------------------------------------------- + 0.01 0.00 1302/1302 teach_unit [426] +[527] 0.0 0.01 0.00 1302 academy_can_teach [527] + 0.00 0.00 404/541982 get_pooled [104] + 0.00 0.00 1302/560926 bt_find [237] + 0.00 0.00 1709/424669 active_building [560] + 0.00 0.00 404/418134 study_cost [433] + 0.00 0.00 404/56052475 get_resourcetype [194] +----------------------------------------------- + 0.00 0.00 391/263302 make_movement_order [522] + 0.00 0.00 4307/263302 set_coast [875] + 0.00 0.00 4337/263302 can_takeoff [854] + 0.00 0.00 39729/263302 leave_trail [704] + 0.00 0.00 106203/263302 travel_route [147] + 0.00 0.00 108335/263302 cap_route [502] +[528] 0.0 0.00 0.01 263302 reldirection [528] + 0.01 0.00 263302/263302 koor_reldirection [562] + 0.00 0.00 526604/18647447 getplane [596] +----------------------------------------------- + 0.01 0.00 27694/27694 dragon_affinity_value [516] +[529] 0.0 0.01 0.00 27694 all_money [529] + 0.00 0.00 11448/7120688 get_money [187] + 0.00 0.00 27694/4666665 rmoney [452] +----------------------------------------------- + 0.00 0.00 1/40046 destroyfaction [392] + 0.00 0.00 209/40046 setstealth_cmd [182] + 0.01 0.00 39836/40046 read_of [524] +[530] 0.0 0.01 0.00 40046 rule_stealth_other [530] + 0.00 0.00 40046/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.01 1/1 write_game [83] +[531] 0.0 0.00 0.01 1 clear_npc_orders [531] + 0.01 0.00 420178/1644867 free_orders [306] +----------------------------------------------- + 0.00 0.00 10897/25088 terminate [242] + 0.00 0.01 14191/25088 flee [638] +[532] 0.0 0.00 0.01 25088 kill_troop [532] + 0.01 0.00 25088/25088 rmtroop [533] + 0.00 0.00 176/176 default_spoil [1144] + 0.00 0.00 990/129167539 u_race [89] + 0.00 0.00 12/60 equip_items [1121] + 0.00 0.00 319/2742 get_equipment [1551] + 0.00 0.00 9/97 i_merge [1651] +----------------------------------------------- + 0.01 0.00 25088/25088 kill_troop [532] +[533] 0.0 0.01 0.00 25088 rmtroop [533] + 0.00 0.00 25088/25088 rmfighter [890] +----------------------------------------------- + 0.01 0.00 1/1 icebergs [285] +[534] 0.0 0.01 0.00 1 move_icebergs [534] + 0.00 0.00 9/9 melt_iceberg [1082] + 0.00 0.00 20/27 move_iceberg [1094] + 0.00 0.00 29/7641081 genrand_int31 [171] + 0.00 0.00 178254/1511812 newterrain [1359] +----------------------------------------------- + 0.01 0.00 1297/1297 make_fighter [424] +[535] 0.0 0.01 0.00 1297 AllianceAuto [535] + 0.00 0.00 1297/10383360 HelpMask [288] + 0.00 0.00 1297/20777534 config_get [224] +----------------------------------------------- + 0.00 0.00 32/1629412 travel_i [92] + 0.00 0.00 37/1629412 transport [1011] + 0.00 0.00 74/1629412 init_transportation [384] + 0.00 0.00 222/1629412 cast_cmd [760] + 0.00 0.00 475/1629412 move_hunters [342] + 0.00 0.00 1518/1629412 start_battle [297] + 0.00 0.00 435900/1629412 process [7] + 0.00 0.00 595258/1629412 follow_unit [331] + 0.00 0.00 595896/1629412 update_long_order [270] +[536] 0.0 0.01 0.00 1629412 LongHunger [536] + 0.00 0.00 138/71815034 get_race [12] + 0.00 0.00 111/4984610 config_get_int [348] + 0.00 0.00 138/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 48/32727 terraform_region [932] + 0.01 0.00 32679/32727 readregion [209] +[537] 0.0 0.01 0.00 32727 rsetherbtype [537] + 0.00 0.00 50/361 regionname [987] + 0.00 0.00 50/49235 log_debug [1245] +----------------------------------------------- + 0.01 0.00 1/1 icebergs [285] +[538] 0.0 0.01 0.00 1 create_icebergs [538] + 0.00 0.00 126/752645 chance [495] + 0.00 0.00 7/27 move_iceberg [1094] + 0.00 0.00 2/967784 msg_message [132] + 0.00 0.00 2/392959 add_message [434] + 0.00 0.00 178261/1511812 newterrain [1359] + 0.00 0.00 2/1009028 msg_release [1373] +----------------------------------------------- + 0.01 0.00 163/163 parse_symbol [42] +[539] 0.0 0.01 0.00 163 eval_lt [539] + 0.00 0.00 326/13102790 opstack_pop [176] + 0.00 0.00 163/13102790 opstack_push [202] +----------------------------------------------- + 0.00 0.01 224/224 leave [432] +[540] 0.0 0.00 0.01 224 leave_ship [540] + 0.01 0.00 18/18 ship_update_owner [573] + 0.00 0.00 224/234 set_leftship [1134] + 0.00 0.00 18/3358315 ship_owner [438] +----------------------------------------------- + +[541] 0.0 0.00 0.01 main [541] + 0.00 0.01 1/1 game_done [542] + 0.00 0.00 1/1 game_init [1249] + 0.00 0.00 1/1 parse_config [1292] + 0.00 0.00 1/1 lua_init [1316] + 0.00 0.00 1/1 eressea_run [1346] + 0.00 0.00 1/1 setup_signal_handler [1863] + 0.00 0.00 1/1 locale_init [1815] + 0.00 0.00 1/1 parse_args [1825] + 0.00 0.00 1/1 bind_monsters [1793] + 0.00 0.00 1/1 log_close [1816] + 0.00 0.00 1/1 lua_done [1820] +----------------------------------------------- + 0.00 0.01 1/1 main [541] +[542] 0.0 0.00 0.01 1 game_done [542] + 0.00 0.01 1/1 free_config [574] + 0.00 0.00 1/1 free_locales [1311] + 0.00 0.00 1/1 free_functions [1804] + 0.00 0.00 1/1 calendar_cleanup [1796] + 0.00 0.00 1/1 kernel_done [1813] +----------------------------------------------- + 0.00 0.00 1/4201030 sp_generous [1040] + 0.00 0.00 2/4201030 sp_enterastral [1045] + 0.00 0.00 2/4201030 shipcurse_flyingship [1072] + 0.00 0.00 3/4201030 skilldiff [166] + 0.00 0.00 6/4201030 forget_cmd [1093] + 0.00 0.00 9/4201030 is_freezing [1088] + 0.00 0.00 10/4201030 sp_stormwinds [871] + 0.00 0.00 17/4201030 produce [29] + 0.00 0.00 17/4201030 process [7] + 0.00 0.00 17/4201030 magic [157] + 0.00 0.00 22/4201030 drifting_ships [490] + 0.00 0.00 34/4201030 sp_viewreality [784] + 0.00 0.00 349/4201030 can_give_men [940] + 0.00 0.00 450/4201030 spellpower [1000] + 0.00 0.00 452/4201030 fumble [973] + 0.00 0.00 488/4201030 give_men [857] + 0.00 0.00 1624/4201030 shipspeed [669] + 0.00 0.00 1689/4201030 recruit [650] + 0.00 0.00 2815/4201030 count_faction [219] + 0.00 0.00 2974/4201030 start_battle [297] + 0.00 0.00 4309/4201030 report_template [87] + 0.00 0.00 5948/4201030 deathcounts [843] + 0.00 0.00 8515/4201030 describe [35] + 0.00 0.00 16560/4201030 entertain_cmd [665] + 0.00 0.00 19730/4201030 can_survive [640] + 0.00 0.00 29173/4201030 horses [330] + 0.00 0.00 32649/4201030 growing_trees [624] + 0.00 0.00 37300/4201030 cr_output_region [10] + 0.00 0.00 39858/4201030 sail [181] + 0.00 0.00 46175/4201030 maintain_buildings [339] + 0.00 0.00 90436/4201030 spawn_undead [629] + 0.00 0.00 91155/4201030 godcurse [405] + 0.00 0.00 94865/4201030 ageing [185] + 0.00 0.00 159544/4201030 entertainmoney [643] + 0.00 0.00 169917/4201030 study_cmd [105] + 0.00 0.00 282968/4201030 move_blocked [283] + 0.00 0.00 601859/4201030 att_modification [90] + 0.00 0.00 615666/4201030 default_wage [173] + 0.00 0.00 669051/4201030 production [417] + 0.00 0.00 1174371/4201030 terrain_name [226] +[543] 0.0 0.01 0.00 4201030 curse_active [543] +----------------------------------------------- + 0.00 0.00 191/1311302 follow_ship [749] + 0.00 0.00 283446/1311302 readorders [43] + 0.01 0.00 1027665/1311302 init_order [613] +[544] 0.0 0.01 0.00 1311302 init_tokens_str [544] +----------------------------------------------- + 0.00 0.00 9/264251 destroyfaction [392] + 0.00 0.00 15/264251 res_changepeasants [1200] + 0.00 0.00 19/264251 dissolve_units [241] + 0.00 0.00 34/264251 battle_effects [1125] + 0.00 0.00 57/264251 terraform_region [932] + 0.00 0.00 71/264251 transfermen [899] + 0.00 0.00 120/264251 plagues [781] + 0.00 0.00 567/264251 eaten_by_monster [468] + 0.00 0.00 681/264251 absorbed_by_monster [804] + 0.00 0.00 1594/264251 expandrecruit [349] + 0.00 0.00 3152/264251 scareaway [768] + 0.00 0.00 14329/264251 immigration [294] + 0.00 0.00 32670/264251 peasants [658] + 0.00 0.00 32679/264251 readregion [209] + 0.01 0.00 178254/264251 get_food [88] +[545] 0.0 0.01 0.00 264251 rsetpeasants [545] +----------------------------------------------- + 0.00 0.00 1301/9298667 leveled_allocation [888] + 0.00 0.00 2723/9298667 split_allocations [743] + 0.00 0.00 3078/9298667 allocate_resource [752] + 0.00 0.00 59445/9298667 report_resources [210] + 0.01 0.00 9232120/9298667 res_changeitem [101] +[546] 0.0 0.01 0.00 9298667 resource2item [546] +----------------------------------------------- + 0.00 0.00 2/8506411 create_ship [1014] + 0.00 0.00 41/8506411 build_road [950] + 0.00 0.00 42/8506411 loot_cmd [873] + 0.00 0.00 79/8506411 can_guard [908] + 0.00 0.00 498/8506411 join_allies [693] + 0.00 0.00 598/8506411 build_building [696] + 0.00 0.00 960/8506411 tax_cmd [697] + 0.00 0.00 2943/8506411 allocate_resource [752] + 0.00 0.00 5915/8506411 buy [707] + 0.00 0.00 11003/8506411 do_work [612] + 0.00 0.00 15763/8506411 sell [498] + 0.00 0.00 16593/8506411 entertain_cmd [665] + 0.01 0.00 8451974/8506411 is_guardian_r [186] +[547] 0.0 0.01 0.00 8506411 besieged [547] + 0.00 0.00 8506411/11194781 keyword_disabled [1348] +----------------------------------------------- + 0.00 0.00 2/5461936 new_ship [1229] + 0.00 0.00 11/5461936 new_building [1059] + 0.00 0.00 47/5461936 give_peasants [1060] + 0.00 0.00 191/5461936 follow_ship [749] + 0.00 0.00 211/5461936 display_race [963] + 0.00 0.00 1572/5461936 write_score [1135] + 0.00 0.00 2705/5461936 b_nameroad [642] + 0.00 0.00 7336/5461936 battle_report [503] + 0.00 0.00 11693/5461936 print_stats [525] + 0.00 0.00 180818/5461936 write_buildingname [622] + 0.00 0.00 513251/5461936 write_regionname [280] + 0.00 0.00 1065211/5461936 write_shipname [291] + 0.00 0.00 1295787/5461936 factionname [247] + 0.00 0.00 2383101/5461936 write_unitname [148] +[548] 0.0 0.01 0.00 5461936 slprintf [548] +----------------------------------------------- + 0.01 0.00 4976082/4976082 parse_symbol [42] +[549] 0.0 0.01 0.00 4976082 find_function [549] +----------------------------------------------- + 0.00 0.00 60/4301501 aftermath [701] + 0.00 0.00 1729/4301501 make_fighter [424] + 0.00 0.00 5188/4301501 print_fighters [616] + 0.00 0.00 25088/4301501 rmfighter [890] + 0.00 0.00 324731/4301501 count_side [666] + 0.00 0.00 876979/4301501 count_enemies [611] + 0.00 0.00 1405349/4301501 select_enemy [172] + 0.00 0.00 1662377/4301501 get_unitrow [154] +[550] 0.0 0.01 0.00 4301501 statusrow [550] +----------------------------------------------- + 0.00 0.00 114/3383689 u_setfaction [1111] + 0.00 0.00 109781/3383689 move_unit [421] + 0.00 0.00 595125/3383689 read_game [62] + 0.00 0.00 1188131/3383689 travelthru_add [609] + 0.00 0.00 1490538/3383689 add_seen_nb [386] +[551] 0.0 0.01 0.00 3383689 update_interval [551] +----------------------------------------------- + 0.00 0.00 12208/2985733 report_template [87] + 0.00 0.00 68016/2985733 write_unit [97] + 0.00 0.00 68497/2985733 cr_output_unit [19] + 0.00 0.00 451283/2985733 update_long_order [270] + 0.00 0.00 573389/2985733 unitorders [46] + 0.00 0.00 766833/2985733 is_persistent [687] + 0.00 0.00 1045507/2985733 bufunit [17] +[552] 0.0 0.01 0.00 2985733 is_repeated [552] +----------------------------------------------- + 0.00 0.00 9/2186159 destroyfaction [392] + 0.00 0.00 17/2186159 give_money [484] + 0.00 0.00 36/2186159 expandloot [816] + 0.00 0.00 38/2186159 gift_items [891] + 0.00 0.00 41/2186159 region_setresource [1097] + 0.00 0.00 57/2186159 terraform_region [932] + 0.00 0.00 6459/2186159 plagues [781] + 0.00 0.00 16560/2186159 expandentertainment [637] + 0.00 0.00 32670/2186159 peasants [658] + 0.00 0.00 32679/2186159 readregion [209] + 0.00 0.00 178254/2186159 expandwork [277] + 0.00 0.00 394406/2186159 expandbuying [49] + 0.01 0.00 1524933/2186159 expandtax [278] +[553] 0.0 0.01 0.00 2186159 rsetmoney [553] +----------------------------------------------- + 0.00 0.00 10232/1106528 update_lighthouse [605] + 0.00 0.00 15060/1106528 buildingtype [414] + 0.00 0.00 24025/1106528 check_leuchtturm [786] + 0.00 0.00 46184/1106528 age_building [712] + 0.00 0.00 218422/1106528 report_building [397] + 0.00 0.00 396300/1106528 default_wage [173] + 0.00 0.00 396305/1106528 cmp_wage [670] +[554] 0.0 0.01 0.00 1106528 is_building_type [554] +----------------------------------------------- + 0.00 0.00 1/779419 create_mage [1315] + 0.00 0.00 1/779419 init_seed [1320] + 0.00 0.00 1/779419 init_mallornseed [1319] + 0.00 0.00 1/779419 a_upgradekeys [1314] + 0.00 0.00 1/779419 xml_readconstruction [1183] + 0.00 0.00 2/779419 set_factionstealth [183] + 0.00 0.00 2/779419 make_wormhole [1150] + 0.00 0.00 2/779419 summon_allies [925] + 0.00 0.00 2/779419 init_smithy [1312] + 0.00 0.00 3/779419 create_newfamiliar [1288] + 0.00 0.00 3/779419 usetprivate [1041] + 0.00 0.00 6/779419 add_chaoscount [1198] + 0.00 0.00 7/779419 parse_resources [1086] + 0.00 0.00 7/779419 add_trigger [1260] + 0.00 0.00 12/779419 volcano_destruction [1022] + 0.00 0.00 13/779419 move_iceberg [1094] + 0.00 0.00 20/779419 init_transportation [384] + 0.00 0.00 25/779419 set_new_dragon_target [486] + 0.00 0.00 32/779419 growing_trees [624] + 0.00 0.00 32/779419 make_curse [802] + 0.00 0.00 35/779419 deathcounts [843] + 0.00 0.00 55/779419 renumber_unit [1159] + 0.00 0.00 58/779419 potion_luck [1176] + 0.00 0.00 97/779419 piracy_cmd [660] + 0.00 0.00 114/779419 usetcontact [1147] + 0.00 0.00 159/779419 change_effect [982] + 0.00 0.00 234/779419 set_leftship [1134] + 0.00 0.00 328/779419 display_potion [1090] + 0.00 0.00 389/779419 usetpotionuse [1078] + 0.00 0.00 631/779419 set_group [1048] + 0.00 0.00 754/779419 new_units [282] + 0.00 0.00 760/779419 set_familiar [992] + 0.00 0.00 894/779419 follow_unit [331] + 0.00 0.00 2494/779419 create_unit [296] + 0.00 0.00 2503/779419 sell [498] + 0.00 0.00 3233/779419 leave_trail [704] + 0.00 0.00 3642/779419 buy [707] + 0.00 0.00 4162/779419 show_new_spells [889] + 0.00 0.00 4738/779419 expandselling [93] + 0.00 0.00 5679/779419 expandbuying [49] + 0.00 0.00 11749/779419 teach_unit [426] + 0.00 0.00 27216/779419 travelthru_add [609] + 0.00 0.00 52117/779419 update_lighthouse [605] + 0.00 0.00 251365/779419 a_read_i [390] + 0.00 0.01 405840/779419 study_cmd [105] +[555] 0.0 0.00 0.01 779419 a_add [555] + 0.01 0.00 54530/54530 a_insert [566] +----------------------------------------------- + 0.00 0.00 7964/618305 report_crtypes [428] + 0.01 0.00 610341/618305 stream_order [167] +[556] 0.0 0.01 0.00 618305 escape_string [556] +----------------------------------------------- + 0.00 0.00 1/604861 clonedied_write [1321] + 0.00 0.00 2/604861 giveitem_write [1309] + 0.00 0.00 6/604861 changerace_write [1287] + 0.00 0.00 12/604861 changefaction_write [1258] + 0.00 0.00 769/604861 shock_write [1050] + 0.00 0.00 1522/604861 a_write_unit [998] + 0.00 0.00 2304/604861 killunit_write [978] + 0.00 0.00 4024/604861 curse_write [930] + 0.01 0.00 596221/604861 write_unit [97] +[557] 0.0 0.01 0.00 604861 write_unit_reference [557] +----------------------------------------------- + 0.00 0.00 449/454395 a_read_i [390] + 0.00 0.00 2172/454395 a_removeall [958] + 0.01 0.00 451774/454395 a_remove [366] +[558] 0.0 0.01 0.00 454395 a_free [558] + 0.00 0.00 417577/417577 done_learning [1397] + 0.00 0.00 23342/23342 shiptrail_finalize [1492] + 0.00 0.00 10417/10417 free_luxuries [1516] + 0.00 0.00 554/554 a_finalizeeffect [1597] + 0.00 0.00 97/97 piracy_done [1653] + 0.00 0.00 28/28 curse_done [1696] + 0.00 0.00 1/1 a_finalizestring [1786] +----------------------------------------------- + 0.01 0.00 451774/451774 a_remove [366] +[559] 0.0 0.01 0.00 451774 a_unlink [559] +----------------------------------------------- + 0.00 0.00 174/424669 breedhorses [742] + 0.00 0.00 1709/424669 academy_can_teach [527] + 0.00 0.00 5206/424669 monthly_healing [215] + 0.01 0.00 417580/424669 study_cmd [105] +[560] 0.0 0.01 0.00 424669 active_building [560] + 0.00 0.00 6798/26164 building_is_active [1488] + 0.00 0.00 6405/26995 inside_building [1486] +----------------------------------------------- + 0.00 0.00 5/283711 give_horses [1108] + 0.00 0.00 19/283711 reshow_other [823] + 0.00 0.00 22/283711 give_money [484] + 0.01 0.00 283665/283711 give_item [126] +[561] 0.0 0.01 0.00 283711 item2resource [561] +----------------------------------------------- + 0.01 0.00 263302/263302 reldirection [528] +[562] 0.0 0.01 0.00 263302 koor_reldirection [562] + 0.00 0.00 932009/3587241 pnormalize [1350] +----------------------------------------------- + 0.01 0.00 251814/251814 a_read_i [390] +[563] 0.0 0.01 0.00 251814 at_find [563] +----------------------------------------------- + 0.00 0.00 30233/162862 regions_in_range [675] + 0.01 0.00 132629/162862 internal_path_find [345] +[564] 0.0 0.01 0.00 162862 allowed_dragon [564] + 0.00 0.00 157782/157830 allowed_fly [1425] +----------------------------------------------- + 0.00 0.00 1/113845 removelist [1290] + 0.01 0.00 113844/113845 translist [430] +[565] 0.0 0.01 0.00 113845 choplist [565] +----------------------------------------------- + 0.01 0.00 54530/54530 a_add [555] +[566] 0.0 0.01 0.00 54530 a_insert [566] +----------------------------------------------- + 0.00 0.00 10344/47887 cansail [469] + 0.00 0.00 18693/47887 nr_ship [111] + 0.00 0.00 18850/47887 cr_output_ship [152] +[567] 0.0 0.01 0.00 47887 shipcapacity [567] +----------------------------------------------- + 0.00 0.00 1/11719 tolua_faction_get_locale [1197] + 0.00 0.00 2/11719 config_get_locales [1161] + 0.00 0.00 2/11719 report_summary [614] + 0.00 0.00 232/11719 write_script [853] + 0.00 0.00 232/11719 writefaction [762] + 0.00 0.00 460/11719 report_computer [9] + 0.01 0.00 10790/11719 cr_find_address [602] +[568] 0.0 0.01 0.00 11719 locale_name [568] +----------------------------------------------- + 0.00 0.00 863/3147 make_fighter [424] + 0.01 0.00 2284/3147 weapon_skill [221] +[569] 0.0 0.01 0.00 3147 i_canuse [569] + 0.00 0.00 785/785 lua_canuse_item [1591] +----------------------------------------------- + 0.01 0.00 1018/1018 remove_exclusive [571] +[570] 0.0 0.01 0.00 1018 is_exclusive [570] +----------------------------------------------- + 0.00 0.01 524/524 defaultorders [249] +[571] 0.0 0.00 0.01 524 remove_exclusive [571] + 0.01 0.00 1018/1018 is_exclusive [570] + 0.00 0.00 310/1936876 free_order [1356] +----------------------------------------------- + 0.00 0.00 1/457 promotion_cmd [917] + 0.00 0.00 226/457 report_plaintext [4] + 0.01 0.00 230/457 report_computer [9] +[572] 0.0 0.01 0.00 457 countheroes [572] +----------------------------------------------- + 0.01 0.00 18/18 leave_ship [540] +[573] 0.0 0.01 0.00 18 ship_update_owner [573] + 0.00 0.00 18/1529 ship_owner_ex [1571] +----------------------------------------------- + 0.00 0.01 1/1 game_done [542] +[574] 0.0 0.00 0.01 1 free_config [574] + 0.01 0.00 1/1 free_params [575] +----------------------------------------------- + 0.01 0.00 1/1 free_config [574] +[575] 0.0 0.01 0.00 1 free_params [575] +----------------------------------------------- + 0.01 0.00 1/1 eressea_write_game [76] +[576] 0.0 0.01 0.00 1 remove_empty_factions [576] +----------------------------------------------- + +[577] 0.0 0.01 0.00 cb_insert [577] +----------------------------------------------- + +[578] 0.0 0.01 0.00 cmp_curse [578] +----------------------------------------------- + +[579] 0.0 0.01 0.00 create_backup [579] +----------------------------------------------- + +[580] 0.0 0.01 0.00 ct_remove [580] +----------------------------------------------- + +[581] 0.0 0.01 0.00 get_homeplane [581] +----------------------------------------------- + +[582] 0.0 0.01 0.00 i10toi36 [582] +----------------------------------------------- + +[583] 0.0 0.01 0.00 json_export [583] +----------------------------------------------- + +[584] 0.0 0.01 0.00 make_external_node [584] +----------------------------------------------- + +[585] 0.0 0.01 0.00 qli_next [585] +----------------------------------------------- + +[586] 0.0 0.01 0.00 read_movement [586] +----------------------------------------------- + +[587] 0.0 0.01 0.00 remove_plane [587] +----------------------------------------------- + +[588] 0.0 0.01 0.00 set_string [588] +----------------------------------------------- + +[589] 0.0 0.01 0.00 tolua_buildinglist_next [589] +----------------------------------------------- + +[590] 0.0 0.01 0.00 tolua_regionlist_next [590] +----------------------------------------------- + +[591] 0.0 0.01 0.00 tolua_tousertype [591] +----------------------------------------------- + 0.00 0.00 490896/5152236 default_wage [173] + 0.00 0.00 1366398/5152236 unit_max_hp [136] + 0.01 0.00 3294942/5152236 att_modification [90] +[592] 0.0 0.01 0.00 5152236 ct_changed [592] +----------------------------------------------- + 0.00 0.00 11880/4835422 cansee_unit [684] + 0.00 0.00 923633/4835422 cr_output_unit [19] + 0.00 0.00 1156253/4835422 cansee [22] + 0.00 0.00 1348743/4835422 bufunit [17] + 0.00 0.00 1394913/4835422 cansee_durchgezogen [170] +[593] 0.0 0.01 0.00 4835422 usiege [593] +----------------------------------------------- + 0.00 0.00 458/2494242 list_address [635] + 0.00 0.00 1632/2494242 rp_battles [618] + 0.00 0.00 1888/2494242 allies [419] + 0.00 0.00 6243/2494242 nr_spell [507] + 0.00 0.00 15186/2494242 nr_curses_i [401] + 0.00 0.00 27498/2494242 guards [229] + 0.00 0.00 62736/2494242 rp_messages [36] + 0.00 0.00 66278/2494242 statistics [70] + 0.00 0.00 113592/2494242 nr_building [141] + 0.00 0.00 164218/2494242 describe [35] + 0.00 0.00 180598/2494242 nr_ship [111] + 0.00 0.00 216458/2494242 report_template [87] + 0.00 0.00 293098/2494242 report_plaintext [4] + 0.01 0.00 1344359/2494242 nr_unit [11] +[594] 0.0 0.01 0.00 2494242 newline [594] +----------------------------------------------- + 0.01 0.00 987612/987612 get_astralplane [482] +[595] 0.0 0.01 0.00 987612 getplanebyname [595] +----------------------------------------------- + 0.00 0.00 3/18647447 getplaneid [1337] + 0.00 0.00 40/18647447 expandstealing [807] + 0.00 0.00 111/18647447 check_steal [1234] + 0.00 0.00 206/18647447 make_battle [1282] + 0.00 0.00 227/18647447 cast_cmd [760] + 0.00 0.00 493/18647447 report_computer [9] + 0.00 0.00 719/18647447 join_allies [693] + 0.00 0.00 976/18647447 make_cmd [383] + 0.00 0.00 1518/18647447 start_battle [297] + 0.00 0.00 1689/18647447 recruit [650] + 0.00 0.00 5384/18647447 teach_cmd [272] + 0.00 0.00 7957/18647447 magic_resistance [727] + 0.00 0.00 8865/18647447 r_astral_to_standard [783] + 0.00 0.00 9641/18647447 cr_regions [840] + 0.00 0.00 10477/18647447 report_template [87] + 0.00 0.00 102739/18647447 give_cmd [102] + 0.00 0.00 108425/18647447 update_lighthouse [605] + 0.00 0.00 132705/18647447 cr_region [662] + 0.00 0.00 163381/18647447 astralregions [329] + 0.00 0.00 174658/18647447 good_region [910] + 0.00 0.00 178254/18647447 get_food [88] + 0.00 0.00 211668/18647447 cr_output_region [10] + 0.00 0.00 369586/18647447 r_connect [474] + 0.00 0.00 513251/18647447 write_regionname [280] + 0.00 0.00 526604/18647447 reldirection [528] + 0.00 0.00 950595/18647447 f_regionid [161] + 0.00 0.00 987488/18647447 is_astral [479] + 0.00 0.00 1187497/18647447 bufunit [17] + 0.00 0.00 1467202/18647447 get_modifier [55] + 0.00 0.00 2521048/18647447 lifestyle [286] + 0.00 0.00 9004040/18647447 alliedunit [31] +[596] 0.0 0.01 0.00 18647447 getplane [596] +----------------------------------------------- + 0.00 0.00 1/2032164 do_fumble [1062] + 0.00 0.00 1/2032164 init_seed [1320] + 0.00 0.00 1/2032164 init_mallornseed [1319] + 0.00 0.00 17/2032164 parse_buildings [1131] + 0.00 0.00 51/2032164 potion_water_of_life [945] + 0.00 0.00 80/2032164 msg_set_resource [1226] + 0.00 0.00 225/2032164 spellpower [1000] + 0.00 0.00 233/2032164 parse_spells [1120] + 0.00 0.00 545/2032164 rt_get_or_create [1139] + 0.00 0.00 1139/2032164 tolua_region_set_resource [1057] + 0.00 0.00 2148/2032164 get_food [88] + 0.00 0.00 2366/2032164 allocate_resource [752] + 0.00 0.00 2491/2032164 a_readeffect [1052] + 0.00 0.00 3355/2032164 tolua_region_get_resource [976] + 0.00 0.00 5358/2032164 max_spellpoints [755] + 0.00 0.00 83224/2032164 trollbelts [677] + 0.00 0.00 193274/2032164 walkingcapacity [403] + 0.00 0.00 249361/2032164 readregion [209] + 0.00 0.00 310783/2032164 get_resourcetype [194] + 0.01 0.00 1177511/2032164 it_find [385] +[597] 0.0 0.01 0.00 2032164 rt_find [597] +----------------------------------------------- + 0.00 0.01 755575/755575 travelthru_map [41] +[598] 0.0 0.00 0.01 755575 cb_add_address [598] + 0.00 0.01 74068/4374788 visible_faction [68] + 0.00 0.00 11880/11880 cansee_unit [684] + 0.00 0.00 3767/353788 add_seen_faction_i [1401] +----------------------------------------------- + 0.00 0.00 3/298951 cast_cmd [760] + 0.00 0.00 26823/298951 sm_familiar [520] + 0.00 0.00 71197/298951 update_lighthouse [605] + 0.00 0.01 200928/298951 get_regions_distance [372] +[599] 0.0 0.00 0.01 298951 distance [599] + 0.00 0.01 298951/514146 koor_distance [476] +----------------------------------------------- + 0.00 0.00 6/102705 give_control_cmd [287] + 0.00 0.01 102699/102705 give_cmd [102] +[600] 0.0 0.00 0.01 102705 can_give_to [600] + 0.00 0.01 102705/9953180 alliedunit [31] + 0.00 0.00 70/1437425 cansee [22] + 0.00 0.00 20/8898 ucontact [927] +----------------------------------------------- + 0.00 0.00 233/113487 reroute [1020] + 0.00 0.01 113254/113487 make_route [289] +[601] 0.0 0.00 0.01 113487 next_region [601] + 0.00 0.01 113487/2225796 get_borders [120] +----------------------------------------------- + 0.00 0.01 230/230 report_computer [9] +[602] 0.0 0.00 0.01 230 cr_find_address [602] + 0.01 0.00 10790/11719 locale_name [568] +----------------------------------------------- + 0.00 0.01 32670/32670 demographics [50] +[603] 0.0 0.00 0.01 32670 calculate_emigration [603] + 0.00 0.01 144763/438629 maxworkingpeasants [473] + 0.00 0.00 46456/369586 r_connect [474] + 0.00 0.00 144763/2605004 rpeasants [435] + 0.00 0.00 64838/1511812 newterrain [1359] +----------------------------------------------- + 0.00 0.01 116914/116914 fleechance [408] +[604] 0.0 0.00 0.01 116914 horse_fleeing_bonus [604] + 0.00 0.01 116914/12320804 effskill [100] + 0.00 0.00 350742/56052475 get_resourcetype [194] +----------------------------------------------- + 0.00 0.00 2/10232 remove_building [1153] + 0.00 0.00 11/10232 new_building [1059] + 0.00 0.00 490/10232 build_building [696] + 0.00 0.01 9729/10232 read_game [62] +[605] 0.0 0.00 0.01 10232 update_lighthouse [605] + 0.00 0.01 108425/459083 findregion [420] + 0.00 0.00 71197/298951 distance [599] + 0.00 0.00 52117/779419 a_add [555] + 0.00 0.00 52551/51974272 a_find [65] + 0.00 0.00 10232/1106528 is_building_type [554] + 0.00 0.00 108425/18647447 getplane [596] + 0.00 0.00 108425/3587241 pnormalize [1350] + 0.00 0.00 52117/779868 a_new [1376] +----------------------------------------------- + 0.00 0.01 108335/108335 cap_route [502] +[606] 0.0 0.00 0.01 108335 roadto [606] + 0.00 0.00 46655/143730 rroad [508] + 0.00 0.00 208736/10190660 get_curse [143] + 0.00 0.00 104368/12246335 ct_find [114] + 0.00 0.00 16737/16737 dir_invert [1508] +----------------------------------------------- + 0.00 0.01 3656767/3656767 translate [28] +[607] 0.0 0.00 0.01 3656767 add_variable [607] + 0.01 0.00 3656767/13399069 balloc [363] +----------------------------------------------- + 0.00 0.01 127788/127788 parse_symbol [42] +[608] 0.0 0.00 0.01 127788 eval_direction [608] + 0.00 0.00 127788/24887945 locale_string [27] + 0.00 0.00 127788/13102790 opstack_pop [176] + 0.00 0.00 127788/13102790 opstack_push [202] + 0.00 0.00 127788/13399069 balloc [363] +----------------------------------------------- + 0.00 0.01 169733/169733 mark_travelthru [610] +[609] 0.0 0.00 0.01 169733 travelthru_add [609] + 0.00 0.00 1188131/3383689 update_interval [551] + 0.00 0.00 169733/1087065 get_neighbours [480] + 0.00 0.00 169733/51974272 a_find [65] + 0.00 0.00 27216/779419 a_add [555] + 0.00 0.00 27216/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 10679/106919 move_ship [374] + 0.00 0.01 96240/106919 travel_route [147] +[610] 0.0 0.00 0.01 106919 mark_travelthru [610] + 0.00 0.01 169733/169733 travelthru_add [609] +----------------------------------------------- + 0.00 0.00 21/876979 sp_kampfzauber [957] + 0.00 0.00 53/876979 sp_dragonodem [627] + 0.00 0.00 112/876979 attack_firesword [785] + 0.00 0.00 251867/876979 do_attack [80] + 0.00 0.00 252753/876979 attack [84] + 0.00 0.00 372173/876979 select_enemy [172] +[611] 0.0 0.00 0.01 876979 count_enemies [611] + 0.00 0.01 300810/300810 count_enemies_i [636] + 0.00 0.00 876979/4301501 statusrow [550] +----------------------------------------------- + 0.00 0.01 11087/11087 produce [29] +[612] 0.0 0.00 0.01 11087 do_work [612] + 0.00 0.01 3141/15361 is_guarded [377] + 0.00 0.00 10979/490896 wage [174] + 0.00 0.00 22150/129167539 u_race [89] + 0.00 0.00 11003/8506411 besieged [547] + 0.00 0.00 84/41248 msg_feedback [647] + 0.00 0.00 84/392959 add_message [434] + 0.00 0.00 24/15102 cmistake [718] + 0.00 0.00 84/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 2/1027665 claim_cmd [1242] + 0.00 0.00 6/1027665 send_cmd [1202] + 0.00 0.00 12/1027665 forget_cmd [1093] + 0.00 0.00 16/1027665 spy_cmd [990] + 0.00 0.00 20/1027665 restack_units [353] + 0.00 0.00 22/1027665 destroy_cmd [1113] + 0.00 0.00 42/1027665 loot_cmd [873] + 0.00 0.00 65/1027665 travel_i [92] + 0.00 0.00 70/1027665 transport [1011] + 0.00 0.00 80/1027665 combatspell_cmd [898] + 0.00 0.00 99/1027665 piracy_cmd [660] + 0.00 0.00 111/1027665 init_transportation [384] + 0.00 0.00 111/1027665 steal_cmd [766] + 0.00 0.00 138/1027665 renumber_cmd [780] + 0.00 0.00 147/1027665 contact_cmd [965] + 0.00 0.00 177/1027665 breed_cmd [741] + 0.00 0.00 222/1027665 cast_cmd [760] + 0.00 0.00 241/1027665 reshow_cmd [818] + 0.00 0.00 262/1027665 defaultorders [249] + 0.00 0.00 348/1027665 mail_cmd [844] + 0.00 0.00 349/1027665 research_cmd [886] + 0.00 0.00 590/1027665 use_cmd [763] + 0.00 0.00 597/1027665 move_hunters [342] + 0.00 0.00 621/1027665 group_cmd [985] + 0.00 0.00 639/1027665 do_enter [128] + 0.00 0.00 754/1027665 new_units [282] + 0.00 0.00 791/1027665 ally_cmd [877] + 0.00 0.00 799/1027665 setstealth_cmd [182] + 0.00 0.00 960/1027665 tax_cmd [697] + 0.00 0.00 1425/1027665 follow_unit [331] + 0.00 0.00 1487/1027665 start_battle [297] + 0.00 0.00 1700/1027665 status_cmd [904] + 0.00 0.00 1835/1027665 recruit [650] + 0.00 0.00 2013/1027665 display_cmd [859] + 0.00 0.00 3117/1027665 name_cmd [835] + 0.00 0.00 5049/1027665 parse_ids [852] + 0.00 0.00 5916/1027665 buy [707] + 0.00 0.00 8450/1027665 cycle_route [375] + 0.00 0.00 10600/1027665 make_cmd [383] + 0.00 0.00 15797/1027665 sell [498] + 0.00 0.00 16596/1027665 entertain_cmd [665] + 0.00 0.00 28057/1027665 teach_cmd [272] + 0.00 0.00 30554/1027665 guard_on_cmd [656] + 0.00 0.00 30634/1027665 guard_off_cmd [711] + 0.00 0.00 71388/1027665 reserve_i [213] + 0.00 0.00 103494/1027665 movement [47] + 0.00 0.00 131722/1027665 give_cmd [102] + 0.00 0.00 131765/1027665 give_control_cmd [287] + 0.00 0.00 417775/1027665 study_cmd [105] +[613] 0.0 0.00 0.01 1027665 init_order [613] + 0.01 0.00 1027665/1311302 init_tokens_str [544] +----------------------------------------------- + 0.00 0.01 2/2 tolua_write_summary [38] +[614] 0.0 0.00 0.01 2 report_summary [614] + 0.00 0.01 251/251 out_faction [615] + 0.00 0.00 93/24887945 locale_string [27] + 0.00 0.00 93/71815034 get_race [12] + 0.00 0.00 2/11719 locale_name [568] + 0.00 0.00 2/3 update_nmrs [1155] + 0.00 0.00 71/2818494 rc_name_s [260] + 0.00 0.00 2/3 gamedate2 [1222] + 0.00 0.00 1/1 writeturn [1253] + 0.00 0.00 2/573 join_path [1016] + 0.00 0.00 1/1248014 listlen [190] + 0.00 0.00 2/27 NMRTimeout [1264] + 0.00 0.00 2/462 game_name [1168] + 0.00 0.00 3/64 log_info [1339] + 0.00 0.00 51/51 rcomp [1681] + 0.00 0.00 42/42 pcomp [1687] + 0.00 0.00 2/9 basepath [1730] +----------------------------------------------- + 0.00 0.01 251/251 report_summary [614] +[615] 0.0 0.00 0.01 251 out_faction [615] + 0.00 0.01 251/481 count_units [487] + 0.00 0.00 251/24887945 locale_string [27] + 0.00 0.00 251/1295787 factionname [247] + 0.00 0.00 251/2818494 rc_name_s [260] +----------------------------------------------- + 0.00 0.01 552/552 print_stats [525] +[616] 0.0 0.00 0.01 552 print_fighters [616] + 0.00 0.01 1297/1297 battle_punit [620] + 0.00 0.00 614/1486 message_all [834] + 0.00 0.00 614/967784 msg_message [132] + 0.00 0.00 5188/4301501 statusrow [550] + 0.00 0.00 614/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.01 3626/3626 make_cmd [383] +[617] 0.0 0.00 0.01 3626 create_item [617] + 0.00 0.01 3100/15361 is_guarded [377] + 0.00 0.00 3078/3078 allocate_resource [752] + 0.00 0.00 377/377 manufacture [759] + 0.00 0.00 149/149 create_potion [821] + 0.00 0.00 22/15102 cmistake [718] + 0.00 0.00 526/1582 resource2potion [1569] +----------------------------------------------- + 0.00 0.01 230/230 report_plaintext [4] +[618] 0.0 0.00 0.01 230 rp_battles [618] + 0.00 0.01 676/79180 rp_messages [36] + 0.00 0.00 676/1380398 nr_render [25] + 0.00 0.00 676/967784 msg_message [132] + 0.00 0.00 816/37931 centre [789] + 0.00 0.00 140/24887945 locale_string [27] + 0.00 0.00 1632/2494242 newline [594] + 0.00 0.00 676/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.01 578591/578591 monthly_healing [215] +[619] 0.0 0.00 0.01 578591 heal_factor [619] + 0.00 0.00 578591/7910500 r_isforest [199] + 0.00 0.00 578592/129167539 u_race [89] + 0.00 0.00 14447/12560453 rc_changed [256] + 0.00 0.00 1/71815034 get_race [12] + 0.00 0.00 1/717287 get_param_flt [713] + 0.00 0.00 2430/2386892 config_changed [1352] +----------------------------------------------- + 0.00 0.01 1297/1297 print_fighters [616] +[620] 0.0 0.00 0.01 1297 battle_punit [620] + 0.00 0.01 4384/4384 spunit [632] + 0.00 0.00 4384/12398 fbattlerecord [688] + 0.00 0.00 4384/5330 freestrlist [1534] +----------------------------------------------- + 0.00 0.00 1/180818 tolua_building_tostring [1306] + 0.00 0.00 12/180818 read_game [62] + 0.00 0.00 67213/180818 eval_building [494] + 0.00 0.00 113592/180818 nr_building [141] +[621] 0.0 0.00 0.01 180818 buildingname [621] + 0.00 0.01 180818/180818 write_buildingname [622] +----------------------------------------------- + 0.00 0.01 180818/180818 buildingname [621] +[622] 0.0 0.00 0.01 180818 write_buildingname [622] + 0.00 0.01 180818/5100840 itoa36 [116] + 0.00 0.00 180818/5461936 slprintf [548] +----------------------------------------------- + 0.00 0.00 21/74 do_combatspell [702] + 0.00 0.01 53/74 do_extra_spell [648] +[623] 0.0 0.00 0.01 74 cast_combatspell [623] + 0.00 0.01 53/53 sp_dragonodem [627] + 0.00 0.00 74/273 pay_spell [805] + 0.00 0.00 21/21 sp_kampfzauber [957] + 0.00 0.00 74/83 create_castorder_combat [1137] + 0.00 0.00 74/303 free_castorder [1609] +----------------------------------------------- + 0.00 0.01 32670/32670 demographics [50] +[624] 0.0 0.00 0.01 32670 growing_trees [624] + 0.00 0.00 361320/7641081 genrand_int31 [171] + 0.00 0.00 249356/10053919 rtrees [302] + 0.00 0.00 32649/12246335 ct_find [114] + 0.00 0.00 32649/10190660 get_curse [143] + 0.00 0.00 32670/51974272 a_find [65] + 0.00 0.00 32649/4201030 curse_active [543] + 0.00 0.00 32/779419 a_add [555] + 0.00 0.00 130680/229715 rsettrees [1410] + 0.00 0.00 32649/651711 oldcursename [1381] + 0.00 0.00 32/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 42/34409 expandloot [816] + 0.00 0.00 59/34409 expandstealing [807] + 0.00 0.00 948/34409 expandtax [278] + 0.00 0.00 5821/34409 expandselling [93] + 0.00 0.00 10979/34409 expandwork [277] + 0.00 0.00 16560/34409 expandentertainment [637] +[625] 0.0 0.00 0.01 34409 add_income [625] + 0.00 0.00 34409/967784 msg_message [132] + 0.00 0.00 34409/392959 add_message [434] + 0.00 0.00 34409/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.01 70836/70836 is_guarded [377] +[626] 0.0 0.00 0.01 70836 is_guardian_u [626] + 0.00 0.01 63046/9953180 alliedunit [31] + 0.00 0.00 63046/6610983 is_guard [211] + 0.00 0.00 397/1437425 cansee [22] + 0.00 0.00 397/8898 ucontact [927] + 0.00 0.00 257/129167539 u_race [89] +----------------------------------------------- + 0.00 0.01 53/53 cast_combatspell [623] +[627] 0.0 0.00 0.01 53 sp_dragonodem [627] + 0.00 0.00 7313/80630 terminate [242] + 0.00 0.00 7313/372173 select_enemy [172] + 0.00 0.00 53/1486 message_all [834] + 0.00 0.00 53/967784 msg_message [132] + 0.00 0.00 53/201744 lovar [644] + 0.00 0.00 53/876979 count_enemies [611] + 0.00 0.00 53/74 spell_damage [1657] + 0.00 0.00 53/74 get_force [1656] + 0.00 0.00 53/1009028 msg_release [1373] +----------------------------------------------- + +[628] 0.0 0.00 0.01 tolua_region_getkey [628] + 0.01 0.00 178254/688711 atoi36 [440] + 0.00 0.00 178254/178257 key_get [719] +----------------------------------------------- + 0.00 0.01 1/1 tolua_spawn_undead [630] +[629] 0.0 0.00 0.01 1 spawn_undead [629] + 0.00 0.00 355408/355423 deathcount [674] + 0.00 0.00 92/2889 create_unit [296] + 0.00 0.00 90436/10190660 get_curse [143] + 0.00 0.00 31670/2605004 rpeasants [435] + 0.00 0.00 37226/37974 deathcounts [843] + 0.00 0.00 828/2457 set_level [774] + 0.00 0.00 90436/4201030 curse_active [543] + 0.00 0.00 9552/7641081 genrand_int31 [171] + 0.00 0.00 92/967784 msg_message [132] + 0.00 0.00 266/392959 add_message [434] + 0.00 0.00 92/2931 name_unit [803] + 0.00 0.00 92/1381157 unit_max_hp [136] + 0.00 0.00 247/71815034 get_race [12] + 0.00 0.00 92/361 regionname [987] + 0.00 0.00 21/2375 equip_unit [775] + 0.00 0.00 92/24887945 locale_string [27] + 0.00 0.00 9312/21517 chaosfactor [1077] + 0.00 0.00 92/2818494 rc_name_s [260] + 0.00 0.00 92/129167539 u_race [89] + 0.00 0.00 1/12246335 ct_find [114] + 0.00 0.00 1/3902878 get_monsters [293] + 0.00 0.00 92/49235 log_debug [1245] + 0.00 0.00 92/1009028 msg_release [1373] + 0.00 0.00 21/2742 get_equipment [1551] +----------------------------------------------- + +[630] 0.0 0.00 0.01 tolua_spawn_undead [630] + 0.00 0.01 1/1 spawn_undead [629] +----------------------------------------------- + 0.00 0.01 9680/9680 travel_route [147] +[631] 0.0 0.00 0.01 9680 bewegung_blockiert_von [631] + 0.00 0.00 216875/6610983 is_guard [211] + 0.00 0.00 9680/560926 bt_find [237] + 0.00 0.00 9680/1188532 eff_stealth [163] + 0.00 0.00 8873/1753922 invisible [139] + 0.00 0.00 8873/12320804 effskill [100] + 0.00 0.00 6140/9953180 alliedunit [31] + 0.00 0.00 58080/717218 config_get_flt [714] + 0.00 0.00 27379/129167539 u_race [89] + 0.00 0.00 6140/8898 ucontact [927] + 0.00 0.00 9680/56052475 get_resourcetype [194] + 0.00 0.00 372/5395063 i_get [130] + 0.00 0.00 6/593636 building_owner [232] + 0.00 0.00 3/184870 buildingeffsize [367] + 0.00 0.00 20/752645 chance [495] + 0.00 0.00 105/1511812 newterrain [1359] +----------------------------------------------- + 0.00 0.01 4384/4384 battle_punit [620] +[632] 0.0 0.00 0.01 4384 spunit [632] + 0.00 0.01 4384/1348743 bufunit [17] + 0.00 0.00 4384/4384 lparagraph [809] +----------------------------------------------- + 0.00 0.01 96555/96555 travel_i [92] +[633] 0.0 0.00 0.01 96555 canwalk [633] + 0.00 0.00 12778/96637 walkingcapacity [403] + 0.00 0.00 12778/34221 eff_weight [683] + 0.00 0.00 12787/12320804 effskill [100] + 0.00 0.00 83768/3902878 get_monsters [293] + 0.00 0.00 12787/71815034 get_race [12] + 0.00 0.00 12787/129167539 u_race [89] + 0.00 0.00 12787/130867 get_transporters [1431] +----------------------------------------------- + 0.00 0.01 108560/108560 parse_symbol [42] +[634] 0.0 0.00 0.01 108560 eval_trail [634] + 0.00 0.00 19276/146950 f_regionid_s [477] + 0.00 0.00 19276/785221 trailinto [207] + 0.00 0.00 108560/13102790 opstack_pop [176] + 0.00 0.00 108560/13102790 opstack_push [202] + 0.00 0.00 108560/13399069 balloc [363] + 0.00 0.00 4257/24887945 locale_string [27] + 0.00 0.00 4287/17451017 strlcpy_w [67] + 0.00 0.00 19276/36653945 wrptr [178] +----------------------------------------------- + 0.00 0.01 229/229 report_plaintext [4] +[635] 0.0 0.00 0.01 229 list_address [635] + 0.00 0.00 10794/2742237 paragraph [26] + 0.00 0.00 10565/1205451 alliedfaction [162] + 0.00 0.00 10794/1295787 factionname [247] + 0.00 0.00 229/24887945 locale_string [27] + 0.00 0.00 229/37931 centre [789] + 0.00 0.00 176/3902878 get_monsters [293] + 0.00 0.00 458/2494242 newline [594] + 0.00 0.00 10565/1214628 is_allied [1368] + 0.00 0.00 229/128135 rpline [1433] +----------------------------------------------- + 0.00 0.01 300810/300810 count_enemies [611] +[636] 0.0 0.00 0.01 300810 count_enemies_i [636] + 0.00 0.00 317201/317239 count_side [666] + 0.00 0.00 25256/1662377 get_unitrow [154] +----------------------------------------------- + 0.00 0.01 11159/11159 produce [29] +[637] 0.0 0.00 0.01 11159 expandentertainment [637] + 0.00 0.00 16560/34409 add_income [625] + 0.00 0.00 16560/472418 produceexp [322] + 0.00 0.00 11159/79772 entertainmoney [643] + 0.00 0.00 16560/2599554 change_money [337] + 0.00 0.00 16560/2186159 rsetmoney [553] + 0.00 0.00 16560/4666665 rmoney [452] +----------------------------------------------- + 0.00 0.01 14191/14191 battle_flee [352] +[638] 0.0 0.00 0.01 14191 flee [638] + 0.00 0.01 14191/25088 kill_troop [532] + 0.00 0.00 14191/337987 setguard [815] +----------------------------------------------- + 0.00 0.01 1711/1711 cr_output_unit [19] +[639] 0.0 0.00 0.01 1711 cr_output_spells [639] + 0.00 0.00 33909/4434556 translate [75] + 0.00 0.00 33909/86400 spell_name [646] + 0.00 0.00 33909/4133717 mkname [261] + 0.00 0.00 35101/10103290 stream_printf [158] + 0.00 0.00 1711/597806 unit_get_spellbook [427] +----------------------------------------------- + 0.00 0.00 2/797288 sp_enterastral [1045] + 0.00 0.01 797286/797288 random_neighbour [153] +[640] 0.0 0.00 0.01 797288 can_survive [640] + 0.00 0.00 173175/12246335 ct_find [114] + 0.00 0.00 949946/129167539 u_race [89] + 0.00 0.00 19730/10190660 get_curse [143] + 0.00 0.00 19730/4201030 curse_active [543] + 0.00 0.00 742475/744202 has_horses [1378] +----------------------------------------------- + 0.00 0.00 93452/190469 describe [35] + 0.00 0.00 97017/190469 cr_borders [135] +[641] 0.0 0.00 0.01 190469 border_name [641] + 0.00 0.01 190467/190467 b_nameroad [642] + 0.00 0.00 2/2 b_namequestportal [1279] +----------------------------------------------- + 0.00 0.01 190467/190467 border_name [641] +[642] 0.0 0.00 0.01 190467 b_nameroad [642] + 0.00 0.00 93450/24887945 locale_string [27] + 0.00 0.00 93450/4133717 mkname [261] + 0.00 0.00 2705/5461936 slprintf [548] +----------------------------------------------- + 0.00 0.00 11159/79772 expandentertainment [637] + 0.00 0.00 31676/79772 statistics [70] + 0.00 0.00 36937/79772 cr_output_region [10] +[643] 0.0 0.00 0.01 79772 entertainmoney [643] + 0.00 0.00 159633/12246335 ct_find [114] + 0.00 0.00 159633/10190660 get_curse [143] + 0.00 0.00 159544/4201030 curse_active [543] + 0.00 0.00 79772/4666665 rmoney [452] + 0.00 0.00 159633/651711 oldcursename [1381] + 0.00 0.00 89/432940 curse_geteffect [1395] +----------------------------------------------- + 0.00 0.00 2/201744 sp_bloodsacrifice [1209] + 0.00 0.00 3/201744 sp_song_of_peace [939] + 0.00 0.00 6/201744 sp_mallornhain [968] + 0.00 0.00 9/201744 sp_hain [931] + 0.00 0.00 9/201744 sp_summonundead [896] + 0.00 0.00 21/201744 sp_kampfzauber [957] + 0.00 0.00 53/201744 sp_dragonodem [627] + 0.00 0.00 1714/201744 eaten_by_monster [468] + 0.00 0.00 2200/201744 absorbed_by_monster [804] + 0.00 0.01 197727/201744 scared_by_monster [380] +[644] 0.0 0.00 0.01 201744 lovar [644] + 0.00 0.00 403488/7641081 genrand_int31 [171] + 0.00 0.00 1/1 register_reports [1851] +----------------------------------------------- + 0.00 0.01 80630/80630 terminate [242] +[645] 0.0 0.00 0.01 80630 calculate_armor [645] + 0.00 0.00 80630/80630 select_magicarmor [680] + 0.00 0.00 7938/7957 magic_resistance [727] + 0.00 0.00 80630/80630 natural_armor [788] + 0.00 0.00 161260/868104 select_armor [700] + 0.00 0.00 7938/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 8/86400 do_combatmagic [825] + 0.00 0.00 23/86400 do_combatspell [702] + 0.00 0.00 279/86400 cr_spell [1026] + 0.00 0.00 604/86400 eval_spell [961] + 0.00 0.00 1261/86400 cr_output_unit [19] + 0.00 0.00 2081/86400 cr_reportspell [756] + 0.00 0.00 2081/86400 nr_spell_syntax [732] + 0.00 0.00 2081/86400 nr_spell [507] + 0.00 0.00 8557/86400 select_spellbook [761] + 0.00 0.00 33909/86400 cr_output_spells [639] + 0.00 0.00 35516/86400 bufunit [17] +[646] 0.0 0.00 0.01 86400 spell_name [646] + 0.00 0.00 86400/24887945 locale_string [27] + 0.00 0.00 86400/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 1/41248 movement_error [1193] + 0.00 0.00 1/41248 travel_i [92] + 0.00 0.00 1/41248 allocate_resource [752] + 0.00 0.00 1/41248 plant [1184] + 0.00 0.00 1/41248 planttrees [1206] + 0.00 0.00 2/41248 travel [81] + 0.00 0.00 2/41248 give_men [857] + 0.00 0.00 3/41248 mail_cmd [844] + 0.00 0.00 4/41248 init_transportation [384] + 0.00 0.00 4/41248 ship_ready [354] + 0.00 0.00 4/41248 spy_cmd [990] + 0.00 0.00 5/41248 buy [707] + 0.00 0.00 10/41248 make_cmd [383] + 0.00 0.00 10/41248 tax_cmd [697] + 0.00 0.00 16/41248 build_road [950] + 0.00 0.00 19/41248 enter_building [695] + 0.00 0.00 22/41248 check_give [1138] + 0.00 0.00 24/41248 cancast [833] + 0.00 0.00 46/41248 steal_cmd [766] + 0.00 0.00 57/41248 start_battle [297] + 0.00 0.00 84/41248 do_work [612] + 0.00 0.00 170/41248 guard_on_cmd [656] + 0.00 0.00 182/41248 msg_materials_required [1005] + 0.00 0.00 186/41248 study_cmd [105] + 0.00 0.00 1225/41248 give_item [126] + 0.00 0.00 1323/41248 teach_cmd [272] + 0.00 0.00 8935/41248 msg_error [744] + 0.00 0.00 28910/41248 give_cmd [102] +[647] 0.0 0.00 0.01 41248 msg_feedback [647] + 0.00 0.00 41248/1010116 mt_find [227] + 0.00 0.00 41248/1009159 msg_create [228] + 0.00 0.00 123744/123744 arg_set [1434] +----------------------------------------------- + 0.00 0.01 53/53 attack [84] +[648] 0.0 0.00 0.01 53 do_extra_spell [648] + 0.00 0.01 53/74 cast_combatspell [623] +----------------------------------------------- + 0.00 0.01 832876/832876 parse [333] +[649] 0.0 0.00 0.01 832876 parse_int [649] + 0.01 0.00 832876/13102790 opstack_push [202] +----------------------------------------------- + 0.00 0.01 1835/1835 economics [78] +[650] 0.0 0.00 0.01 1835 recruit [650] + 0.00 0.00 1716/15361 is_guarded [377] + 0.00 0.00 3359/541982 get_pooled [104] + 0.00 0.00 1670/760673 addlist [217] + 0.00 0.00 3340/2624955 has_skill [193] + 0.00 0.00 1835/57138 getint [699] + 0.00 0.00 1689/71815034 get_race [12] + 0.00 0.00 1670/635885 copy_order [441] + 0.00 0.00 1689/12246335 ct_find [114] + 0.00 0.00 1689/10190660 get_curse [143] + 0.00 0.00 119/119 syntax_error [1036] + 0.00 0.00 378/2281756 gettoken [195] + 0.00 0.00 1835/1027665 init_order [613] + 0.00 0.00 3551/129167539 u_race [89] + 0.00 0.00 3359/56052475 get_resourcetype [194] + 0.00 0.00 46/15102 cmistake [718] + 0.00 0.00 1689/4201030 curse_active [543] + 0.00 0.00 1689/18647447 getplane [596] + 0.00 0.00 4/338 findrace [1030] + 0.00 0.00 1716/1716 recruit_cost [1564] + 0.00 0.00 1716/600145 u_setrace [1389] + 0.00 0.00 1689/651711 oldcursename [1381] + 0.00 0.00 89/40692 get_gamedate [1466] + 0.00 0.00 89/59694 r_insectstalled [1446] +----------------------------------------------- + 0.00 0.00 5/490901 name_cmd [835] + 0.00 0.01 490896/490901 default_wage [173] +[651] 0.0 0.00 0.01 490901 largestbuilding [651] + 0.00 0.00 396305/396305 cmp_wage [670] + 0.00 0.00 172276/51974272 a_find [65] +----------------------------------------------- + 0.00 0.01 329691/329691 is_guard [211] +[652] 0.0 0.00 0.01 329691 getguard [652] + 0.00 0.00 329691/51974272 a_find [65] + 0.00 0.00 329691/377253 guard_flags [690] +----------------------------------------------- + +[653] 0.0 0.01 0.00 cb_new_kv [653] +----------------------------------------------- + 0.00 0.00 353422/353422 hits [131] +[654] 0.0 0.00 0.00 353422 contest [654] + 0.00 0.00 353422/353422 contest_classic [655] +----------------------------------------------- + 0.00 0.00 353422/353422 contest [654] +[655] 0.0 0.00 0.00 353422 contest_classic [655] + 0.00 0.00 373896/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.00 30554/30554 process [7] +[656] 0.0 0.00 0.00 30554 guard_on_cmd [656] + 0.00 0.00 23993/55350 can_start_guarding [679] + 0.00 0.00 30554/69432 getparam [681] + 0.00 0.00 23993/71815034 get_race [12] + 0.00 0.00 6527/15102 cmistake [718] + 0.00 0.00 30554/55492327 getkeyword [54] + 0.00 0.00 30554/1027665 init_order [613] + 0.00 0.00 23781/23781 guard [865] + 0.00 0.00 47987/129167539 u_race [89] + 0.00 0.00 170/41248 msg_feedback [647] + 0.00 0.00 170/392959 add_message [434] + 0.00 0.00 170/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 79/39810 drift_target [1053] + 0.00 0.00 39731/39810 sail [181] +[657] 0.0 0.00 0.00 39810 check_ship_allowed [657] + 0.00 0.00 39810/560926 bt_find [237] + 0.00 0.00 1357/12933 owner_buildingtyp [676] + 0.00 0.00 1198/9953180 alliedunit [31] + 0.00 0.00 1198/8898 ucontact [927] + 0.00 0.00 179/188 is_freezing [1088] + 0.00 0.00 39810/59694 r_insectstalled [1446] + 0.00 0.00 39810/75797 buildingtype_exists [1443] +----------------------------------------------- + 0.00 0.00 32670/32670 demographics [50] +[658] 0.0 0.00 0.00 32670 peasants [658] + 0.00 0.00 32670/264251 rsetpeasants [545] + 0.00 0.00 32670/669051 production [417] + 0.00 0.00 30250/1336242 rng_injectable_double [396] + 0.00 0.00 67774/2605004 rpeasants [435] + 0.00 0.00 66416/2765718 maintenance_cost [481] + 0.00 0.00 30250/51974272 a_find [65] + 0.00 0.00 30250/4984610 config_get_int [348] + 0.00 0.00 32670/2186159 rsetmoney [553] + 0.00 0.00 32670/4666665 rmoney [452] + 0.00 0.00 30250/30308 peasant_growth_factor [928] + 0.00 0.00 30250/30250 peasant_luck_effect [984] + 0.00 0.00 110/967784 msg_message [132] + 0.00 0.00 110/392959 add_message [434] + 0.00 0.00 110/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 178254/178254 ageing [185] +[659] 0.0 0.00 0.00 178254 age_region [659] + 0.00 0.00 178254/839202 a_age [418] + 0.00 0.00 178254/1342832 handle_event [1363] + 0.00 0.00 32670/32670 morale_update [1479] +----------------------------------------------- + 0.00 0.00 5049/5049 move_pirates [326] +[660] 0.0 0.00 0.00 5049 piracy_cmd [660] + 0.00 0.00 30248/47287 canswim [682] + 0.00 0.00 21148/369586 r_connect [474] + 0.00 0.00 5049/967784 msg_message [132] + 0.00 0.00 99/103784 move_cmd [66] + 0.00 0.00 5049/392959 add_message [434] + 0.00 0.00 5049/5049 parse_ids [852] + 0.00 0.00 5049/5049 find_piracy_target [967] + 0.00 0.00 315/4374788 visible_faction [68] + 0.00 0.00 315/9953180 alliedunit [31] + 0.00 0.00 5049/5049 validate_pirate [1051] + 0.00 0.00 99/447808 create_order [341] + 0.00 0.00 412/7641081 genrand_int31 [171] + 0.00 0.00 99/24887945 locale_string [27] + 0.00 0.00 322/3358315 ship_owner [438] + 0.00 0.00 36/4361 can_takeoff [854] + 0.00 0.00 97/779419 a_add [555] + 0.00 0.00 99/1027665 init_order [613] + 0.00 0.00 5049/1009028 msg_release [1373] + 0.00 0.00 99/1936876 free_order [1356] + 0.00 0.00 97/97 mk_piracy [1652] +----------------------------------------------- + 0.00 0.00 1921/1921 report_computer [9] +[661] 0.0 0.00 0.00 1921 show_allies_cr [661] + 0.00 0.00 55310/10375491 alliedgroup [34] +----------------------------------------------- + 0.00 0.00 133873/133873 cr_render [196] +[662] 0.0 0.00 0.00 133873 cr_region [662] + 0.00 0.00 132705/1826688 adjust_coordinates [234] + 0.00 0.00 132705/18647447 getplane [596] + 0.00 0.00 132705/3587241 pnormalize [1350] +----------------------------------------------- + 0.00 0.00 1771752/1771752 get_food [88] +[663] 0.0 0.00 0.00 1771752 help_money [663] + 0.00 0.00 1771752/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 12828/26045 cr_output_curses [69] + 0.00 0.00 13217/26045 nr_curses_i [401] +[664] 0.0 0.00 0.00 26045 msg_curse [664] + 0.00 0.00 15359/15359 cinfo_building [686] + 0.00 0.00 5907/5907 cinfo_simple [751] + 0.00 0.00 2274/2274 cinfo_ship [812] + 0.00 0.00 1911/1911 cinfo_magicresistance [824] + 0.00 0.00 183/183 cinfo_magicrunes [996] + 0.00 0.00 163/163 cinfo_shipnodrift [997] + 0.00 0.00 62/62 cinfo_speed [1110] + 0.00 0.00 134/134 cinfo_slave [1118] + 0.00 0.00 52/52 cinfo_skillmod [1192] +----------------------------------------------- + 0.00 0.00 16596/16596 produce [29] +[665] 0.0 0.00 0.00 16596 entertain_cmd [665] + 0.00 0.00 33156/12320804 effskill [100] + 0.00 0.00 16560/16751 getuint [778] + 0.00 0.00 278/15361 is_guarded [377] + 0.00 0.00 16560/12246335 ct_find [114] + 0.00 0.00 16560/10190660 get_curse [143] + 0.00 0.00 16596/1027665 init_order [613] + 0.00 0.00 16597/20777534 config_get [224] + 0.00 0.00 16560/4201030 curse_active [543] + 0.00 0.00 16593/8506411 besieged [547] + 0.00 0.00 36/15102 cmistake [718] + 0.00 0.00 16560/651711 oldcursename [1381] +----------------------------------------------- + 0.00 0.00 38/317239 count_allies [1220] + 0.00 0.00 317201/317239 count_enemies_i [636] +[666] 0.0 0.00 0.00 317239 count_side [666] + 0.00 0.00 49445/1662377 get_unitrow [154] + 0.00 0.00 324731/4301501 statusrow [550] +----------------------------------------------- + 0.00 0.00 55/598069 renumber_unit [1159] + 0.00 0.00 2889/598069 createunitid [317] + 0.00 0.00 595125/598069 read_unit [74] +[667] 0.0 0.00 0.00 598069 uhash [667] + 0.00 0.00 598069/2903884 jenkins_hash [439] +----------------------------------------------- + 0.00 0.00 1/534930 destroy_cmd [1113] + 0.00 0.00 16/534930 addparam_unit [1214] + 0.00 0.00 42/534930 teach_cmd [272] + 0.00 0.00 241/534930 reshow_cmd [818] + 0.00 0.00 280/534930 use_cmd [763] + 0.00 0.00 24385/534930 parse_order [117] + 0.00 0.00 94233/534930 give_cmd [102] + 0.00 0.00 131764/534930 give_control_cmd [287] + 0.00 0.00 283968/534930 read_unitid [413] +[668] 0.0 0.00 0.00 534930 isparam [668] + 0.00 0.00 362487/1787006 findparam [458] +----------------------------------------------- + 0.00 0.00 191/66134 follow_ship [749] + 0.00 0.00 18850/66134 cr_output_ship [152] + 0.00 0.00 47093/66134 sail [181] +[669] 0.0 0.00 0.00 66134 shipspeed [669] + 0.00 0.00 67682/12246335 ct_find [114] + 0.00 0.00 67682/10190660 get_curse [143] + 0.00 0.00 66058/51974272 a_find [65] + 0.00 0.00 66058/66058 ShipSpeedBonus [806] + 0.00 0.00 66134/3358315 ship_owner [438] + 0.00 0.00 132028/129167539 u_race [89] + 0.00 0.00 1624/4201030 curse_active [543] + 0.00 0.00 820/820 curse_geteffect_int [1590] +----------------------------------------------- + 0.00 0.00 396305/396305 largestbuilding [651] +[670] 0.0 0.00 0.00 396305 cmp_wage [670] + 0.00 0.00 396305/1106528 is_building_type [554] +----------------------------------------------- + 0.00 0.00 40099/40099 parse_symbol [42] +[671] 0.0 0.00 0.00 40099 eval_skill [671] + 0.00 0.00 40099/2934859 skillname [122] + 0.00 0.00 40099/13102790 opstack_pop [176] + 0.00 0.00 40099/13102790 opstack_push [202] + 0.00 0.00 40099/13399069 balloc [363] +----------------------------------------------- + 0.00 0.00 20072/20072 cr_render [196] +[672] 0.0 0.00 0.00 20072 cr_skill [672] + 0.00 0.00 20072/4434556 translate [75] + 0.00 0.00 20072/2934859 skillname [122] + 0.00 0.00 20072/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 15708/15708 get_addresses [20] +[673] 0.0 0.00 0.00 15708 add_travelthru_addresses [673] + 0.00 0.00 15708/3398582 travelthru_map [41] +----------------------------------------------- + 0.00 0.00 15/355423 sp_summonundead [896] + 0.00 0.00 355408/355423 spawn_undead [629] +[674] 0.0 0.00 0.00 355423 deathcount [674] + 0.00 0.00 355423/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 40/40 set_new_dragon_target [486] +[675] 0.0 0.00 0.00 40 regions_in_range [675] + 0.00 0.00 30233/162862 allowed_dragon [564] + 0.00 0.00 25793/369586 r_connect [474] + 0.00 0.00 27734/152803 new_node [1427] + 0.00 0.00 40/428 free_nodes [1604] +----------------------------------------------- + 0.00 0.00 1357/12933 check_ship_allowed [657] + 0.00 0.00 4629/12933 expandselling [93] + 0.00 0.00 6947/12933 sail [181] +[676] 0.0 0.00 0.00 12933 owner_buildingtyp [676] + 0.00 0.00 28665/593636 building_owner [232] + 0.00 0.00 2920/147171 building_finished [1428] +----------------------------------------------- + 0.00 0.00 2594/83224 make_fighter [424] + 0.00 0.00 80630/83224 select_magicarmor [680] +[677] 0.0 0.00 0.00 83224 trollbelts [677] + 0.00 0.00 83224/5395063 i_get [130] + 0.00 0.00 83224/2032164 rt_find [597] +----------------------------------------------- + 0.00 0.00 106798/106798 get_food [88] +[678] 0.0 0.00 0.00 106798 help_feed [678] + 0.00 0.00 106798/7120688 get_money [187] + 0.00 0.00 106798/4198692 lifestyle [286] + 0.00 0.00 32382/2599554 change_money [337] + 0.00 0.00 16191/16191 add_donation [1509] +----------------------------------------------- + 0.00 0.00 23993/55350 guard_on_cmd [656] + 0.00 0.00 31357/55350 update_guards [415] +[679] 0.0 0.00 0.00 55350 can_start_guarding [679] + 0.00 0.00 15347/771861 armedmen [151] + 0.00 0.00 39959/3902878 get_monsters [293] + 0.00 0.00 15173/16669 IsImmune [901] + 0.00 0.00 15347/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 80630/80630 calculate_armor [645] +[680] 0.0 0.00 0.00 80630 select_magicarmor [680] + 0.00 0.00 80630/83224 trollbelts [677] +----------------------------------------------- + 0.00 0.00 6/69432 send_cmd [1202] + 0.00 0.00 17/69432 status_cmd [904] + 0.00 0.00 138/69432 reshow_cmd [818] + 0.00 0.00 597/69432 move_hunters [342] + 0.00 0.00 677/69432 ally_cmd [877] + 0.00 0.00 1425/69432 follow_unit [331] + 0.00 0.00 5384/69432 teach_cmd [272] + 0.00 0.00 30554/69432 guard_on_cmd [656] + 0.00 0.00 30634/69432 guard_off_cmd [711] +[681] 0.0 0.00 0.00 69432 getparam [681] + 0.00 0.00 69432/2281756 gettoken [195] + 0.00 0.00 7650/1787006 findparam [458] +----------------------------------------------- + 0.00 0.00 1953/47287 travel_route [147] + 0.00 0.00 7542/47287 monthly_healing [215] + 0.00 0.00 7544/47287 drown [394] + 0.00 0.00 30248/47287 piracy_cmd [660] +[682] 0.0 0.00 0.00 47287 canswim [682] + 0.00 0.00 47287/5395063 i_get [130] + 0.00 0.00 47287/1177511 it_find [385] + 0.00 0.00 92804/129167539 u_race [89] + 0.00 0.00 486/116002 get_movement [750] +----------------------------------------------- + 0.00 0.00 12778/34221 canwalk [633] + 0.00 0.00 21443/34221 canride [465] +[683] 0.0 0.00 0.00 34221 eff_weight [683] + 0.00 0.00 34221/279395 weight [459] + 0.00 0.00 34221/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 11880/11880 cb_add_address [598] +[684] 0.0 0.00 0.00 11880 cansee_unit [684] + 0.00 0.00 13580/1753922 invisible [139] + 0.00 0.00 9999/1188532 eff_stealth [163] + 0.00 0.00 6428/12320804 effskill [100] + 0.00 0.00 11880/6610983 is_guard [211] + 0.00 0.00 11880/129167539 u_race [89] + 0.00 0.00 11880/4835422 usiege [593] + 0.00 0.00 6428/21345834 skill_enabled [365] +----------------------------------------------- + 0.00 0.00 46224/46224 parse_symbol [42] +[685] 0.0 0.00 0.00 46224 eval_faction [685] + 0.00 0.00 46224/1295787 factionname [247] + 0.00 0.00 46224/13102790 opstack_pop [176] + 0.00 0.00 46224/13102790 opstack_push [202] + 0.00 0.00 46224/13399069 balloc [363] +----------------------------------------------- + 0.00 0.00 15359/15359 msg_curse [664] +[686] 0.0 0.00 0.00 15359 cinfo_building [686] + 0.00 0.00 15359/967784 msg_message [132] + 0.00 0.00 15359/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 151532/2155959 report_template [87] + 0.00 0.00 606357/2155959 read_unit [74] + 0.00 0.00 692829/2155959 write_unit [97] + 0.00 0.00 705241/2155959 cr_output_unit [19] +[687] 0.0 0.00 0.00 2155959 is_persistent [687] + 0.00 0.00 766833/2985733 is_repeated [552] +----------------------------------------------- + 0.00 0.00 2594/12398 battle_report [503] + 0.00 0.00 4384/12398 battle_punit [620] + 0.00 0.00 5420/12398 print_stats [525] +[688] 0.0 0.00 0.00 12398 fbattlerecord [688] + 0.00 0.00 12398/967784 msg_message [132] + 0.00 0.00 12398/31214 message_faction [716] + 0.00 0.00 12398/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 230/230 report_computer [9] +[689] 0.0 0.00 0.00 230 write_translations [689] + 0.00 0.00 50896/4488684 crtag [110] +----------------------------------------------- + 0.00 0.00 23781/377253 setguard [815] + 0.00 0.00 23781/377253 guard [865] + 0.00 0.00 329691/377253 getguard [652] +[690] 0.0 0.00 0.00 377253 guard_flags [690] + 0.00 0.00 377253/12560453 rc_changed [256] + 0.00 0.00 407896/129167539 u_race [89] + 0.00 0.00 3/71815034 get_race [12] +----------------------------------------------- + 0.00 0.00 115/1239 build_ship [839] + 0.00 0.00 149/1239 create_potion [821] + 0.00 0.00 377/1239 manufacture [759] + 0.00 0.00 598/1239 build_building [696] +[691] 0.0 0.00 0.00 1239 build [691] + 0.00 0.00 1484/860263 use_pooled [39] + 0.00 0.00 1816/541982 get_pooled [104] + 0.00 0.00 1705/12320804 skillmod [214] + 0.00 0.00 1230/12320804 effskill [100] + 0.00 0.00 1040/472418 produceexp [322] + 0.00 0.00 4475/4475 matmod [975] + 0.00 0.00 1356/6010308 i_find [127] + 0.00 0.00 1230/2858912 get_effect [225] + 0.00 0.00 1356/56052475 get_resourcetype [194] + 0.00 0.00 1578/1583 skill_limit [1172] + 0.00 0.00 95/2977 change_effect [982] + 0.00 0.00 61/3003 roqf_factor [1329] + 0.00 0.00 4530/26164 building_is_active [1488] + 0.00 0.00 2978/3100 required [1547] + 0.00 0.00 1733/26995 inside_building [1486] +----------------------------------------------- + 0.00 0.00 55/285923 renumber_unit [1159] + 0.00 0.00 110903/285923 findnewunit [753] + 0.00 0.00 174965/285923 cr_output_unit [19] +[692] 0.0 0.00 0.00 285923 ualias [692] + 0.00 0.00 285923/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 206/206 do_battle [64] +[693] 0.0 0.00 0.00 206 join_allies [693] + 0.00 0.00 345/3203 join_battle [425] + 0.00 0.00 2033/9953180 alliedunit [31] + 0.00 0.00 23/48 allysfm [1122] + 0.00 0.00 498/8506411 besieged [547] + 0.00 0.00 719/18647447 getplane [596] + 0.00 0.00 3/10375491 alliedgroup [34] + 0.00 0.00 1520/1520 set_friendly [1574] + 0.00 0.00 644/2073 set_enemy [1562] +----------------------------------------------- + 0.00 0.00 21443/21443 canride [465] +[694] 0.0 0.00 0.00 21443 ridingcapacity [694] + 0.00 0.00 33015/12320804 effskill [100] + 0.00 0.00 21443/129167539 u_race [89] + 0.00 0.00 21443/130867 get_transporters [1431] +----------------------------------------------- + 0.00 0.00 405/405 do_enter [128] +[695] 0.0 0.00 0.00 405 enter_building [695] + 0.00 0.00 323/2887 leave [432] + 0.00 0.00 401/401 mayenter [936] + 0.00 0.00 19/41248 msg_feedback [647] + 0.00 0.00 409/129167539 u_race [89] + 0.00 0.00 19/392959 add_message [434] + 0.00 0.00 1/15102 cmistake [718] + 0.00 0.00 401/48455 findbuilding [1462] + 0.00 0.00 323/677 slipthru [1593] + 0.00 0.00 323/48565 u_set_building [1460] + 0.00 0.00 19/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 621/621 make_cmd [383] +[696] 0.0 0.00 0.00 621 build_building [696] + 0.00 0.00 598/1239 build [691] + 0.00 0.00 490/10232 update_lighthouse [605] + 0.00 0.00 490/14326 replace_order [526] + 0.00 0.00 490/967784 msg_message [132] + 0.00 0.00 9/2887 leave [432] + 0.00 0.00 621/12320804 effskill [100] + 0.00 0.00 581/392959 add_message [434] + 0.00 0.00 490/24887945 locale_string [27] + 0.00 0.00 325/447808 create_order [341] + 0.00 0.00 91/182 msg_materials_required [1005] + 0.00 0.00 9/11 new_building [1059] + 0.00 0.00 165/3110 default_order [902] + 0.00 0.00 587/4984610 config_get_int [348] + 0.00 0.00 31/15102 cmistake [718] + 0.00 0.00 598/8506411 besieged [547] + 0.00 0.00 610/48455 findbuilding [1462] + 0.00 0.00 581/1009028 msg_release [1373] + 0.00 0.00 490/1936876 free_order [1356] + 0.00 0.00 9/48565 u_set_building [1460] + 0.00 0.00 2/75797 buildingtype_exists [1443] +----------------------------------------------- + 0.00 0.00 960/960 produce [29] +[697] 0.0 0.00 0.00 960 tax_cmd [697] + 0.00 0.00 956/15361 is_guarded [377] + 0.00 0.00 2659/12320804 effskill [100] + 0.00 0.00 960/771861 armedmen [151] + 0.00 0.00 948/760673 addlist [217] + 0.00 0.00 956/57138 getint [699] + 0.00 0.00 960/71815034 get_race [12] + 0.00 0.00 3836/129167539 u_race [89] + 0.00 0.00 960/1027665 init_order [613] + 0.00 0.00 10/41248 msg_feedback [647] + 0.00 0.00 960/8506411 besieged [547] + 0.00 0.00 10/392959 add_message [434] + 0.00 0.00 2/15102 cmistake [718] + 0.00 0.00 1/4984610 config_get_int [348] + 0.00 0.00 10/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 56643/56643 bufunit [17] +[698] 0.0 0.00 0.00 56643 groupid [698] + 0.00 0.00 56643/5100840 itoa36 [116] +----------------------------------------------- + 0.00 0.00 10/57138 combatspell_cmd [898] + 0.00 0.00 42/57138 loot_cmd [873] + 0.00 0.00 108/57138 cast_cmd [760] + 0.00 0.00 956/57138 tax_cmd [697] + 0.00 0.00 1835/57138 recruit [650] + 0.00 0.00 5916/57138 buy [707] + 0.00 0.00 16751/57138 getuint [778] + 0.00 0.00 31520/57138 reserve_i [213] +[699] 0.0 0.00 0.00 57138 getint [699] + 0.00 0.00 57138/2281756 gettoken [195] +----------------------------------------------- + 0.00 0.00 161260/868104 calculate_armor [645] + 0.00 0.00 706844/868104 hits [131] +[700] 0.0 0.00 0.00 868104 select_armor [700] + 0.00 0.00 868104/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 206/206 do_battle [64] +[701] 0.0 0.00 0.00 206 aftermath [701] + 0.00 0.00 136/2887 leave [432] + 0.00 0.00 319/319 loot_items [810] + 0.00 0.00 1992/967784 msg_message [132] + 0.00 0.00 3056/31214 message_faction [716] + 0.00 0.00 206/412 do_combatmagic [825] + 0.00 0.00 425/425 reportcasualties [881] + 0.00 0.00 552/18788 sideabkz [745] + 0.00 0.00 340/11241829 i_change [115] + 0.00 0.00 425/3178 scale_number [969] + 0.00 0.00 623/1474687 leftship [500] + 0.00 0.00 1722/129167539 u_race [89] + 0.00 0.00 206/206 battle_effects [1125] + 0.00 0.00 319/337987 setguard [815] + 0.00 0.00 60/4301501 statusrow [550] + 0.00 0.00 12/717218 config_get_flt [714] + 0.00 0.00 2594/2913 dead_fighters [1549] + 0.00 0.00 2168/24449 seematrix [1491] + 0.00 0.00 1992/1009028 msg_release [1373] + 0.00 0.00 1104/22301 army_index [1498] + 0.00 0.00 206/206 reorder_fleeing [1631] + 0.00 0.00 12/160 damage_ship [1641] +----------------------------------------------- + 0.00 0.00 38/38 attack [84] +[702] 0.0 0.00 0.00 38 do_combatspell [702] + 0.00 0.00 21/74 cast_combatspell [623] + 0.00 0.00 23/251 cancast [833] + 0.00 0.00 23/251 eff_spelllevel [845] + 0.00 0.00 23/226 fumble [973] + 0.00 0.00 2/273 pay_spell [805] + 0.00 0.00 23/1339 get_combatspelllevel [880] + 0.00 0.00 21/225 spellpower [1000] + 0.00 0.00 23/447808 create_order [341] + 0.00 0.00 23/86400 spell_name [646] + 0.00 0.00 38/4875 get_combatspell [874] + 0.00 0.00 2/3 report_failed_spell [1187] + 0.00 0.00 21/7641081 genrand_int31 [171] + 0.00 0.00 21/1936876 free_order [1356] +----------------------------------------------- + 0.00 0.00 1078/11989 resolve_mage [856] + 0.00 0.00 1202/11989 resolve_familiar [846] + 0.00 0.00 2607/11989 resolve [757] + 0.00 0.00 7102/11989 read_reference [726] +[703] 0.0 0.00 0.00 11989 resolve_unit [703] + 0.00 0.00 9926/888603 findunit [123] +----------------------------------------------- + 0.00 0.00 6962/6962 move_ship [374] +[704] 0.0 0.00 0.00 6962 leave_trail [704] + 0.00 0.00 39729/263302 reldirection [528] + 0.00 0.00 39729/51974272 a_find [65] + 0.00 0.00 3233/779419 a_add [555] + 0.00 0.00 3233/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 6/22644 rsetroad [1152] + 0.00 0.00 22638/22644 read_borders [706] +[705] 0.0 0.00 0.00 22644 new_border [705] + 0.00 0.00 22644/2248440 get_borders_i [118] +----------------------------------------------- + 0.00 0.00 1/1 read_game [62] +[706] 0.0 0.00 0.00 1 read_borders [706] + 0.00 0.00 22638/22644 new_border [705] + 0.00 0.00 45276/46742 findregionbyid [1463] + 0.00 0.00 22638/22638 find_bordertype [1496] + 0.00 0.00 22637/22637 b_readroad [1497] + 0.00 0.00 1/1 b_read [1791] +----------------------------------------------- + 0.00 0.00 5916/5916 produce [29] +[707] 0.0 0.00 0.00 5916 buy [707] + 0.00 0.00 5757/760673 addlist [217] + 0.00 0.00 5903/12320804 effskill [100] + 0.00 0.00 5916/57138 getint [699] + 0.00 0.00 5762/2281756 gettoken [195] + 0.00 0.00 5915/71815034 get_race [12] + 0.00 0.00 30/15361 is_guarded [377] + 0.00 0.00 5903/51974272 a_find [65] + 0.00 0.00 3642/779419 a_add [555] + 0.00 0.00 5916/1027665 init_order [613] + 0.00 0.00 5762/191379 finditemtype [735] + 0.00 0.00 154/15102 cmistake [718] + 0.00 0.00 5915/129167539 u_race [89] + 0.00 0.00 5915/8506411 besieged [547] + 0.00 0.00 5/41248 msg_feedback [647] + 0.00 0.00 5/392959 add_message [434] + 0.00 0.00 1/560926 bt_find [237] + 0.00 0.00 5762/21500 resource2luxury [1499] + 0.00 0.00 5762/308950 r_demand [1404] + 0.00 0.00 5460/204314 bt_changed [1415] + 0.00 0.00 3642/779868 a_new [1376] + 0.00 0.00 847/1511812 newterrain [1359] + 0.00 0.00 5/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 11599/11599 skilldiff [166] +[708] 0.0 0.00 0.00 11599 building_protection [708] + 0.00 0.00 11599/184870 buildingeffsize [367] +----------------------------------------------- + 0.00 0.00 12984/748527 plan_monsters [52] + 0.00 0.00 317735/748527 monster_learn [269] + 0.00 0.00 417808/748527 study_cmd [105] +[709] 0.0 0.00 0.00 748527 unit_can_study [709] + 0.00 0.00 748527/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 42/54318 teach_cmd [272] + 0.00 0.00 191/54318 follow_ship [749] + 0.00 0.00 620/54318 mail_cmd [844] + 0.00 0.00 621/54318 group_cmd [985] + 0.00 0.00 2012/54318 display_cmd [859] + 0.00 0.00 3114/54318 name_cmd [835] + 0.00 0.00 5053/54318 parse_ids [852] + 0.00 0.00 42665/54318 sail [181] +[710] 0.0 0.00 0.00 54318 getstrtoken [710] + 0.00 0.00 54318/5387327 parse_token [125] +----------------------------------------------- + 0.00 0.00 30634/30634 process [7] +[711] 0.0 0.00 0.00 30634 guard_off_cmd [711] + 0.00 0.00 30634/69432 getparam [681] + 0.00 0.00 30634/55492327 getkeyword [54] + 0.00 0.00 30634/1027665 init_order [613] + 0.00 0.00 76/337987 setguard [815] +----------------------------------------------- + 0.00 0.00 46184/46184 ageing [185] +[712] 0.0 0.00 0.00 46184 age_building [712] + 0.00 0.00 46184/839202 a_age [418] + 0.00 0.00 46184/1106528 is_building_type [554] + 0.00 0.00 124/124 age_stonecircle [1021] + 0.00 0.00 46184/1342832 handle_event [1363] +----------------------------------------------- + 0.00 0.00 1/717287 heal_factor [619] + 0.00 0.00 68/717287 parse_races [1104] + 0.00 0.00 717218/717287 config_get_flt [714] +[713] 0.0 0.00 0.00 717287 get_param_flt [713] + 0.00 0.00 717287/26776263 get_param [235] +----------------------------------------------- + 0.00 0.00 1/717218 move_iceberg [1094] + 0.00 0.00 1/717218 plan_monsters [52] + 0.00 0.00 12/717218 aftermath [701] + 0.00 0.00 30/717218 overload_start [1295] + 0.00 0.00 58/717218 peasant_luck_factor [1277] + 0.00 0.00 96/717218 sinkships [475] + 0.00 0.00 143/717218 ResourceFactor [1236] + 0.00 0.00 508/717218 MagicRegeneration [1185] + 0.00 0.00 1062/717218 loot_quota [1013] + 0.00 0.00 7273/717218 sail [181] + 0.00 0.00 23838/717218 give_quota [858] + 0.00 0.00 30308/717218 peasant_growth_factor [928] + 0.00 0.00 58080/717218 bewegung_blockiert_von [631] + 0.00 0.00 178254/717218 drifting_ships [490] + 0.00 0.00 417554/717218 random_move_chance [754] +[714] 0.0 0.00 0.00 717218 config_get_flt [714] + 0.00 0.00 717218/717287 get_param_flt [713] +----------------------------------------------- + 0.00 0.00 152504/152504 terrain_name [226] +[715] 0.0 0.00 0.00 152504 plain_name [715] + 0.00 0.00 152504/7910500 r_isforest [199] +----------------------------------------------- + 0.00 0.00 4/31214 terminate [242] + 0.00 0.00 679/31214 print_header [838] + 0.00 0.00 3056/31214 aftermath [701] + 0.00 0.00 4336/31214 print_stats [525] + 0.00 0.00 5188/31214 battle_report [503] + 0.00 0.00 5553/31214 message_all [834] + 0.00 0.00 12398/31214 fbattlerecord [688] +[716] 0.0 0.00 0.00 31214 message_faction [716] + 0.00 0.00 31214/392959 add_message [434] +----------------------------------------------- + 0.00 0.00 981/179235 chaosfactor [1077] + 0.00 0.00 178254/179235 chaos_update [514] +[717] 0.0 0.00 0.00 179235 get_chaoscount [717] + 0.00 0.00 179235/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 1/15102 report_failure [1285] + 0.00 0.00 1/15102 sp_summon_familiar [1025] + 0.00 0.00 1/15102 sp_hain [931] + 0.00 0.00 1/15102 sp_charmingsong [993] + 0.00 0.00 1/15102 enter_building [695] + 0.00 0.00 1/15102 display_cmd [859] + 0.00 0.00 1/15102 try_rename [1225] + 0.00 0.00 1/15102 fumble_default [1284] + 0.00 0.00 1/15102 cast_cmd [760] + 0.00 0.00 2/15102 travel_route [147] + 0.00 0.00 2/15102 tax_cmd [697] + 0.00 0.00 2/15102 give_unit [952] + 0.00 0.00 2/15102 name_cmd [835] + 0.00 0.00 3/15102 give_control_cmd [287] + 0.00 0.00 4/15102 init_transportation [384] + 0.00 0.00 4/15102 breedhorses [742] + 0.00 0.00 4/15102 build_road [950] + 0.00 0.00 5/15102 follow_unit [331] + 0.00 0.00 5/15102 leave_cmd [721] + 0.00 0.00 6/15102 enter_ship [733] + 0.00 0.00 16/15102 reshow_other [823] + 0.00 0.00 22/15102 herbsearch [493] + 0.00 0.00 22/15102 create_item [617] + 0.00 0.00 22/15102 destroy_cmd [1113] + 0.00 0.00 24/15102 do_work [612] + 0.00 0.00 27/15102 combatspell_cmd [898] + 0.00 0.00 31/15102 build_building [696] + 0.00 0.00 32/15102 start_battle [297] + 0.00 0.00 36/15102 entertain_cmd [665] + 0.00 0.00 46/15102 recruit [650] + 0.00 0.00 61/15102 ship_ready [354] + 0.00 0.00 72/15102 renumber_cmd [780] + 0.00 0.00 105/15102 travel_i [92] + 0.00 0.00 107/15102 ally_cmd [877] + 0.00 0.00 112/15102 sail [181] + 0.00 0.00 139/15102 allocate_resource [752] + 0.00 0.00 154/15102 buy [707] + 0.00 0.00 160/15102 follow_ship [749] + 0.00 0.00 163/15102 movement [47] + 0.00 0.00 182/15102 use_cmd [763] + 0.00 0.00 199/15102 continue_ship [813] + 0.00 0.00 234/15102 study_cmd [105] + 0.00 0.00 965/15102 give_cmd [102] + 0.00 0.00 1141/15102 add_give [379] + 0.00 0.00 1178/15102 update_long_order [270] + 0.00 0.00 3277/15102 sell [498] + 0.00 0.00 6527/15102 guard_on_cmd [656] +[718] 0.0 0.00 0.00 15102 cmistake [718] + 0.00 0.00 15102/15240 msg_error [744] + 0.00 0.00 8797/392959 add_message [434] + 0.00 0.00 8797/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 3/178257 tolua_getkey [1281] + 0.00 0.00 178254/178257 tolua_region_getkey [628] +[719] 0.0 0.00 0.00 178257 key_get [719] + 0.00 0.00 178257/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 178254/178254 move_pirates [326] +[720] 0.0 0.00 0.00 178254 age_traveldir [720] + 0.00 0.00 178254/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 236/236 process [7] +[721] 0.0 0.00 0.00 236 leave_cmd [721] + 0.00 0.00 222/2887 leave [432] + 0.00 0.00 5/15102 cmistake [718] + 0.00 0.00 5/129167539 u_race [89] + 0.00 0.00 222/677 slipthru [1593] +----------------------------------------------- + 0.00 0.00 3/174968 cast_cmd [760] + 0.00 0.00 174965/174968 cr_output_unit [19] +[722] 0.0 0.00 0.00 174968 get_familiar_mage [722] + 0.00 0.00 174968/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 5966/5966 herbsearch [493] +[723] 0.0 0.00 0.00 5966 ntimespprob [723] + 0.00 0.00 83094/1336242 rng_injectable_double [396] +----------------------------------------------- + 0.00 0.00 5810/5810 report_donations [725] +[724] 0.0 0.00 0.00 5810 report_transfer [724] + 0.00 0.00 5810/967784 msg_message [132] + 0.00 0.00 11620/12265 r_addmessage [779] + 0.00 0.00 5810/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1/1 reports [2] +[725] 0.0 0.00 0.00 1 report_donations [725] + 0.00 0.00 5810/5810 report_transfer [724] +----------------------------------------------- + 0.00 0.00 1/9763 caldera_read [1270] + 0.00 0.00 1/9763 clonedied_read [1271] + 0.00 0.00 1/9763 giveitem_read [1262] + 0.00 0.00 2/9763 wormhole_read [1238] + 0.00 0.00 3/9763 changerace_read [1215] + 0.00 0.00 10/9763 changefaction_read [1166] + 0.00 0.00 760/9763 read_familiar [893] + 0.00 0.00 760/9763 read_magician [894] + 0.00 0.00 768/9763 shock_read [892] + 0.00 0.00 1138/9763 read_targetregion [870] + 0.00 0.00 2299/9763 killunit_read [817] + 0.00 0.00 4020/9763 curse_read [770] +[726] 0.0 0.00 0.00 9763 read_reference [726] + 0.00 0.00 7102/11989 resolve_unit [703] + 0.00 0.00 760/1202 resolve_familiar [846] + 0.00 0.00 760/1078 resolve_mage [856] + 0.00 0.00 8622/8622 read_unit_reference [1521] + 0.00 0.00 3693/34565 ur_add [1472] + 0.00 0.00 1140/1140 read_region_reference [1582] + 0.00 0.00 1140/1466 resolve_region_id [1575] + 0.00 0.00 1/1 read_building_reference [1831] + 0.00 0.00 1/1 resolve_building [1862] +----------------------------------------------- + 0.00 0.00 3/7957 target_resists_magic [1154] + 0.00 0.00 16/7957 damage_unit [1044] + 0.00 0.00 7938/7957 calculate_armor [645] +[727] 0.0 0.00 0.00 7957 magic_resistance [727] + 0.00 0.00 7957/12320804 effskill [100] + 0.00 0.00 7957/71815034 get_race [12] + 0.00 0.00 7957/5395063 i_get [130] + 0.00 0.00 8573/12246335 ct_find [114] + 0.00 0.00 7957/10190660 get_curse [143] + 0.00 0.00 7957/51974272 a_find [65] + 0.00 0.00 7957/129167539 u_race [89] + 0.00 0.00 7957/56052475 get_resourcetype [194] + 0.00 0.00 7957/18647447 getplane [596] + 0.00 0.00 7957/26995 inside_building [1486] + 0.00 0.00 7957/26164 building_is_active [1488] +----------------------------------------------- + 0.00 0.00 3438/3438 prepare_lighthouse [340] +[728] 0.0 0.00 0.00 3438 lighthouse_range [728] + 0.00 0.00 11409/593636 building_owner [232] + 0.00 0.00 3403/12320804 effskill [100] + 0.00 0.00 3387/21345834 skill_enabled [365] + 0.00 0.00 3387/19671 buildingcapacity [1500] +----------------------------------------------- + 0.00 0.00 25857/25857 parse_symbol [42] +[729] 0.0 0.00 0.00 25857 eval_int36 [729] + 0.00 0.00 25857/5100840 itoa36 [116] + 0.00 0.00 25857/13102790 opstack_pop [176] + 0.00 0.00 25857/13102790 opstack_push [202] + 0.00 0.00 25857/13399069 balloc [363] +----------------------------------------------- + 0.00 0.00 22/45 report_computer [9] + 0.00 0.00 23/45 report_plaintext [4] +[730] 0.0 0.00 0.00 45 count_maxmigrants [730] + 0.00 0.00 45/967 count_all [357] + 0.00 0.00 45/5065285 get_param_int [422] +----------------------------------------------- + 0.00 0.00 22/45 report_computer [9] + 0.00 0.00 23/45 report_plaintext [4] +[731] 0.0 0.00 0.00 45 count_migrants [731] + 0.00 0.00 45/2247 count_faction [219] +----------------------------------------------- + 0.00 0.00 2081/2081 nr_spell [507] +[732] 0.0 0.00 0.00 2081 nr_spell_syntax [732] + 0.00 0.00 2081/2742237 paragraph [26] + 0.00 0.00 4762/24887945 locale_string [27] + 0.00 0.00 2081/86400 spell_name [646] + 0.00 0.00 2622/34611296 strlcpy [45] + 0.00 0.00 7912/36653945 wrptr [178] + 0.00 0.00 140/4133717 mkname [261] + 0.00 0.00 2081/2009097 keyword [1355] +----------------------------------------------- + 0.00 0.00 222/222 do_enter [128] +[733] 0.0 0.00 0.00 222 enter_ship [733] + 0.00 0.00 191/2887 leave [432] + 0.00 0.00 195/195 mayboard [1046] + 0.00 0.00 191/191 CheckOverload [1180] + 0.00 0.00 6/15102 cmistake [718] + 0.00 0.00 222/129167539 u_race [89] + 0.00 0.00 222/28818 findship [1483] + 0.00 0.00 191/27640 u_set_ship [1485] +----------------------------------------------- + 0.00 0.00 41255/41255 copy_arg [521] +[734] 0.0 0.00 0.00 41255 var_copy_order [734] + 0.00 0.00 41255/635885 copy_order [441] +----------------------------------------------- + 0.00 0.00 2/191379 claim_cmd [1242] + 0.00 0.00 103/191379 reshow_other [823] + 0.00 0.00 590/191379 use_cmd [763] + 0.00 0.00 4259/191379 make_cmd [383] + 0.00 0.00 5762/191379 buy [707] + 0.00 0.00 15731/191379 sell [498] + 0.00 0.00 71364/191379 reserve_i [213] + 0.00 0.00 93568/191379 give_cmd [102] +[735] 0.0 0.00 0.00 191379 finditemtype [735] + 0.00 0.00 191379/4457785 transliterate [358] + 0.00 0.00 191379/2124526 locale_index [1354] +----------------------------------------------- + 0.00 0.00 32/115276 travel_i [92] + 0.00 0.00 74/115276 init_transportation [384] + 0.00 0.00 474/115276 follow_ship [749] + 0.00 0.00 475/115276 move_hunters [342] + 0.00 0.00 519/115276 follow_unit [331] + 0.00 0.00 113702/115276 movement [47] +[736] 0.0 0.00 0.00 115276 can_move [736] + 0.00 0.00 115276/116002 get_movement [750] + 0.00 0.00 115276/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 36/178290 move_iceberg [1094] + 0.00 0.00 178254/178290 new_region [275] +[737] 0.0 0.00 0.00 178290 rhash [737] + 0.00 0.00 178290/2903884 jenkins_hash [439] +----------------------------------------------- + 0.00 0.00 189341/189341 produce [29] +[738] 0.0 0.00 0.00 189341 rule_autowork [738] + 0.00 0.00 189341/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 2665/2665 read_unitid [413] +[739] 0.0 0.00 0.00 2665 read_newunitid [739] + 0.00 0.00 2665/2665 findnewunit [753] + 0.00 0.00 2665/228907 getid [483] +----------------------------------------------- + 0.00 0.00 19545/19545 parse_symbol [42] +[740] 0.0 0.00 0.00 19545 eval_ship [740] + 0.00 0.00 14502/1065211 shipname [290] + 0.00 0.00 5043/24887945 locale_string [27] + 0.00 0.00 19545/13102790 opstack_pop [176] + 0.00 0.00 19545/13102790 opstack_push [202] + 0.00 0.00 19545/13399069 balloc [363] +----------------------------------------------- + 0.00 0.00 177/177 produce [29] +[741] 0.0 0.00 0.00 177 breed_cmd [741] + 0.00 0.00 174/174 breedhorses [742] + 0.00 0.00 179/2281756 gettoken [195] + 0.00 0.00 2/2 breedtrees [1148] + 0.00 0.00 176/1787006 findparam [458] + 0.00 0.00 177/1027665 init_order [613] + 0.00 0.00 174/174 findresourcetype [1181] + 0.00 0.00 1/1 plant [1184] + 0.00 0.00 521/56052475 get_resourcetype [194] +----------------------------------------------- + 0.00 0.00 174/174 breed_cmd [741] +[742] 0.0 0.00 0.00 174 breedhorses [742] + 0.00 0.00 60896/7641081 genrand_int31 [171] + 0.00 0.00 12859/11241829 i_change [115] + 0.00 0.00 170/967784 msg_message [132] + 0.00 0.00 170/472418 produceexp [322] + 0.00 0.00 170/12320804 effskill [100] + 0.00 0.00 170/392959 add_message [434] + 0.00 0.00 170/5395063 i_get [130] + 0.00 0.00 174/424669 active_building [560] + 0.00 0.00 4/15102 cmistake [718] + 0.00 0.00 174/56052475 get_resourcetype [194] + 0.00 0.00 1/560926 bt_find [237] + 0.00 0.00 174/204314 bt_changed [1415] + 0.00 0.00 170/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 178254/178254 process [7] +[743] 0.0 0.00 0.00 178254 split_allocations [743] + 0.00 0.00 2938/967784 msg_message [132] + 0.00 0.00 2825/472418 produceexp [322] + 0.00 0.00 2938/392959 add_message [434] + 0.00 0.00 1301/1301 leveled_allocation [888] + 0.00 0.00 1422/1422 attrib_allocation [914] + 0.00 0.00 2825/11241829 i_change [115] + 0.00 0.00 2723/2723 get_allocator [1001] + 0.00 0.00 2723/9298667 resource2item [546] + 0.00 0.00 2938/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 19/15240 give_men [857] + 0.00 0.00 119/15240 syntax_error [1036] + 0.00 0.00 15102/15240 cmistake [718] +[744] 0.0 0.00 0.00 15240 msg_error [744] + 0.00 0.00 8935/41248 msg_feedback [647] +----------------------------------------------- + 0.00 0.00 552/18788 aftermath [701] + 0.00 0.00 7058/18788 battle_report [503] + 0.00 0.00 11178/18788 print_stats [525] +[745] 0.0 0.00 0.00 18788 sideabkz [745] + 0.00 0.00 18788/5100840 itoa36 [116] + 0.00 0.00 18788/34611296 strlcpy [45] +----------------------------------------------- + +[746] 0.0 0.00 0.00 tolua_unit_get_race [746] + 0.00 0.00 420172/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 417577/417577 study_cmd [105] +[747] 0.0 0.00 0.00 417577 study_days [747] + 0.00 0.00 417577/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 36937/163027 cr_output_region [10] + 0.00 0.00 62581/163027 report_plaintext [4] + 0.00 0.00 63509/163027 statistics [70] +[748] 0.0 0.00 0.00 163027 markets_module [748] + 0.00 0.00 163027/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 475/475 move_hunters [342] +[749] 0.0 0.00 0.00 475 follow_ship [749] + 0.00 0.00 191/103784 move_cmd [66] + 0.00 0.00 1188/24887945 locale_string [27] + 0.00 0.00 1612/17451017 strlcpy_w [67] + 0.00 0.00 474/228907 getid [483] + 0.00 0.00 160/15102 cmistake [718] + 0.00 0.00 1284/1297 hunted_dir [1055] + 0.00 0.00 191/66134 shipspeed [669] + 0.00 0.00 191/16751 getuint [778] + 0.00 0.00 191/54318 getstrtoken [710] + 0.00 0.00 474/115276 can_move [736] + 0.00 0.00 475/3358315 ship_owner [438] + 0.00 0.00 191/1311302 init_tokens_str [544] + 0.00 0.00 191/36653945 wrptr [178] + 0.00 0.00 191/5461936 slprintf [548] + 0.00 0.00 283/28818 findship [1483] + 0.00 0.00 191/2009097 keyword [1355] +----------------------------------------------- + 0.00 0.00 240/116002 canfly [1031] + 0.00 0.00 486/116002 canswim [682] + 0.00 0.00 115276/116002 can_move [736] +[750] 0.0 0.00 0.00 116002 get_movement [750] + 0.00 0.00 116002/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 5907/5907 msg_curse [664] +[751] 0.0 0.00 0.00 5907 cinfo_simple [751] + 0.00 0.00 5907/967784 msg_message [132] + 0.00 0.00 5907/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 3078/3078 create_item [617] +[752] 0.0 0.00 0.00 3078 allocate_resource [752] + 0.00 0.00 36821/6610983 is_guard [211] + 0.00 0.00 2939/12320804 effskill [100] + 0.00 0.00 81/81 can_guard [908] + 0.00 0.00 2938/5395063 i_get [130] + 0.00 0.00 2938/2858912 get_effect [225] + 0.00 0.00 1709/3123 limit_resource [943] + 0.00 0.00 3078/51974272 a_find [65] + 0.00 0.00 139/15102 cmistake [718] + 0.00 0.00 2366/2032164 rt_find [597] + 0.00 0.00 5877/56052475 get_resourcetype [194] + 0.00 0.00 2943/8506411 besieged [547] + 0.00 0.00 3078/9298667 resource2item [546] + 0.00 0.00 1289/129167539 u_race [89] + 0.00 0.00 1/41248 msg_feedback [647] + 0.00 0.00 7/2977 change_effect [982] + 0.00 0.00 1/392959 add_message [434] + 0.00 0.00 2938/3003 roqf_factor [1329] + 0.00 0.00 5920/26995 inside_building [1486] + 0.00 0.00 5920/26164 building_is_active [1488] + 0.00 0.00 23/30 limit_seeds [1691] + 0.00 0.00 1/2 limit_mallornseeds [1775] +----------------------------------------------- + 0.00 0.00 2665/2665 read_newunitid [739] +[753] 0.0 0.00 0.00 2665 findnewunit [753] + 0.00 0.00 110903/285923 ualias [692] +----------------------------------------------- + 0.00 0.00 417554/417554 plan_monsters [52] +[754] 0.0 0.00 0.00 417554 random_move_chance [754] + 0.00 0.00 417554/717218 config_get_flt [714] +----------------------------------------------- + 0.00 0.00 443/5358 change_maxspellpoints [911] + 0.00 0.00 1334/5358 bufunit [17] + 0.00 0.00 1711/5358 cr_output_unit [19] + 0.00 0.00 1870/5358 regenerate_aura [346] +[755] 0.0 0.00 0.00 5358 max_spellpoints [755] + 0.00 0.00 5358/12320804 effskill [100] + 0.00 0.00 5358/5358 get_spchange [862] + 0.00 0.00 5358/5395063 i_get [130] + 0.00 0.00 5358/12246335 ct_find [114] + 0.00 0.00 5358/10190660 get_curse [143] + 0.00 0.00 5358/2032164 rt_find [597] + 0.00 0.00 5358/129167539 u_race [89] + 0.00 0.00 5358/651711 oldcursename [1381] + 0.00 0.00 5358/432940 curse_geteffect [1395] +----------------------------------------------- + 0.00 0.00 2081/2081 report_computer [9] +[756] 0.0 0.00 0.00 2081 cr_reportspell [756] + 0.00 0.00 5284/4434556 translate [75] + 0.00 0.00 3203/24887945 locale_string [27] + 0.00 0.00 2081/86400 spell_name [646] + 0.00 0.00 2081/4162 spell_info [841] + 0.00 0.00 2081/32337529 hashstring [37] + 0.00 0.00 2081/4133717 mkname [261] + 0.00 0.00 3203/13259934 resourcename [233] +----------------------------------------------- + 0.00 0.00 1/1 read_game [62] +[757] 0.0 0.00 0.00 1 resolve [757] + 0.00 0.00 2607/11989 resolve_unit [703] + 0.00 0.00 30872/30872 resolve_faction [820] + 0.00 0.00 442/1202 resolve_familiar [846] + 0.00 0.00 318/1078 resolve_mage [856] + 0.00 0.00 326/1466 resolve_region_id [1575] +----------------------------------------------- + 0.00 0.00 37/365 combatspell_cmd [898] + 0.00 0.00 103/365 reshow_other [823] + 0.00 0.00 225/365 cast_cmd [760] +[758] 0.0 0.00 0.00 365 unit_getspell [758] + 0.00 0.00 255/255 select_spellbook [761] + 0.00 0.00 365/597806 unit_get_spellbook [427] + 0.00 0.00 255/302482 findtoken [501] + 0.00 0.00 255/267 freetokens [1611] +----------------------------------------------- + 0.00 0.00 377/377 create_item [617] +[759] 0.0 0.00 0.00 377 manufacture [759] + 0.00 0.00 377/1239 build [691] + 0.00 0.00 306/967784 msg_message [132] + 0.00 0.00 377/12320804 effskill [100] + 0.00 0.00 377/12320804 skillmod [214] + 0.00 0.00 377/392959 add_message [434] + 0.00 0.00 71/182 msg_materials_required [1005] + 0.00 0.00 306/11241829 i_change [115] + 0.00 0.00 377/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 222/222 magic [157] +[760] 0.0 0.00 0.00 222 cast_cmd [760] + 0.00 0.00 225/365 unit_getspell [758] + 0.00 0.00 220/220 farcasting [842] + 0.00 0.00 329/12320804 effskill [100] + 0.00 0.00 221/482 knowsspell [956] + 0.00 0.00 395/2281756 gettoken [195] + 0.00 0.00 220/303 create_castorder [1066] + 0.00 0.00 108/57138 getint [699] + 0.00 0.00 322/1787006 findparam [458] + 0.00 0.00 222/1027665 init_order [613] + 0.00 0.00 26/26 add_spellparameter [1173] + 0.00 0.00 222/1629412 LongHunger [536] + 0.00 0.00 24/24 is_moving_ship [1231] + 0.00 0.00 5/459083 findregion [420] + 0.00 0.00 1/967784 msg_message [132] + 0.00 0.00 227/18647447 getplane [596] + 0.00 0.00 3/71815034 get_race [12] + 0.00 0.00 1/15102 cmistake [718] + 0.00 0.00 3/298951 distance [599] + 0.00 0.00 1/392959 add_message [434] + 0.00 0.00 4/793 is_familiar [1092] + 0.00 0.00 3/174968 get_familiar_mage [722] + 0.00 0.00 4/129167539 u_race [89] + 0.00 0.00 10/10 rel_to_abs [1728] + 0.00 0.00 5/3587241 pnormalize [1350] + 0.00 0.00 3/1291427 set_order [1365] + 0.00 0.00 1/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 255/255 unit_getspell [758] +[761] 0.0 0.00 0.00 255 select_spellbook [761] + 0.00 0.00 8557/86400 spell_name [646] + 0.00 0.00 8557/8993 addtoken [811] +----------------------------------------------- + 0.00 0.00 232/232 write_game [83] +[762] 0.0 0.00 0.00 232 writefaction [762] + 0.00 0.00 5926/1205451 alliedfaction [162] + 0.00 0.00 232/11719 locale_name [568] + 0.00 0.00 232/232 write_groups [920] + 0.00 0.00 232/1248014 listlen [190] + 0.00 0.00 232/839970 write_attribs [301] + 0.00 0.00 232/629123 write_items [511] + 0.00 0.00 232/647569 write_faction_reference [1382] + 0.00 0.00 232/232 write_password [1623] + 0.00 0.00 232/2321 write_spellbook [1556] +----------------------------------------------- + 0.00 0.00 590/590 process [7] +[763] 0.0 0.00 0.00 590 use_cmd [763] + 0.00 0.00 590/590 use_item [765] + 0.00 0.00 900/2281756 gettoken [195] + 0.00 0.00 182/15102 cmistake [718] + 0.00 0.00 590/1027665 init_order [613] + 0.00 0.00 590/191379 finditemtype [735] + 0.00 0.00 280/534930 isparam [668] +----------------------------------------------- + 0.00 0.00 752/752 monster_attacks [248] +[764] 0.0 0.00 0.00 752 monster_attack [764] + 0.00 0.00 752/1437425 cansee [22] + 0.00 0.00 736/447808 create_order [341] + 0.00 0.00 752/1121103 monster_is_waiting [407] +----------------------------------------------- + 0.00 0.00 590/590 use_cmd [763] +[765] 0.0 0.00 0.00 590 use_item [765] + 0.00 0.00 348/348 use_potion [801] + 0.00 0.00 590/541982 get_pooled [104] + 0.00 0.00 56/56 use_bloodpotion [935] + 0.00 0.00 3/3 use_healingpotion [1119] + 0.00 0.00 1/860263 use_pooled [39] + 0.00 0.00 1/1 use_skillpotion [1233] +----------------------------------------------- + 0.00 0.00 111/111 produce [29] +[766] 0.0 0.00 0.00 111 steal_cmd [766] + 0.00 0.00 46/3016 dfindhash [307] + 0.00 0.00 84/1437425 cansee [22] + 0.00 0.00 110/145 findunitr [991] + 0.00 0.00 65/65 max_skill [1037] + 0.00 0.00 111/284005 read_unitid [413] + 0.00 0.00 46/41248 msg_feedback [647] + 0.00 0.00 59/760673 addlist [217] + 0.00 0.00 30/967784 msg_message [132] + 0.00 0.00 65/12320804 effskill [100] + 0.00 0.00 59/472418 produceexp [322] + 0.00 0.00 76/392959 add_message [434] + 0.00 0.00 118/5395063 i_get [130] + 0.00 0.00 111/1027665 init_order [613] + 0.00 0.00 15/71815034 get_race [12] + 0.00 0.00 65/16669 IsImmune [901] + 0.00 0.00 111/111 check_steal [1234] + 0.00 0.00 222/21345834 skill_enabled [365] + 0.00 0.00 111/56052475 get_resourcetype [194] + 0.00 0.00 15/129167539 u_race [89] + 0.00 0.00 4/3003 roqf_factor [1329] + 0.00 0.00 76/1009028 msg_release [1373] + 0.00 0.00 65/192 can_contact [1634] +----------------------------------------------- + 0.00 0.00 233/233 read_game [62] +[767] 0.0 0.00 0.00 233 readfaction [767] + 0.00 0.00 233/233 read_groups [782] + 0.00 0.00 5925/5925 addally [913] + 0.00 0.00 406/406 faction_setorigin [979] + 0.00 0.00 233/628037 read_items [320] + 0.00 0.00 233/5100840 itoa36 [116] + 0.00 0.00 233/68430117 rc_find [15] + 0.00 0.00 233/840577 read_attribs [388] + 0.00 0.00 233/5588 get_locale [884] + 0.00 0.00 233/4625636 findfaction [259] + 0.00 0.00 233/457 FactionSpells [1136] + 0.00 0.00 233/49235 log_debug [1245] + 0.00 0.00 233/1613387 rule_region_owners [1323] + 0.00 0.00 233/233 set_email [1620] + 0.00 0.00 233/233 read_password [1619] + 0.00 0.00 233/2324 read_spellbook [1555] +----------------------------------------------- + 0.00 0.00 3152/3152 scared_by_monster [380] +[768] 0.0 0.00 0.00 3152 scareaway [768] + 0.00 0.00 33436/7641081 genrand_int31 [171] + 0.00 0.00 2656/369586 r_connect [474] + 0.00 0.00 3152/264251 rsetpeasants [545] + 0.00 0.00 6569/2605004 rpeasants [435] +----------------------------------------------- + 0.00 0.00 3246/7630 split_paragraph [828] + 0.00 0.00 4384/7630 lparagraph [809] +[769] 0.0 0.00 0.00 7630 addstrlist [769] + 0.00 0.00 7630/760673 addlist [217] +----------------------------------------------- + 0.00 0.00 4020/4020 a_read_i [390] +[770] 0.0 0.00 0.00 4020 curse_read [770] + 0.00 0.00 4020/9763 read_reference [726] + 0.00 0.00 4020/12246335 ct_find [114] + 0.00 0.00 4020/4052 chash [1537] + 0.00 0.00 4/4 read_skill [1759] +----------------------------------------------- + 0.00 0.00 2/2 json_disable_features [772] +[771] 0.0 0.00 0.00 2 disable_feature [771] + 0.00 0.00 1/30 config_set [444] + 0.00 0.00 1/64 log_info [1339] + 0.00 0.00 1/49235 log_debug [1245] + 0.00 0.00 2/1041 findskill [1586] + 0.00 0.00 2/65 findkeyword [1665] + 0.00 0.00 1/1 enable_keyword [1801] +----------------------------------------------- + 0.00 0.00 1/1 json_config [464] +[772] 0.0 0.00 0.00 1 json_disable_features [772] + 0.00 0.00 2/2 disable_feature [771] +----------------------------------------------- + +[773] 0.0 0.00 0.00 tolua_settings_eressea_settings_set00 [773] + 0.00 0.00 1/30 config_set [444] +----------------------------------------------- + 0.00 0.00 2/2457 sp_summonshadowlords [1034] + 0.00 0.00 6/2457 tolua_unit_setskill [1163] + 0.00 0.00 12/2457 forget_cmd [1093] + 0.00 0.00 26/2457 demon_skillchange [826] + 0.00 0.00 38/2457 sp_viewreality [784] + 0.00 0.00 54/2457 skill_summoned [1032] + 0.00 0.00 828/2457 spawn_undead [629] + 0.00 0.00 1491/2457 equip_unit_mask [776] +[774] 0.0 0.00 0.00 2457 set_level [774] + 0.00 0.00 2445/47535 sk_set [510] + 0.00 0.00 2419/1956810 add_skill [355] + 0.00 0.00 2457/21345834 skill_enabled [365] + 0.00 0.00 12/51060 remove_skill [1456] +----------------------------------------------- + 0.00 0.00 1/2375 oldfamiliars [1240] + 0.00 0.00 10/2375 spawn_dragons [411] + 0.00 0.00 17/2375 recruit_dracoids [837] + 0.00 0.00 20/2375 spawn_seaserpent [831] + 0.00 0.00 21/2375 spawn_undead [629] + 0.00 0.00 639/2375 spawn_braineaters [505] + 0.00 0.00 1667/2375 add_recruits [371] +[775] 0.0 0.00 0.00 2375 equip_unit [775] + 0.00 0.00 2375/2375 equip_unit_mask [776] +----------------------------------------------- + 24 equip_unit_mask [776] + 0.00 0.00 2375/2375 equip_unit [775] +[776] 0.0 0.00 0.00 2375+24 equip_unit_mask [776] + 0.00 0.00 1491/2457 set_level [774] + 0.00 0.00 1560/146997 dice_rand [409] + 0.00 0.00 30/1381157 unit_max_hp [136] + 0.00 0.00 38/752645 chance [495] + 0.00 0.00 24/7641081 genrand_int31 [171] + 0.00 0.00 60/822780 i_new [1375] + 0.00 0.00 60/87004 i_add [1442] + 24 equip_unit_mask [776] +----------------------------------------------- + 0.00 0.00 162/786 report_computer [9] + 0.00 0.00 162/786 report_plaintext [4] + 0.00 0.00 462/786 score [23] +[777] 0.0 0.00 0.00 786 average_score_of_age [777] + 0.00 0.00 18304/71815034 get_race [12] +----------------------------------------------- + 0.00 0.00 191/16751 follow_ship [749] + 0.00 0.00 16560/16751 entertain_cmd [665] +[778] 0.0 0.00 0.00 16751 getuint [778] + 0.00 0.00 16751/57138 getint [699] +----------------------------------------------- + 0.00 0.00 1/12265 report_spell [1301] + 0.00 0.00 1/12265 caddmessage [1070] + 0.00 0.00 2/12265 sp_viewreality [784] + 0.00 0.00 4/12265 sp_generous [1040] + 0.00 0.00 5/12265 sp_eternizewall [988] + 0.00 0.00 12/12265 sp_enterastral [1045] + 0.00 0.00 13/12265 sp_goodwinds [974] + 0.00 0.00 30/12265 sp_song_of_peace [939] + 0.00 0.00 76/12265 sp_stormwinds [871] + 0.00 0.00 206/12265 report_action [860] + 0.00 0.00 295/12265 maintain_buildings [339] + 0.00 0.00 11620/12265 report_transfer [724] +[779] 0.0 0.00 0.00 12265 r_addmessage [779] + 0.00 0.00 12265/392959 add_message [434] +----------------------------------------------- + 0.00 0.00 138/138 process [7] +[780] 0.0 0.00 0.00 138 renumber_cmd [780] + 0.00 0.00 43/2818 newunitid [319] + 0.00 0.00 250/2281756 gettoken [195] + 0.00 0.00 38/221899 findunitg [279] + 0.00 0.00 72/15102 cmistake [718] + 0.00 0.00 26/593636 building_owner [232] + 0.00 0.00 69/688711 atoi36 [440] + 0.00 0.00 55/55 renumber_unit [1159] + 0.00 0.00 138/6530 findparam_ex [926] + 0.00 0.00 138/1027665 init_order [613] + 0.00 0.00 31/3358315 ship_owner [438] + 0.00 0.00 38/3002 forbiddenid [1280] + 0.00 0.00 31/28818 findship [1483] + 0.00 0.00 27/48455 findbuilding [1462] + 0.00 0.00 10/12 bunhash [1720] + 0.00 0.00 10/46196 bhash [1464] + 0.00 0.00 1/7 sunhash [1744] + 0.00 0.00 1/19085 shash [1502] +----------------------------------------------- + 0.00 0.00 120/120 demographics [50] +[781] 0.0 0.00 0.00 120 plagues [781] + 0.00 0.00 25985/1336242 rng_injectable_double [396] + 0.00 0.00 12922/4666665 rmoney [452] + 0.00 0.00 6459/2186159 rsetmoney [553] + 0.00 0.00 120/967784 msg_message [132] + 0.00 0.00 120/392959 add_message [434] + 0.00 0.00 120/264251 rsetpeasants [545] + 0.00 0.00 120/2605004 rpeasants [435] + 0.00 0.00 120/37974 deathcounts [843] + 0.00 0.00 120/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 233/233 readfaction [767] +[782] 0.0 0.00 0.00 233 read_groups [782] + 0.00 0.00 49522/4625636 findfaction [259] + 0.00 0.00 1694/840577 read_attribs [388] + 0.00 0.00 51216/51239 read_faction_reference [1455] + 0.00 0.00 49522/55547 ally_add [1452] + 0.00 0.00 27921/34565 ur_add [1472] + 0.00 0.00 1694/1697 new_group [1565] +----------------------------------------------- + 0.00 0.00 8892/8892 astralregions [329] +[783] 0.0 0.00 0.00 8892 r_astral_to_standard [783] + 0.00 0.00 8892/459083 findregion [420] + 0.00 0.00 8892/987488 is_astral [479] + 0.00 0.00 8865/18647447 getplane [596] + 0.00 0.00 8892/3587241 pnormalize [1350] +----------------------------------------------- + 0.00 0.00 2/2 magic [157] +[784] 0.0 0.00 0.00 2 sp_viewreality [784] + 0.00 0.00 38/2889 create_unit [296] + 0.00 0.00 38/2457 set_level [774] + 0.00 0.00 2/8892 astralregions [329] + 0.00 0.00 38/71815034 get_race [12] + 0.00 0.00 34/12246335 ct_find [114] + 0.00 0.00 34/10190660 get_curse [143] + 0.00 0.00 2/967784 msg_message [132] + 0.00 0.00 2/12265 r_addmessage [779] + 0.00 0.00 34/4201030 curse_active [543] + 0.00 0.00 2/3 getplaneid [1337] + 0.00 0.00 34/651711 oldcursename [1381] + 0.00 0.00 2/608 co_get_region [1594] + 0.00 0.00 2/109377 free_regionlist [1436] + 0.00 0.00 2/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 112/112 attack [84] +[785] 0.0 0.00 0.00 112 attack_firesword [785] + 0.00 0.00 580/80630 terminate [242] + 0.00 0.00 580/372173 select_enemy [172] + 0.00 0.00 18/1486 message_all [834] + 0.00 0.00 18/967784 msg_message [132] + 0.00 0.00 112/7641081 genrand_int31 [171] + 0.00 0.00 112/876979 count_enemies [611] + 0.00 0.00 18/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 39926/39926 sail [181] +[786] 0.0 0.00 0.00 39926 check_leuchtturm [786] + 0.00 0.00 35539/51974272 a_find [65] + 0.00 0.00 24025/1106528 is_building_type [554] + 0.00 0.00 23237/21345834 skill_enabled [365] +----------------------------------------------- + 0.00 0.00 27694/27694 dragon_affinity_value [516] +[787] 0.0 0.00 0.00 27694 dice [787] + 0.00 0.00 41004/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.00 80630/80630 calculate_armor [645] +[788] 0.0 0.00 0.00 80630 natural_armor [788] + 0.00 0.00 80630/80630 armor_bonus [819] + 0.00 0.00 80630/129167539 u_race [89] +----------------------------------------------- + 3246 centre [789] + 0.00 0.00 229/37931 list_address [635] + 0.00 0.00 816/37931 rp_battles [618] + 0.00 0.00 2081/37931 nr_spell [507] + 0.00 0.00 3437/37931 report_plaintext [4] + 0.00 0.00 31368/37931 rp_messages [36] +[789] 0.0 0.00 0.00 37931+3246 centre [789] + 0.00 0.00 946/946 sparagraph [827] + 0.00 0.00 40231/7851812 write_spaces [303] + 0.00 0.00 946/5330 freestrlist [1534] + 3246 centre [789] +----------------------------------------------- + 0.00 0.00 1/1 tolua_read_xml [792] +[790] 0.0 0.00 0.00 1 init_data [790] + 0.00 0.00 1/1 read_xml [791] + 0.00 0.00 1/5 reset_locales [1751] +----------------------------------------------- + 0.00 0.00 1/1 init_data [790] +[791] 0.0 0.00 0.00 1 read_xml [791] + 0.00 0.00 1/1 parse_messages [832] + 0.00 0.00 1/1 parse_strings [864] + 0.00 0.00 1/1 parse_resources [1086] + 0.00 0.00 1/1 parse_races [1104] + 0.00 0.00 1/1 parse_spells [1120] + 0.00 0.00 1/1 parse_buildings [1131] + 0.00 0.00 1/1 parse_equipment [1170] + 0.00 0.00 1/1 parse_calendar [1252] + 0.00 0.00 1/1 parse_ships [1305] + 0.00 0.00 1/1 parse_spellbooks [1827] + 0.00 0.00 1/1 parse_rules [1826] +----------------------------------------------- + +[792] 0.0 0.00 0.00 tolua_read_xml [792] + 0.00 0.00 1/1 init_data [790] +----------------------------------------------- + 0.00 0.00 216069/216069 config_token [794] +[793] 0.0 0.00 0.00 216069 check_param [793] + 0.00 0.00 216069/26776263 get_param [235] +----------------------------------------------- + 0.00 0.00 1/216069 prepare_report [8] + 0.00 0.00 6524/216069 maintain [478] + 0.00 0.00 209544/216069 building_owner_ex [253] +[794] 0.0 0.00 0.00 216069 config_token [794] + 0.00 0.00 216069/216069 check_param [793] +----------------------------------------------- + 0.00 0.00 96637/96637 walkingcapacity [403] +[795] 0.0 0.00 0.00 96637 personcapacity [795] + 0.00 0.00 193274/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 2/54351 sp_summon_familiar [1025] + 0.00 0.00 54349/54351 sm_familiar [520] +[796] 0.0 0.00 0.00 54351 get_familiar [796] + 0.00 0.00 54351/51974272 a_find [65] +----------------------------------------------- +[797] 0.0 0.00 0.00 1557+26 [797] + 0.00 0.00 1570 read_triggers [798] + 0.00 0.00 13 timeout_read [1719] +----------------------------------------------- + 13 timeout_read [1719] + 0.00 0.00 1557/1557 read_handler [799] +[798] 0.0 0.00 0.00 1570 read_triggers [798] + 0.00 0.00 2299/2299 killunit_read [817] + 0.00 0.00 768/768 shock_read [892] + 0.00 0.00 10/10 changefaction_read [1166] + 0.00 0.00 3/3 changerace_read [1215] + 0.00 0.00 1/1 giveitem_read [1262] + 0.00 0.00 1/1 caldera_read [1270] + 0.00 0.00 1/1 clonedied_read [1271] + 0.00 0.00 3096/3096 tt_find [1548] + 0.00 0.00 3096/3113 t_new [1546] + 13 timeout_read [1719] +----------------------------------------------- + 0.00 0.00 1557/1557 a_read_i [390] +[799] 0.0 0.00 0.00 1557 read_handler [799] + 0.00 0.00 1557/1557 read_triggers [798] +----------------------------------------------- + 0.00 0.00 1/45 sp_holyground [1068] + 0.00 0.00 1/45 sp_generous [1040] + 0.00 0.00 1/45 shipcurse_flyingship [1072] + 0.00 0.00 2/45 sp_charmingsong [993] + 0.00 0.00 3/45 sp_song_of_peace [939] + 0.00 0.00 3/45 sp_eternizewall [988] + 0.00 0.00 4/45 sp_goodwinds [974] + 0.00 0.00 13/45 sp_blessedharvest [847] + 0.00 0.00 17/45 sp_stormwinds [871] +[800] 0.0 0.00 0.00 45 create_curse [800] + 0.00 0.00 32/32 make_curse [802] + 0.00 0.00 45/10190660 get_curse [143] + 0.00 0.00 13/13 set_curseingmagician [1265] +----------------------------------------------- + 0.00 0.00 348/348 use_item [765] +[801] 0.0 0.00 0.00 348 use_potion [801] + 0.00 0.00 345/345 end_potion [814] + 0.00 0.00 345/345 do_potion [941] + 0.00 0.00 348/348 begin_potion [1096] + 0.00 0.00 348/1582 resource2potion [1569] +----------------------------------------------- + 0.00 0.00 32/32 create_curse [800] +[802] 0.0 0.00 0.00 32 make_curse [802] + 0.00 0.00 32/2818 newunitid [319] + 0.00 0.00 32/779419 a_add [555] + 0.00 0.00 32/779868 a_new [1376] + 0.00 0.00 32/4052 chash [1537] +----------------------------------------------- + 0.00 0.00 6/2931 make_undead_unit [1188] + 0.00 0.00 10/2931 spawn_dragons [411] + 0.00 0.00 17/2931 recruit_dracoids [837] + 0.00 0.00 92/2931 spawn_undead [629] + 0.00 0.00 2806/2931 create_unit [296] +[803] 0.0 0.00 0.00 2931 name_unit [803] + 0.00 0.00 2008/2008 default_name [851] + 0.00 0.00 923/1351796 racename [133] + 0.00 0.00 923/923 race_namegen [905] + 0.00 0.00 4777/129167539 u_race [89] + 0.00 0.00 2931/3862 unit_setname [1540] +----------------------------------------------- + 0.00 0.00 11540/11540 monster_kills_peasants [230] +[804] 0.0 0.00 0.00 11540 absorbed_by_monster [804] + 0.00 0.00 11540/7641081 genrand_int31 [171] + 0.00 0.00 681/967784 msg_message [132] + 0.00 0.00 2200/201744 lovar [644] + 0.00 0.00 681/392959 add_message [434] + 0.00 0.00 3455/2605004 rpeasants [435] + 0.00 0.00 681/264251 rsetpeasants [545] + 0.00 0.00 681/3178 scale_number [969] + 0.00 0.00 681/129167539 u_race [89] + 0.00 0.00 681/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 2/273 do_combatspell [702] + 0.00 0.00 5/273 do_combatmagic [825] + 0.00 0.00 74/273 cast_combatspell [623] + 0.00 0.00 192/273 magic [157] +[805] 0.0 0.00 0.00 273 pay_spell [805] + 0.00 0.00 470/860263 use_pooled [39] + 0.00 0.00 269/767 spellcost [995] + 0.00 0.00 273/56052475 get_resourcetype [194] +----------------------------------------------- + 0.00 0.00 66058/66058 shipspeed [669] +[806] 0.0 0.00 0.00 66058 ShipSpeedBonus [806] + 0.00 0.00 66058/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 41/41 produce [29] +[807] 0.0 0.00 0.00 41 expandstealing [807] + 0.00 0.00 41/10852 expandorders [197] + 0.00 0.00 38/860263 use_pooled [39] + 0.00 0.00 59/541982 get_pooled [104] + 0.00 0.00 59/34409 add_income [625] + 0.00 0.00 59/221899 findunitg [279] + 0.00 0.00 38/967784 msg_message [132] + 0.00 0.00 38/392959 add_message [434] + 0.00 0.00 38/2599554 change_money [337] + 0.00 0.00 41/56052475 get_resourcetype [194] + 0.00 0.00 40/18647447 getplane [596] + 0.00 0.00 38/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 88/88 get_food [88] +[808] 0.0 0.00 0.00 88 hunger [808] + 0.00 0.00 2491/146997 dice_rand [409] + 0.00 0.00 88/967784 msg_message [132] + 0.00 0.00 88/392959 add_message [434] + 0.00 0.00 88/88 hunger_damage [1223] + 0.00 0.00 27/3178 scale_number [969] + 0.00 0.00 88/129167539 u_race [89] + 0.00 0.00 27/37974 deathcounts [843] + 0.00 0.00 88/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 4384/4384 spunit [632] +[809] 0.0 0.00 0.00 4384 lparagraph [809] + 0.00 0.00 4384/7630 addstrlist [769] +----------------------------------------------- + 0.00 0.00 319/319 aftermath [701] +[810] 0.0 0.00 0.00 319 loot_items [810] + 0.00 0.00 1100/372173 select_enemy [172] + 0.00 0.00 2204/7641081 genrand_int31 [171] + 0.00 0.00 1091/1091 loot_quota [1013] + 0.00 0.00 1091/11241829 i_change [115] + 0.00 0.00 983/3902878 get_monsters [293] + 0.00 0.00 38/38 select_ally [1132] + 0.00 0.00 319/2913 dead_fighters [1549] +----------------------------------------------- + 178365 addtoken [811] + 0.00 0.00 2/8993 register_special_direction [1259] + 0.00 0.00 14/8993 findshiptype [869] + 0.00 0.00 22/8993 init_options_translation [1157] + 0.00 0.00 26/8993 init_directions [1143] + 0.00 0.00 36/8993 init_terrains_translation [1129] + 0.00 0.00 54/8993 findbuildingtype [866] + 0.00 0.00 282/8993 init_locale [948] + 0.00 0.00 8557/8993 select_spellbook [761] +[811] 0.0 0.00 0.00 8993+178365 addtoken [811] + 0.00 0.00 176717/46391457 unicode_utf8_to_ucs4 [177] + 0.00 0.00 141675/141675 mknode [1429] + 178365 addtoken [811] +----------------------------------------------- + 0.00 0.00 2274/2274 msg_curse [664] +[812] 0.0 0.00 0.00 2274 cinfo_ship [812] + 0.00 0.00 2274/967784 msg_message [132] + 0.00 0.00 2252/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 312/312 make_cmd [383] +[813] 0.0 0.00 0.00 312 continue_ship [813] + 0.00 0.00 113/115 build_ship [839] + 0.00 0.00 120/122 maxbuild [946] + 0.00 0.00 432/12320804 effskill [100] + 0.00 0.00 306/307 getship [1018] + 0.00 0.00 199/15102 cmistake [718] +----------------------------------------------- + 0.00 0.00 345/345 use_potion [801] +[814] 0.0 0.00 0.00 345 end_potion [814] + 0.00 0.00 345/860263 use_pooled [39] + 0.00 0.00 345/967784 msg_message [132] + 0.00 0.00 345/392959 add_message [434] + 0.00 0.00 345/404 usetpotionuse [1078] + 0.00 0.00 345/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 6/337987 update_guards [415] + 0.00 0.00 76/337987 guard_off_cmd [711] + 0.00 0.00 319/337987 aftermath [701] + 0.00 0.00 14191/337987 flee [638] + 0.00 0.00 23781/337987 guard [865] + 0.00 0.00 106892/337987 move_unit [421] + 0.00 0.00 192722/337987 travel_route [147] +[815] 0.0 0.00 0.00 337987 setguard [815] + 0.00 0.00 23509/51974272 a_find [65] + 0.00 0.00 23781/377253 guard_flags [690] +----------------------------------------------- + 0.00 0.00 36/36 produce [29] +[816] 0.0 0.00 0.00 36 expandloot [816] + 0.00 0.00 36/10852 expandorders [197] + 0.00 0.00 4800/2599554 change_money [337] + 0.00 0.00 42/34409 add_income [625] + 0.00 0.00 36/7641081 genrand_int31 [171] + 0.00 0.00 36/2186159 rsetmoney [553] + 0.00 0.00 36/4666665 rmoney [452] + 0.00 0.00 5/65345 region_get_morale [1444] +----------------------------------------------- + 0.00 0.00 2299/2299 read_triggers [798] +[817] 0.0 0.00 0.00 2299 killunit_read [817] + 0.00 0.00 2299/9763 read_reference [726] +----------------------------------------------- + 0.00 0.00 241/241 process [7] +[818] 0.0 0.00 0.00 241 reshow_cmd [818] + 0.00 0.00 241/241 reshow [822] + 0.00 0.00 241/2281756 gettoken [195] + 0.00 0.00 138/69432 getparam [681] + 0.00 0.00 241/1027665 init_order [613] + 0.00 0.00 241/534930 isparam [668] +----------------------------------------------- + 0.00 0.00 80630/80630 natural_armor [788] +[819] 0.0 0.00 0.00 80630 armor_bonus [819] + 0.00 0.00 80630/5065285 get_param_int [422] +----------------------------------------------- + 0.00 0.00 30872/30872 resolve [757] +[820] 0.0 0.00 0.00 30872 resolve_faction [820] + 0.00 0.00 30872/4625636 findfaction [259] +----------------------------------------------- + 0.00 0.00 149/149 create_item [617] +[821] 0.0 0.00 0.00 149 create_potion [821] + 0.00 0.00 149/1239 build [691] + 0.00 0.00 129/967784 msg_message [132] + 0.00 0.00 149/392959 add_message [434] + 0.00 0.00 20/182 msg_materials_required [1005] + 0.00 0.00 129/11241829 i_change [115] + 0.00 0.00 149/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 241/241 reshow_cmd [818] +[822] 0.0 0.00 0.00 241 reshow [822] + 0.00 0.00 104/104 reshow_other [823] + 0.00 0.00 327/328 display_potion [1090] + 0.00 0.00 22/12320804 effskill [100] + 0.00 0.00 115/178429 a_removeall [958] +----------------------------------------------- + 0.00 0.00 104/104 reshow [822] +[823] 0.0 0.00 0.00 104 reshow_other [823] + 0.00 0.00 103/365 unit_getspell [758] + 0.00 0.00 47/47 display_race [963] + 0.00 0.00 39/39 display_item [1054] + 0.00 0.00 103/338 findrace [1030] + 0.00 0.00 59/5395063 i_get [130] + 0.00 0.00 16/15102 cmistake [718] + 0.00 0.00 103/191379 finditemtype [735] + 0.00 0.00 19/283711 item2resource [561] + 0.00 0.00 48/129167539 u_race [89] + 0.00 0.00 1/451774 a_remove [366] + 0.00 0.00 1/328 display_potion [1090] + 0.00 0.00 1/51974272 a_find [65] + 0.00 0.00 19/1582 resource2potion [1569] +----------------------------------------------- + 0.00 0.00 1911/1911 msg_curse [664] +[824] 0.0 0.00 0.00 1911 cinfo_magicresistance [824] + 0.00 0.00 1911/967784 msg_message [132] + 0.00 0.00 1911/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 206/412 aftermath [701] + 0.00 0.00 206/412 do_battle [64] +[825] 0.0 0.00 0.00 412 do_combatmagic [825] + 0.00 0.00 2273/12320804 effskill [100] + 0.00 0.00 2/2 sp_igjarjuk [923] + 0.00 0.00 7/7 sp_healing [989] + 0.00 0.00 8/251 cancast [833] + 0.00 0.00 5/273 pay_spell [805] + 0.00 0.00 8/251 eff_spelllevel [845] + 0.00 0.00 51/1339 get_combatspelllevel [880] + 0.00 0.00 51/4875 get_combatspell [874] + 0.00 0.00 8/226 fumble [973] + 0.00 0.00 8/225 spellpower [1000] + 0.00 0.00 8/447808 create_order [341] + 0.00 0.00 8/86400 spell_name [646] + 0.00 0.00 1/3 report_failed_spell [1187] + 0.00 0.00 9/83 create_castorder_combat [1137] + 0.00 0.00 3708/3717 free_castorders [1541] + 0.00 0.00 16/11052 find_spell [1513] + 0.00 0.00 9/229 add_castorder [1626] + 0.00 0.00 8/1936876 free_order [1356] +----------------------------------------------- + 0.00 0.00 2148/2148 demon_skillchanges [246] +[826] 0.0 0.00 0.00 2148 demon_skillchange [826] + 0.00 0.00 18444/7641081 genrand_int31 [171] + 0.00 0.00 2190/892307 learn_skill [471] + 0.00 0.00 26/2457 set_level [774] + 0.00 0.00 1508/1583 reduce_skill [1091] + 0.00 0.00 12/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 946/946 centre [789] +[827] 0.0 0.00 0.00 946 sparagraph [827] + 0.00 0.00 946/946 split_paragraph [828] +----------------------------------------------- + 0.00 0.00 946/946 sparagraph [827] +[828] 0.0 0.00 0.00 946 split_paragraph [828] + 0.00 0.00 3246/7630 addstrlist [769] +----------------------------------------------- + 0.00 0.00 47562/47562 skill_weeks [509] +[829] 0.0 0.00 0.00 47562 rule_random_progress [829] + 0.00 0.00 47562/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 72692/72692 terminate [242] +[830] 0.0 0.00 0.00 72692 rc_specialdamage [830] + 0.00 0.00 117616/129167539 u_race [89] + 0.00 0.00 410/12560453 rc_changed [256] + 0.00 0.00 1/71815034 get_race [12] +----------------------------------------------- + 0.00 0.00 20/20 spawn_dragons [411] +[831] 0.0 0.00 0.00 20 spawn_seaserpent [831] + 0.00 0.00 20/2889 create_unit [296] + 0.00 0.00 20/2375 equip_unit [775] + 0.00 0.00 20/71815034 get_race [12] + 0.00 0.00 20/2742 get_equipment [1551] +----------------------------------------------- + 0.00 0.00 1/1 read_xml [791] +[832] 0.0 0.00 0.00 1 parse_messages [832] + 0.00 0.00 1909/1909 nrt_register [883] + 0.00 0.00 957/1010116 mt_find [227] + 0.00 0.00 1910/5354 xml_readtext [887] + 0.00 0.00 957/957 mt_register [1007] + 0.00 0.00 957/957 crt_register [1006] + 0.00 0.00 1909/8788 xml_cleanup_string [1520] + 0.00 0.00 957/957 mt_new [1588] +----------------------------------------------- + 0.00 0.00 8/251 do_combatmagic [825] + 0.00 0.00 23/251 do_combatspell [702] + 0.00 0.00 220/251 magic [157] +[833] 0.0 0.00 0.00 251 cancast [833] + 0.00 0.00 503/541982 get_pooled [104] + 0.00 0.00 251/482 knowsspell [956] + 0.00 0.00 251/12320804 effskill [100] + 0.00 0.00 249/767 spellcost [995] + 0.00 0.00 24/41248 msg_feedback [647] + 0.00 0.00 24/392959 add_message [434] + 0.00 0.00 251/56052475 get_resourcetype [194] + 0.00 0.00 24/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 2/1486 summon_allies [925] + 0.00 0.00 3/1486 report_failed_spell [1187] + 0.00 0.00 7/1486 sp_healing [989] + 0.00 0.00 18/1486 do_attack [80] + 0.00 0.00 18/1486 attack_firesword [785] + 0.00 0.00 21/1486 sp_kampfzauber [957] + 0.00 0.00 53/1486 sp_dragonodem [627] + 0.00 0.00 355/1486 print_stats [525] + 0.00 0.00 395/1486 reportcasualties [881] + 0.00 0.00 614/1486 print_fighters [616] +[834] 0.0 0.00 0.00 1486 message_all [834] + 0.00 0.00 5553/31214 message_faction [716] +----------------------------------------------- + 0.00 0.00 3117/3117 process [7] +[835] 0.0 0.00 0.00 3117 name_cmd [835] + 0.00 0.00 3117/2281756 gettoken [195] + 0.00 0.00 3114/54318 getstrtoken [710] + 0.00 0.00 3117/6530 findparam_ex [926] + 0.00 0.00 3117/1027665 init_order [613] + 0.00 0.00 5/593636 building_owner [232] + 0.00 0.00 4/4 try_rename [1225] + 0.00 0.00 2/15102 cmistake [718] + 0.00 0.00 10/3358315 ship_owner [438] + 0.00 0.00 5/490901 largestbuilding [651] + 0.00 0.00 5/5 get_cmp_region_owner [1347] + 0.00 0.00 3114/3114 rename_cmd [1545] +----------------------------------------------- + 0.00 0.00 6/41882 give_men [857] + 0.00 0.00 41876/41882 give_item [126] +[836] 0.0 0.00 0.00 41882 GiveRestriction [836] + 0.00 0.00 41882/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 17/17 plan_dragon [273] +[837] 0.0 0.00 0.00 17 recruit_dracoids [837] + 0.00 0.00 17/2889 create_unit [296] + 0.00 0.00 17/2375 equip_unit [775] + 0.00 0.00 17/2931 name_unit [803] + 0.00 0.00 17/760673 addlist [217] + 0.00 0.00 17/447808 create_order [341] + 0.00 0.00 17/2934859 skillname [122] + 0.00 0.00 17/71815034 get_race [12] + 0.00 0.00 17/2599554 change_money [337] + 0.00 0.00 23/599650 setstatus [1390] + 0.00 0.00 17/2742 get_equipment [1551] +----------------------------------------------- + 0.00 0.00 206/206 do_battle [64] +[838] 0.0 0.00 0.00 206 print_header [838] + 0.00 0.00 679/967784 msg_message [132] + 0.00 0.00 1029/3111 sidename [867] + 0.00 0.00 1799/17451017 strlcpy_w [67] + 0.00 0.00 679/31214 message_faction [716] + 0.00 0.00 210/24887945 locale_string [27] + 0.00 0.00 2703/2854 is_attacker [1550] + 0.00 0.00 1084/24449 seematrix [1491] + 0.00 0.00 679/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 2/115 create_ship [1014] + 0.00 0.00 113/115 continue_ship [813] +[839] 0.0 0.00 0.00 115 build_ship [839] + 0.00 0.00 115/1239 build [691] + 0.00 0.00 115/967784 msg_message [132] + 0.00 0.00 115/392959 add_message [434] + 0.00 0.00 115/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 12407/12407 cr_render [196] +[840] 0.0 0.00 0.00 12407 cr_regions [840] + 0.00 0.00 7499/1826688 adjust_coordinates [234] + 0.00 0.00 9641/18647447 getplane [596] + 0.00 0.00 7499/3587241 pnormalize [1350] +----------------------------------------------- + 0.00 0.00 2081/4162 cr_reportspell [756] + 0.00 0.00 2081/4162 nr_spell [507] +[841] 0.0 0.00 0.00 4162 spell_info [841] + 0.00 0.00 4162/24887945 locale_string [27] + 0.00 0.00 4162/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 220/220 cast_cmd [760] +[842] 0.0 0.00 0.00 220 farcasting [842] + 0.00 0.00 3/252 path_exists [431] + 0.00 0.00 220/514146 koor_distance [476] +----------------------------------------------- + 0.00 0.00 27/37974 hunger [808] + 0.00 0.00 34/37974 battle_effects [1125] + 0.00 0.00 120/37974 plagues [781] + 0.00 0.00 567/37974 eaten_by_monster [468] + 0.00 0.00 37226/37974 spawn_undead [629] +[843] 0.0 0.00 0.00 37974 deathcounts [843] + 0.00 0.00 5948/12246335 ct_find [114] + 0.00 0.00 5948/10190660 get_curse [143] + 0.00 0.00 5941/51974272 a_find [65] + 0.00 0.00 5948/4201030 curse_active [543] + 0.00 0.00 40/451774 a_remove [366] + 0.00 0.00 35/779419 a_add [555] + 0.00 0.00 35/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 348/348 process [7] +[844] 0.0 0.00 0.00 348 mail_cmd [844] + 0.00 0.00 35/35 mailunit [921] + 0.00 0.00 325/967784 msg_message [132] + 0.00 0.00 38/1437425 cansee [22] + 0.00 0.00 620/54318 getstrtoken [710] + 0.00 0.00 328/392959 add_message [434] + 0.00 0.00 348/2281756 gettoken [195] + 0.00 0.00 623/6530 findparam_ex [926] + 0.00 0.00 4/4 mailfaction [1106] + 0.00 0.00 4/4 seefaction [1117] + 0.00 0.00 348/1027665 init_order [613] + 0.00 0.00 22/228907 getid [483] + 0.00 0.00 3/41248 msg_feedback [647] + 0.00 0.00 15/51974272 a_find [65] + 0.00 0.00 1/307 getship [1018] + 0.00 0.00 328/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 8/251 do_combatmagic [825] + 0.00 0.00 23/251 do_combatspell [702] + 0.00 0.00 220/251 magic [157] +[845] 0.0 0.00 0.00 251 eff_spelllevel [845] + 0.00 0.00 489/541982 get_pooled [104] + 0.00 0.00 249/767 spellcost [995] + 0.00 0.00 99/597806 unit_get_spellbook [427] + 0.00 0.00 251/56052475 get_resourcetype [194] + 0.00 0.00 99/2112 spellbook_get [1557] +----------------------------------------------- + 0.00 0.00 442/1202 resolve [757] + 0.00 0.00 760/1202 read_reference [726] +[846] 0.0 0.00 0.00 1202 resolve_familiar [846] + 0.00 0.00 1202/11989 resolve_unit [703] + 0.00 0.00 442/760 set_familiar [992] + 0.00 0.00 760/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 13/13 magic [157] +[847] 0.0 0.00 0.00 13 sp_blessedharvest [847] + 0.00 0.00 13/45 create_curse [800] + 0.00 0.00 13/28 report_effect [861] + 0.00 0.00 26/967784 msg_message [132] + 0.00 0.00 13/12246335 ct_find [114] + 0.00 0.00 26/1009028 msg_release [1373] + 0.00 0.00 13/608 co_get_region [1594] +----------------------------------------------- + 0.00 0.00 3597/3597 chaos_update [514] +[848] 0.0 0.00 0.00 3597 chaos [848] + 0.00 0.00 5/2889 create_unit [296] + 0.00 0.00 96/105 terraform_region [932] + 0.00 0.00 3890/7641081 genrand_int31 [171] + 0.00 0.00 3/1794 remove_unit [499] + 0.00 0.00 51/967784 msg_message [132] + 0.00 0.00 51/392959 add_message [434] + 0.00 0.00 125/125 random_unit [1174] + 0.00 0.00 15/369586 r_connect [474] + 0.00 0.00 48/48 chaosterrain [1213] + 0.00 0.00 10/71815034 get_race [12] + 0.00 0.00 5/242 canfly [1031] + 0.00 0.00 5/3902878 get_monsters [293] + 0.00 0.00 9/129167539 u_race [89] + 0.00 0.00 5/5 set_money [1326] + 0.00 0.00 51/1009028 msg_release [1373] + 0.00 0.00 48/1511812 newterrain [1359] +----------------------------------------------- + 0.00 0.00 22843/22843 teach_cmd [272] +[849] 0.0 0.00 0.00 22843 parser_end [849] + 0.00 0.00 22778/5329742 eatwhitespace_c [255] +----------------------------------------------- + 0.00 0.00 5596/5596 attack [84] +[850] 0.0 0.00 0.00 5596 drain_exp [850] + 0.00 0.00 11021/7641081 genrand_int31 [171] + 0.00 0.00 45149/45891 get_level [934] + 0.00 0.00 75/1583 reduce_skill [1091] + 0.00 0.00 5425/595705 unit_skill [1391] +----------------------------------------------- + 0.00 0.00 2008/2008 name_unit [803] +[851] 0.0 0.00 0.00 2008 default_name [851] + 0.00 0.00 2008/24887945 locale_string [27] + 0.00 0.00 2008/5100840 itoa36 [116] + 0.00 0.00 2008/34611296 strlcpy [45] + 0.00 0.00 4016/987128 strlcat [1374] +----------------------------------------------- + 0.00 0.00 5049/5049 piracy_cmd [660] +[852] 0.0 0.00 0.00 5049 parse_ids [852] + 0.00 0.00 5053/54318 getstrtoken [710] + 0.00 0.00 5049/1027665 init_order [613] + 0.00 0.00 4/688711 atoi36 [440] + 0.00 0.00 4/4 intlist_init [1757] + 0.00 0.00 4/4 intlist_add [1756] +----------------------------------------------- + 0.00 0.00 232/232 reports [2] +[853] 0.0 0.00 0.00 232 write_script [853] + 0.00 0.00 232/11719 locale_name [568] + 0.00 0.00 232/5100840 itoa36 [116] + 0.00 0.00 886/987128 strlcat [1374] +----------------------------------------------- + 0.00 0.00 36/4361 piracy_cmd [660] + 0.00 0.00 4325/4361 sail [181] +[854] 0.0 0.00 0.00 4361 can_takeoff [854] + 0.00 0.00 4337/263302 reldirection [528] + 0.00 0.00 322/560926 bt_find [237] + 0.00 0.00 322/75797 buildingtype_exists [1443] +----------------------------------------------- + 0.00 0.00 32679/32679 produce [29] +[855] 0.0 0.00 0.00 32679 rule_auto_taxation [855] + 0.00 0.00 32679/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 318/1078 resolve [757] + 0.00 0.00 760/1078 read_reference [726] +[856] 0.0 0.00 0.00 1078 resolve_mage [856] + 0.00 0.00 1078/11989 resolve_unit [703] + 0.00 0.00 318/760 set_familiar [992] + 0.00 0.00 760/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 588/588 give_cmd [102] +[857] 0.0 0.00 0.00 588 give_men [857] + 0.00 0.00 1758/2624955 has_skill [193] + 0.00 0.00 588/659 can_give_men [940] + 0.00 0.00 567/1936 transfermen [899] + 0.00 0.00 1529/2275967 get_racename [368] + 0.00 0.00 488/12246335 ct_find [114] + 0.00 0.00 488/10190660 get_curse [143] + 0.00 0.00 567/1474687 leftship [500] + 0.00 0.00 588/8898 ucontact [927] + 0.00 0.00 588/702 max_transfers [1109] + 0.00 0.00 359/2421 set_racename [1015] + 0.00 0.00 783/129167539 u_race [89] + 0.00 0.00 19/15240 msg_error [744] + 0.00 0.00 488/4201030 curse_active [543] + 0.00 0.00 4/967784 msg_message [132] + 0.00 0.00 2/41248 msg_feedback [647] + 0.00 0.00 4/392959 add_message [434] + 0.00 0.00 5/234 set_leftship [1134] + 0.00 0.00 1/5100840 itoa36 [116] + 0.00 0.00 6/41882 GiveRestriction [836] + 0.00 0.00 4/118 rule_transfermen [1204] + 0.00 0.00 1/49235 log_debug [1245] + 0.00 0.00 588/1361 unit_has_cursed_item [1577] + 0.00 0.00 488/651711 oldcursename [1381] + 0.00 0.00 359/600145 u_setrace [1389] +----------------------------------------------- + 0.00 0.00 93119/93119 give_item [126] +[858] 0.0 0.00 0.00 93119 give_quota [858] + 0.00 0.00 93119/93119 limited_give [879] + 0.00 0.00 23838/717218 config_get_flt [714] +----------------------------------------------- + 0.00 0.00 2013/2013 process [7] +[859] 0.0 0.00 0.00 2013 display_cmd [859] + 0.00 0.00 2013/2281756 gettoken [195] + 0.00 0.00 2012/54318 getstrtoken [710] + 0.00 0.00 2013/6530 findparam_ex [926] + 0.00 0.00 2013/1027665 init_order [613] + 0.00 0.00 1573/1573 usetprivate [1041] + 0.00 0.00 1/15102 cmistake [718] + 0.00 0.00 1/593636 building_owner [232] + 0.00 0.00 17/3358315 ship_owner [438] +----------------------------------------------- + 0.00 0.00 38/38 report_effect [861] +[860] 0.0 0.00 0.00 38 report_action [860] + 0.00 0.00 197/1437425 cansee [22] + 0.00 0.00 206/12265 r_addmessage [779] + 0.00 0.00 1/392959 add_message [434] +----------------------------------------------- + 0.00 0.00 6/28 sp_mallornhain [968] + 0.00 0.00 9/28 sp_hain [931] + 0.00 0.00 13/28 sp_blessedharvest [847] +[861] 0.0 0.00 0.00 28 report_effect [861] + 0.00 0.00 38/38 report_action [860] +----------------------------------------------- + 0.00 0.00 5358/5358 max_spellpoints [755] +[862] 0.0 0.00 0.00 5358 get_spchange [862] + 0.00 0.00 5358/2426021 get_mage [198] +----------------------------------------------- + 0.00 0.00 2/2 parse_strings [864] +[863] 0.0 0.00 0.00 2 xml_readstrings [863] + 0.00 0.00 3444/5354 xml_readtext [887] + 0.00 0.00 3435/3496 locale_setstring [918] + 0.00 0.00 2342/4136059 mkname_buf [316] + 0.00 0.00 6879/8788 xml_cleanup_string [1520] +----------------------------------------------- + 0.00 0.00 1/1 read_xml [791] +[864] 0.0 0.00 0.00 1 parse_strings [864] + 0.00 0.00 2/2 xml_readstrings [863] +----------------------------------------------- + 0.00 0.00 23781/23781 guard_on_cmd [656] +[865] 0.0 0.00 0.00 23781 guard [865] + 0.00 0.00 23781/377253 guard_flags [690] + 0.00 0.00 23781/337987 setguard [815] +----------------------------------------------- + 0.00 0.00 2/4261 findparam_ex [926] + 0.00 0.00 4259/4261 make_cmd [383] +[866] 0.0 0.00 0.00 4261 findbuildingtype [866] + 0.00 0.00 4261/302482 findtoken [501] + 0.00 0.00 54/24887945 locale_string [27] + 0.00 0.00 54/8993 addtoken [811] +----------------------------------------------- + 0.00 0.00 1029/3111 print_header [838] + 0.00 0.00 2082/3111 print_stats [525] +[867] 0.0 0.00 0.00 3111 sidename [867] + 0.00 0.00 3111/1295787 factionname [247] + 0.00 0.00 3111/34611296 strlcpy [45] +----------------------------------------------- + 0.00 0.00 4/4 study_cmd [105] +[868] 0.0 0.00 0.00 4 count_skill [868] + 0.00 0.00 5253/2624955 has_skill [193] + 0.00 0.00 5/793 is_familiar [1092] +----------------------------------------------- + 0.00 0.00 4259/4259 make_cmd [383] +[869] 0.0 0.00 0.00 4259 findshiptype [869] + 0.00 0.00 4259/302482 findtoken [501] + 0.00 0.00 14/24887945 locale_string [27] + 0.00 0.00 14/8993 addtoken [811] +----------------------------------------------- + 0.00 0.00 1138/1138 a_read_i [390] +[870] 0.0 0.00 0.00 1138 read_targetregion [870] + 0.00 0.00 1138/9763 read_reference [726] +----------------------------------------------- + 0.00 0.00 9/9 magic [157] +[871] 0.0 0.00 0.00 9 sp_stormwinds [871] + 0.00 0.00 17/45 create_curse [800] + 0.00 0.00 76/12265 r_addmessage [779] + 0.00 0.00 9/967784 msg_message [132] + 0.00 0.00 27/12246335 ct_find [114] + 0.00 0.00 10/10190660 get_curse [143] + 0.00 0.00 10/4201030 curse_active [543] + 0.00 0.00 10/651711 oldcursename [1381] + 0.00 0.00 9/608 co_get_region [1594] + 0.00 0.00 9/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1334/4915 bufunit [17] + 0.00 0.00 1711/4915 cr_output_unit [19] + 0.00 0.00 1870/4915 regenerate_aura [346] +[872] 0.0 0.00 0.00 4915 get_spellpoints [872] + 0.00 0.00 4915/2426021 get_mage [198] +----------------------------------------------- + 0.00 0.00 42/42 produce [29] +[873] 0.0 0.00 0.00 42 loot_cmd [873] + 0.00 0.00 84/133 income [885] + 0.00 0.00 42/15361 is_guarded [377] + 0.00 0.00 42/771861 armedmen [151] + 0.00 0.00 42/760673 addlist [217] + 0.00 0.00 42/57138 getint [699] + 0.00 0.00 42/71815034 get_race [12] + 0.00 0.00 84/3902878 get_monsters [293] + 0.00 0.00 168/129167539 u_race [89] + 0.00 0.00 42/1027665 init_order [613] + 0.00 0.00 42/4984610 config_get_int [348] + 0.00 0.00 42/8506411 besieged [547] +----------------------------------------------- + 0.00 0.00 38/4875 do_combatspell [702] + 0.00 0.00 51/4875 do_combatmagic [825] + 0.00 0.00 4786/4875 bufunit [17] +[874] 0.0 0.00 0.00 4875 get_combatspell [874] + 0.00 0.00 4875/2426021 get_mage [198] + 0.00 0.00 50/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 15/6962 drifting_ships [490] + 0.00 0.00 6947/6962 sail [181] +[875] 0.0 0.00 0.00 6962 set_coast [875] + 0.00 0.00 4307/263302 reldirection [528] + 0.00 0.00 4307/44216 flying_ship [1465] +----------------------------------------------- + 0.00 0.00 552/552 make_fighter [424] +[876] 0.0 0.00 0.00 552 make_side [876] + 0.00 0.00 814/9953180 alliedunit [31] + 0.00 0.00 6102/6610983 is_guard [211] +----------------------------------------------- + 0.00 0.00 791/791 process [7] +[877] 0.0 0.00 0.00 791 ally_cmd [877] + 0.00 0.00 791/791 getfaction [937] + 0.00 0.00 677/69432 getparam [681] + 0.00 0.00 677/2281756 gettoken [195] + 0.00 0.00 107/15102 cmistake [718] + 0.00 0.00 677/1787006 findparam [458] + 0.00 0.00 791/1027665 init_order [613] + 0.00 0.00 664/51974272 a_find [65] + 0.00 0.00 677/10383360 HelpMask [288] + 0.00 0.00 1/1 removelist [1290] + 0.00 0.00 2/55547 ally_add [1452] +----------------------------------------------- + 0.00 0.00 1/1 process [7] +[878] 0.0 0.00 0.00 1 nmr_warnings [878] + 0.00 0.00 1449/1205451 alliedfaction [162] + 0.00 0.00 1398/4984610 config_get_int [348] + 0.00 0.00 24/967784 msg_message [132] + 0.00 0.00 55/392959 add_message [434] + 0.00 0.00 20/27 NMRTimeout [1264] + 0.00 0.00 24/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 93119/93119 give_quota [858] +[879] 0.0 0.00 0.00 93119 limited_give [879] + 0.00 0.00 93119/56052475 get_resourcetype [194] +----------------------------------------------- + 0.00 0.00 23/1339 do_combatspell [702] + 0.00 0.00 51/1339 do_combatmagic [825] + 0.00 0.00 1265/1339 bufunit [17] +[880] 0.0 0.00 0.00 1339 get_combatspelllevel [880] + 0.00 0.00 1302/12320804 effskill [100] + 0.00 0.00 1339/2426021 get_mage [198] +----------------------------------------------- + 0.00 0.00 425/425 aftermath [701] +[881] 0.0 0.00 0.00 425 reportcasualties [881] + 0.00 0.00 395/1486 message_all [834] + 0.00 0.00 395/967784 msg_message [132] + 0.00 0.00 395/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1520/1520 parse_symbol [42] +[882] 0.0 0.00 0.00 1520 eval_race [882] + 0.00 0.00 1520/24887945 locale_string [27] + 0.00 0.00 1520/2818494 rc_name_s [260] + 0.00 0.00 3040/13102790 opstack_pop [176] + 0.00 0.00 1520/13102790 opstack_push [202] + 0.00 0.00 1520/13399069 balloc [363] +----------------------------------------------- + 0.00 0.00 1909/1909 parse_messages [832] +[883] 0.0 0.00 0.00 1909 nrt_register [883] + 0.00 0.00 4921/34611296 strlcpy [45] + 0.00 0.00 1909/32337529 hashstring [37] + 0.00 0.00 1909/1909 section_find [1563] + 0.00 0.00 10/10 section_add [1729] +----------------------------------------------- + 0.00 0.00 1/5588 crtag [110] + 0.00 0.00 233/5588 readfaction [767] + 0.00 0.00 5354/5588 xml_readtext [887] +[884] 0.0 0.00 0.00 5588 get_locale [884] + 0.00 0.00 5588/32337529 hashstring [37] +----------------------------------------------- + 0.00 0.00 49/133 plan_dragon [273] + 0.00 0.00 84/133 loot_cmd [873] +[885] 0.0 0.00 0.00 133 income [885] + 0.00 0.00 133/2480226 old_race [14] + 0.00 0.00 266/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 349/349 produce [29] +[886] 0.0 0.00 0.00 349 research_cmd [886] + 0.00 0.00 349/967784 msg_message [132] + 0.00 0.00 349/472418 produceexp [322] + 0.00 0.00 349/12320804 effskill [100] + 0.00 0.00 349/392959 add_message [434] + 0.00 0.00 349/1027665 init_order [613] + 0.00 0.00 692/3166898 rherbs [1351] + 0.00 0.00 349/1009028 msg_release [1373] + 0.00 0.00 343/343 rough_amount [1607] +----------------------------------------------- + 0.00 0.00 1910/5354 parse_messages [832] + 0.00 0.00 3444/5354 xml_readstrings [863] +[887] 0.0 0.00 0.00 5354 xml_readtext [887] + 0.00 0.00 5354/5588 get_locale [884] +----------------------------------------------- + 0.00 0.00 1301/1301 split_allocations [743] +[888] 0.0 0.00 0.00 1301 leveled_allocation [888] + 0.00 0.00 1423/12320804 effskill [100] + 0.00 0.00 1281/7641081 genrand_int31 [171] + 0.00 0.00 1245/1245 use_default [1149] + 0.00 0.00 1301/9298667 resource2item [546] + 0.00 0.00 2704/7493 required [1527] + 0.00 0.00 1301/1301 rm_get [1578] +----------------------------------------------- + 0.00 0.00 396/396 update_spells [381] +[889] 0.0 0.00 0.00 396 show_new_spells [889] + 0.00 0.00 7815/7815 already_seen [929] + 0.00 0.00 4162/779419 a_add [555] + 0.00 0.00 4162/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 25088/25088 rmtroop [533] +[890] 0.0 0.00 0.00 25088 rmfighter [890] + 0.00 0.00 25088/129167539 u_race [89] + 0.00 0.00 25088/4301501 statusrow [550] +----------------------------------------------- + 0.00 0.00 9/1803 destroyfaction [392] + 0.00 0.00 1794/1803 remove_unit [499] +[891] 0.0 0.00 0.00 1803 gift_items [891] + 0.00 0.00 112/112 get_friends [895] + 0.00 0.00 3606/56052475 get_resourcetype [194] + 0.00 0.00 578/129167539 u_race [89] + 0.00 0.00 26/11241829 i_change [115] + 0.00 0.00 38/2186159 rsetmoney [553] + 0.00 0.00 38/4666665 rmoney [452] + 0.00 0.00 1803/103079 rule_give [1328] + 0.00 0.00 216/257723 i_remove [1407] + 0.00 0.00 216/374425 i_free [1400] + 0.00 0.00 88/97 i_merge [1651] + 0.00 0.00 5/1160345 rhorses [1369] + 0.00 0.00 5/257693 rsethorses [1408] +----------------------------------------------- + 0.00 0.00 768/768 read_triggers [798] +[892] 0.0 0.00 0.00 768 shock_read [892] + 0.00 0.00 768/9763 read_reference [726] +----------------------------------------------- + 0.00 0.00 760/760 a_read_i [390] +[893] 0.0 0.00 0.00 760 read_familiar [893] + 0.00 0.00 760/9763 read_reference [726] +----------------------------------------------- + 0.00 0.00 760/760 a_read_i [390] +[894] 0.0 0.00 0.00 760 read_magician [894] + 0.00 0.00 760/9763 read_reference [726] +----------------------------------------------- + 0.00 0.00 112/112 gift_items [891] +[895] 0.0 0.00 0.00 112 get_friends [895] + 0.00 0.00 1104/9953180 alliedunit [31] + 0.00 0.00 1085/4984610 config_get_int [348] + 0.00 0.00 28/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 6/6 magic [157] +[896] 0.0 0.00 0.00 6 sp_summonundead [896] + 0.00 0.00 6/2889 create_unit [296] + 0.00 0.00 6/6 skill_summoned [1032] + 0.00 0.00 12/967784 msg_message [132] + 0.00 0.00 6/6 make_undead_unit [1188] + 0.00 0.00 12/392959 add_message [434] + 0.00 0.00 12/71815034 get_race [12] + 0.00 0.00 9/201744 lovar [644] + 0.00 0.00 15/355423 deathcount [674] + 0.00 0.00 12/1009028 msg_release [1373] + 0.00 0.00 6/608 co_get_region [1594] +----------------------------------------------- + 0.00 0.00 16132/16132 teach_unit [426] +[897] 0.0 0.00 0.00 16132 magic_lowskill [897] + 0.00 0.00 16132/12560453 rc_changed [256] + 0.00 0.00 16132/129167539 u_race [89] + 0.00 0.00 1/71815034 get_race [12] +----------------------------------------------- + 0.00 0.00 80/80 process [7] +[898] 0.0 0.00 0.00 80 combatspell_cmd [898] + 0.00 0.00 37/365 unit_getspell [758] + 0.00 0.00 100/2281756 gettoken [195] + 0.00 0.00 27/15102 cmistake [718] + 0.00 0.00 10/10 set_combatspell [1146] + 0.00 0.00 43/43 unset_combatspell [1167] + 0.00 0.00 115/1787006 findparam [458] + 0.00 0.00 80/1027665 init_order [613] + 0.00 0.00 10/57138 getint [699] +----------------------------------------------- + 0.00 0.00 71/1936 disband_men [999] + 0.00 0.00 567/1936 give_men [857] + 0.00 0.00 1298/1936 add_recruits [371] +[899] 0.0 0.00 0.00 1936 transfermen [899] + 0.00 0.00 3730/51974272 a_find [65] + 0.00 0.00 1936/3178 scale_number [969] + 0.00 0.00 1865/1474687 leftship [500] + 0.00 0.00 1610/1610 transfer_curse [1039] + 0.00 0.00 698/1956810 add_skill [355] + 0.00 0.00 71/264251 rsetpeasants [545] + 0.00 0.00 71/2605004 rpeasants [435] + 0.00 0.00 142/129167539 u_race [89] + 0.00 0.00 5/234 set_leftship [1134] + 0.00 0.00 108170/595705 unit_skill [1391] + 0.00 0.00 1865/603524 set_number [1387] + 0.00 0.00 95/51060 remove_skill [1456] +----------------------------------------------- + 0.00 0.00 2/16493 start_battle [297] + 0.00 0.00 237/16493 quit [276] + 0.00 0.00 16254/16493 IsImmune [901] +[900] 0.0 0.00 0.00 16493 NewbieImmunity [900] + 0.00 0.00 16493/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 65/16669 steal_cmd [766] + 0.00 0.00 1431/16669 start_battle [297] + 0.00 0.00 15173/16669 can_start_guarding [679] +[901] 0.0 0.00 0.00 16669 IsImmune [901] + 0.00 0.00 16254/16493 NewbieImmunity [900] +----------------------------------------------- + 0.00 0.00 56/3110 update_long_order [270] + 0.00 0.00 165/3110 build_building [696] + 0.00 0.00 2889/3110 create_unit [296] +[902] 0.0 0.00 0.00 3110 default_order [902] + 0.00 0.00 3110/635885 copy_order [441] + 0.00 0.00 2/447808 create_order [341] + 0.00 0.00 2/20777534 config_get [224] + 0.00 0.00 3110/2124526 locale_index [1354] + 0.00 0.00 2/65 findkeyword [1665] +----------------------------------------------- + 0.00 0.00 2/2831 do_fumble [1062] + 0.00 0.00 767/2831 spellcost [995] + 0.00 0.00 2062/2831 magic [157] +[903] 0.0 0.00 0.00 2831 countspells [903] + 0.00 0.00 2831/2426021 get_mage [198] +----------------------------------------------- + 0.00 0.00 1700/1700 process [7] +[904] 0.0 0.00 0.00 1700 status_cmd [904] + 0.00 0.00 1700/2281756 gettoken [195] + 0.00 0.00 1700/1787006 findparam [458] + 0.00 0.00 1700/1027665 init_order [613] + 0.00 0.00 17/69432 getparam [681] + 0.00 0.00 1683/599650 setstatus [1390] +----------------------------------------------- + 0.00 0.00 923/923 name_unit [803] +[905] 0.0 0.00 0.00 923 race_namegen [905] + 0.00 0.00 666/666 generic_name [962] + 0.00 0.00 74/74 ghoul_name [1029] + 0.00 0.00 70/70 skeleton_name [1035] + 0.00 0.00 52/52 zombie_name [1056] + 0.00 0.00 27/27 dragon_name [1095] + 0.00 0.00 34/34 dracoid_name [1126] +----------------------------------------------- + 0.00 0.00 1/1 processorders [6] +[906] 0.0 0.00 0.00 1 wormholes_update [906] + 0.00 0.00 1/1 select_wormhole_regions [909] + 0.00 0.00 1/1 make_wormholes [1151] + 0.00 0.00 1/560926 bt_find [237] + 0.00 0.00 1/1 sort_wormhole_regions [1864] +----------------------------------------------- + 0.00 0.00 834/834 parse_symbol [42] +[907] 0.0 0.00 0.00 834 eval_resources [907] + 0.00 0.00 1490/24887945 locale_string [27] + 0.00 0.00 1490/13259934 resourcename [233] + 0.00 0.00 834/13102790 opstack_pop [176] + 0.00 0.00 834/13102790 opstack_push [202] + 0.00 0.00 1490/36653945 wrptr [178] + 0.00 0.00 834/13399069 balloc [363] +----------------------------------------------- + 0.00 0.00 81/81 allocate_resource [752] +[908] 0.0 0.00 0.00 81 can_guard [908] + 0.00 0.00 81/1437425 cansee [22] + 0.00 0.00 79/771861 armedmen [151] + 0.00 0.00 79/9953180 alliedunit [31] + 0.00 0.00 79/129167539 u_race [89] + 0.00 0.00 79/8506411 besieged [547] +----------------------------------------------- + 0.00 0.00 1/1 wormholes_update [906] +[909] 0.0 0.00 0.00 1 select_wormhole_regions [909] + 0.00 0.00 178255/178255 good_region [910] + 0.00 0.00 3/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.00 178255/178255 select_wormhole_regions [909] +[910] 0.0 0.00 0.00 178255 good_region [910] + 0.00 0.00 174658/18647447 getplane [596] +----------------------------------------------- + 0.00 0.00 443/443 res_changepermaura [912] +[911] 0.0 0.00 0.00 443 change_maxspellpoints [911] + 0.00 0.00 443/5358 max_spellpoints [755] + 0.00 0.00 443/2426021 get_mage [198] +----------------------------------------------- + 0.00 0.00 86/443 change_resource [240] + 0.00 0.00 357/443 get_resource [99] +[912] 0.0 0.00 0.00 443 res_changepermaura [912] + 0.00 0.00 443/443 change_maxspellpoints [911] +----------------------------------------------- + 0.00 0.00 5925/5925 readfaction [767] +[913] 0.0 0.00 0.00 5925 addally [913] + 0.00 0.00 5925/4625636 findfaction [259] + 0.00 0.00 5925/10383360 HelpMask [288] + 0.00 0.00 5925/55547 ally_add [1452] + 0.00 0.00 2941/34565 ur_add [1472] +----------------------------------------------- + 0.00 0.00 1422/1422 split_allocations [743] +[914] 0.0 0.00 0.00 1422 attrib_allocation [914] + 0.00 0.00 1584/1584 produce_resource [994] + 0.00 0.00 1414/3123 limit_resource [943] + 0.00 0.00 1596/7641081 genrand_int31 [171] + 0.00 0.00 1422/51974272 a_find [65] + 0.00 0.00 4789/7493 required [1527] + 0.00 0.00 11/11 produce_seeds [1725] + 0.00 0.00 7/30 limit_seeds [1691] + 0.00 0.00 1/2 limit_mallornseeds [1775] + 0.00 0.00 1/1 produce_mallornseeds [1829] +----------------------------------------------- + 0.00 0.00 1725/1725 add_skill [355] +[915] 0.0 0.00 0.00 1725 max_magicians [915] + 0.00 0.00 1725/71815034 get_race [12] + 0.00 0.00 1725/51974272 a_find [65] + 0.00 0.00 1725/4984610 config_get_int [348] +----------------------------------------------- + +[916] 0.0 0.00 0.00 tolua_unit_create [916] + 0.00 0.00 6/2889 create_unit [296] + 0.00 0.00 6/68430117 rc_find [15] +----------------------------------------------- + 0.00 0.00 1/1 process [7] +[917] 0.0 0.00 0.00 1 promotion_cmd [917] + 0.00 0.00 1/461 maxheroes [492] + 0.00 0.00 1/967 count_all [357] + 0.00 0.00 1/457 countheroes [572] + 0.00 0.00 1/860263 use_pooled [39] + 0.00 0.00 1/541982 get_pooled [104] + 0.00 0.00 1/967784 msg_message [132] + 0.00 0.00 1/392959 add_message [434] + 0.00 0.00 1/129167539 u_race [89] + 0.00 0.00 1/56052475 get_resourcetype [194] + 0.00 0.00 1/1 valid_race [1893] + 0.00 0.00 1/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 61/3496 json_keyword [1127] + 0.00 0.00 3435/3496 xml_readstrings [863] +[918] 0.0 0.00 0.00 3496 locale_setstring [918] + 0.00 0.00 3496/32337529 hashstring [37] +----------------------------------------------- + 0.00 0.00 1551/8034 spskill [53] + 0.00 0.00 1637/8034 cr_output_unit [19] + 0.00 0.00 4846/8034 eff_stealth [163] +[919] 0.0 0.00 0.00 8034 u_geteffstealth [919] + 0.00 0.00 8034/51974272 a_find [65] + 0.00 0.00 8034/21345834 skill_enabled [365] +----------------------------------------------- + 0.00 0.00 232/232 writefaction [762] +[920] 0.0 0.00 0.00 232 write_groups [920] + 0.00 0.00 1692/841675 a_write [299] + 0.00 0.00 51104/647569 write_faction_reference [1382] +----------------------------------------------- + 0.00 0.00 35/35 mail_cmd [844] +[921] 0.0 0.00 0.00 35 mailunit [921] + 0.00 0.00 35/39 deliverMail [966] + 0.00 0.00 35/1437425 cansee [22] + 0.00 0.00 35/145 findunitr [991] +----------------------------------------------- + 0.00 0.00 1196/1196 parse_symbol [42] +[922] 0.0 0.00 0.00 1196 eval_localize [922] + 0.00 0.00 1196/24887945 locale_string [27] + 0.00 0.00 1196/13102790 opstack_pop [176] + 0.00 0.00 1196/13102790 opstack_push [202] + 0.00 0.00 1196/13399069 balloc [363] +----------------------------------------------- + 0.00 0.00 2/2 do_combatmagic [825] +[923] 0.0 0.00 0.00 2 sp_igjarjuk [923] + 0.00 0.00 2/2 summon_allies [925] + 0.00 0.00 2/361 regionname [987] + 0.00 0.00 2/2383101 unitname [142] + 0.00 0.00 2/71815034 get_race [12] + 0.00 0.00 2/64 log_info [1339] + 0.00 0.00 2/3862 unit_setname [1540] +----------------------------------------------- + +[924] 0.0 0.00 0.00 cb_foreach_i [924] + 0.00 0.00 324/324 add_resourcename_cb [977] + 0.00 0.00 324/324 add_itemname_cb [980] +----------------------------------------------- + 0.00 0.00 2/2 sp_igjarjuk [923] +[925] 0.0 0.00 0.00 2 summon_allies [925] + 0.00 0.00 2/1297 make_fighter [424] + 0.00 0.00 2/2889 create_unit [296] + 0.00 0.00 2/2887 leave [432] + 0.00 0.00 2/1486 message_all [834] + 0.00 0.00 2/967784 msg_message [132] + 0.00 0.00 2/1381157 unit_max_hp [136] + 0.00 0.00 2/779419 a_add [555] + 0.00 0.00 2/599650 setstatus [1390] + 0.00 0.00 2/779868 a_new [1376] + 0.00 0.00 2/1009028 msg_release [1373] + 0.00 0.00 2/2854 is_attacker [1550] +----------------------------------------------- + 0.00 0.00 138/6530 renumber_cmd [780] + 0.00 0.00 623/6530 mail_cmd [844] + 0.00 0.00 639/6530 do_enter [128] + 0.00 0.00 2013/6530 display_cmd [859] + 0.00 0.00 3117/6530 name_cmd [835] +[926] 0.0 0.00 0.00 6530 findparam_ex [926] + 0.00 0.00 6530/1787006 findparam [458] + 0.00 0.00 2/4261 findbuildingtype [866] +----------------------------------------------- + 0.00 0.00 2/8898 sp_enterastral [1045] + 0.00 0.00 20/8898 can_give_to [600] + 0.00 0.00 50/8898 give_cmd [102] + 0.00 0.00 186/8898 mayboard [1046] + 0.00 0.00 317/8898 mayenter [936] + 0.00 0.00 397/8898 is_guardian_u [626] + 0.00 0.00 588/8898 give_men [857] + 0.00 0.00 1198/8898 check_ship_allowed [657] + 0.00 0.00 6140/8898 bewegung_blockiert_von [631] +[927] 0.0 0.00 0.00 8898 ucontact [927] + 0.00 0.00 8144/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 58/30308 peasant_luck_effect [984] + 0.00 0.00 30250/30308 peasants [658] +[928] 0.0 0.00 0.00 30308 peasant_growth_factor [928] + 0.00 0.00 30308/717218 config_get_flt [714] +----------------------------------------------- + 0.00 0.00 7815/7815 show_new_spells [889] +[929] 0.0 0.00 0.00 7815 already_seen [929] + 0.00 0.00 7815/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 4024/4024 a_write [299] +[930] 0.0 0.00 0.00 4024 curse_write [930] + 0.00 0.00 4024/604861 write_unit_reference [557] + 0.00 0.00 3/3 write_skill [1769] +----------------------------------------------- + 0.00 0.00 1/10 do_fumble [1062] + 0.00 0.00 9/10 magic [157] +[931] 0.0 0.00 0.00 10 sp_hain [931] + 0.00 0.00 9/28 report_effect [861] + 0.00 0.00 18/967784 msg_message [132] + 0.00 0.00 9/201744 lovar [644] + 0.00 0.00 1/15102 cmistake [718] + 0.00 0.00 9/10053919 rtrees [302] + 0.00 0.00 18/1009028 msg_release [1373] + 0.00 0.00 10/608 co_get_region [1594] + 0.00 0.00 9/229715 rsettrees [1410] +----------------------------------------------- + 0.00 0.00 9/105 melt_iceberg [1082] + 0.00 0.00 96/105 chaos [848] +[932] 0.0 0.00 0.00 105 terraform_region [932] + 0.00 0.00 105/105 terraform_resources [986] + 0.00 0.00 48/32727 rsetherbtype [537] + 0.00 0.00 48/48 makename [1084] + 0.00 0.00 298/7641081 genrand_int31 [171] + 0.00 0.00 48/60 equip_items [1121] + 0.00 0.00 57/264251 rsetpeasants [545] + 0.00 0.00 29/752645 chance [495] + 0.00 0.00 10/369586 r_connect [474] + 0.00 0.00 57/2186159 rsetmoney [553] + 0.00 0.00 58/10053919 rtrees [302] + 0.00 0.00 252/229715 rsettrees [1410] + 0.00 0.00 64/257693 rsethorses [1408] + 0.00 0.00 57/178311 region_setinfo [1422] + 0.00 0.00 57/10475 i_freeall [1515] + 0.00 0.00 57/57 free_land [1673] + 0.00 0.00 48/32727 region_set_morale [1476] + 0.00 0.00 48/48 region_setname [1683] + 0.00 0.00 48/48 get_maxluxuries [1682] + 0.00 0.00 48/2742 get_equipment [1551] + 0.00 0.00 48/101322 rsetherbs [1438] + 0.00 0.00 29/1511812 newterrain [1359] +----------------------------------------------- + 0.00 0.00 3/1873 do_fumble [1062] + 0.00 0.00 1870/1873 regenerate_aura [346] +[933] 0.0 0.00 0.00 1873 set_spellpoints [933] + 0.00 0.00 1873/2426021 get_mage [198] +----------------------------------------------- + 0.00 0.00 1/45891 sp_summonshadowlords [1034] + 0.00 0.00 17/45891 study_cmd [105] + 0.00 0.00 724/45891 study_cost [433] + 0.00 0.00 45149/45891 drain_exp [850] +[934] 0.0 0.00 0.00 45891 get_level [934] + 0.00 0.00 45891/21345834 skill_enabled [365] +----------------------------------------------- + 0.00 0.00 56/56 use_item [765] +[935] 0.0 0.00 0.00 56 use_bloodpotion [935] + 0.00 0.00 56/860263 use_pooled [39] + 0.00 0.00 56/967784 msg_message [132] + 0.00 0.00 56/392959 add_message [434] + 0.00 0.00 56/71815034 get_race [12] + 0.00 0.00 56/404 usetpotionuse [1078] + 0.00 0.00 55/2977 change_effect [982] + 0.00 0.00 58/129167539 u_race [89] + 0.00 0.00 1/68430117 rc_find [15] + 0.00 0.00 1/3 trigger_changerace [1297] + 0.00 0.00 1/2868601 u_irace [257] + 0.00 0.00 1/11 add_trigger [1260] + 0.00 0.00 1/7641081 genrand_int31 [171] + 0.00 0.00 56/1009028 msg_release [1373] + 0.00 0.00 1/5 trigger_timeout [1753] + 0.00 0.00 1/600145 u_setrace [1389] +----------------------------------------------- + 0.00 0.00 401/401 enter_building [695] +[936] 0.0 0.00 0.00 401 mayenter [936] + 0.00 0.00 401/593636 building_owner [232] + 0.00 0.00 215/9953180 alliedunit [31] + 0.00 0.00 317/8898 ucontact [927] +----------------------------------------------- + 0.00 0.00 791/791 ally_cmd [877] +[937] 0.0 0.00 0.00 791 getfaction [937] + 0.00 0.00 791/228907 getid [483] + 0.00 0.00 791/4625636 findfaction [259] +----------------------------------------------- + 0.00 0.00 230/45860 report_computer [9] + 0.00 0.00 45630/45860 cr_output_region [10] +[938] 0.0 0.00 0.00 45860 print_items [938] + 0.00 0.00 446/4434556 translate [75] + 0.00 0.00 446/24887945 locale_string [27] + 0.00 0.00 446/13259934 resourcename [233] +----------------------------------------------- + 0.00 0.00 3/3 magic [157] +[939] 0.0 0.00 0.00 3 sp_song_of_peace [939] + 0.00 0.00 3/45 create_curse [800] + 0.00 0.00 30/1437425 cansee [22] + 0.00 0.00 30/12265 r_addmessage [779] + 0.00 0.00 5/967784 msg_message [132] + 0.00 0.00 3/201744 lovar [644] + 0.00 0.00 3/12246335 ct_find [114] + 0.00 0.00 5/1009028 msg_release [1373] + 0.00 0.00 3/608 co_get_region [1594] +----------------------------------------------- + 0.00 0.00 71/659 disband_men [999] + 0.00 0.00 588/659 give_men [857] +[940] 0.0 0.00 0.00 659 can_give_men [940] + 0.00 0.00 659/71815034 get_race [12] + 0.00 0.00 659/2624955 has_skill [193] + 0.00 0.00 349/12246335 ct_find [114] + 0.00 0.00 349/10190660 get_curse [143] + 0.00 0.00 659/129167539 u_race [89] + 0.00 0.00 349/4201030 curse_active [543] + 0.00 0.00 659/1361 unit_has_cursed_item [1577] + 0.00 0.00 349/651711 oldcursename [1381] +----------------------------------------------- + 0.00 0.00 345/345 use_potion [801] +[941] 0.0 0.00 0.00 345 do_potion [941] + 0.00 0.00 51/51 potion_water_of_life [945] + 0.00 0.00 232/2977 change_effect [982] + 0.00 0.00 62/62 potion_luck [1176] +----------------------------------------------- + 0.00 0.00 508/508 regenerate_aura [346] +[942] 0.0 0.00 0.00 508 regeneration [942] + 0.00 0.00 508/12320804 effskill [100] + 0.00 0.00 1016/1336242 rng_injectable_double [396] + 0.00 0.00 508/129167539 u_race [89] + 0.00 0.00 508/508 MagicRegeneration [1185] +----------------------------------------------- + 0.00 0.00 1414/3123 attrib_allocation [914] + 0.00 0.00 1709/3123 allocate_resource [752] +[943] 0.0 0.00 0.00 3123 limit_resource [943] + 0.00 0.00 3123/34611296 strlcpy [45] + 0.00 0.00 3123/987128 strlcat [1374] +----------------------------------------------- + 0.00 0.00 230/230 report_plaintext [4] +[944] 0.0 0.00 0.00 230 gamedate_season [944] + 0.00 0.00 1150/24887945 locale_string [27] + 0.00 0.00 230/40692 get_gamedate [1466] +----------------------------------------------- + 0.00 0.00 51/51 do_potion [941] +[945] 0.0 0.00 0.00 51 potion_water_of_life [945] + 0.00 0.00 51/860263 use_pooled [39] + 0.00 0.00 51/967784 msg_message [132] + 0.00 0.00 51/392959 add_message [434] + 0.00 0.00 51/2032164 rt_find [597] + 0.00 0.00 51/10053919 rtrees [302] + 0.00 0.00 2/4984610 config_get_int [348] + 0.00 0.00 51/2386892 config_changed [1352] + 0.00 0.00 51/229715 rsettrees [1410] + 0.00 0.00 51/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 2/122 create_ship [1014] + 0.00 0.00 120/122 continue_ship [813] +[946] 0.0 0.00 0.00 122 maxbuild [946] + 0.00 0.00 122/541982 get_pooled [104] + 0.00 0.00 122/3100 required [1547] +----------------------------------------------- + 0.00 0.00 1/3 config_parse [462] + 0.00 0.00 1/3 reset_game [356] + 0.00 0.00 1/3 readgame [60] +[947] 0.0 0.00 0.00 3 init_locales [947] + 0.00 0.00 2/2 init_locale [948] + 0.00 0.00 2/6 get_or_create_locale [1275] +----------------------------------------------- + 0.00 0.00 2/2 init_locales [947] +[948] 0.0 0.00 0.00 2 init_locale [948] + 0.00 0.00 282/24887945 locale_string [27] + 0.00 0.00 282/8993 addtoken [811] + 0.00 0.00 2/2 init_keywords [1099] + 0.00 0.00 2/2 init_skills [1101] + 0.00 0.00 2/2 init_parameters [1100] + 0.00 0.00 272/2818494 rc_name_s [260] + 0.00 0.00 2/2 init_terrains_translation [1129] + 0.00 0.00 2/2 init_directions [1143] + 0.00 0.00 2/2 init_options_translation [1157] + 0.00 0.00 10/4133717 mkname [261] + 0.00 0.00 4/4558423 get_translations [437] + 0.00 0.00 2/20777534 config_get [224] +----------------------------------------------- + 0.00 0.00 356/356 cr_render [196] +[949] 0.0 0.00 0.00 356 cr_race [949] + 0.00 0.00 356/4434556 translate [75] + 0.00 0.00 356/24887945 locale_string [27] + 0.00 0.00 356/2818494 rc_name_s [260] +----------------------------------------------- + 0.00 0.00 41/41 make_cmd [383] +[950] 0.0 0.00 0.00 41 build_road [950] + 0.00 0.00 21/860263 use_pooled [39] + 0.00 0.00 23/541982 get_pooled [104] + 0.00 0.00 60/143730 rroad [508] + 0.00 0.00 21/967784 msg_message [132] + 0.00 0.00 41/12320804 effskill [100] + 0.00 0.00 21/22 rsetroad [1152] + 0.00 0.00 16/41248 msg_feedback [647] + 0.00 0.00 37/392959 add_message [434] + 0.00 0.00 36/369586 r_connect [474] + 0.00 0.00 21/472418 produceexp [322] + 0.00 0.00 44/71815034 get_race [12] + 0.00 0.00 5/560926 bt_find [237] + 0.00 0.00 4/15102 cmistake [718] + 0.00 0.00 11/6010308 i_find [127] + 0.00 0.00 11/2858912 get_effect [225] + 0.00 0.00 44/129167539 u_race [89] + 0.00 0.00 55/56052475 get_resourcetype [194] + 0.00 0.00 41/8506411 besieged [547] + 0.00 0.00 114/1511812 newterrain [1359] + 0.00 0.00 37/1009028 msg_release [1373] + 0.00 0.00 5/75797 buildingtype_exists [1443] +----------------------------------------------- + 0.00 0.00 10/492 set_combatspell [1146] + 0.00 0.00 482/492 knowsspell [956] +[951] 0.0 0.00 0.00 492 u_hasspell [951] + 0.00 0.00 489/12320804 effskill [100] + 0.00 0.00 492/597806 unit_get_spellbook [427] + 0.00 0.00 489/2112 spellbook_get [1557] +----------------------------------------------- + 0.00 0.00 114/114 give_cmd [102] +[952] 0.0 0.00 0.00 114 give_unit [952] + 0.00 0.00 112/94420 add_give [379] + 0.00 0.00 112/9953180 alliedunit [31] + 0.00 0.00 224/2624955 has_skill [193] + 0.00 0.00 114/118 rule_transfermen [1204] + 0.00 0.00 114/702 max_transfers [1109] + 0.00 0.00 112/129167539 u_race [89] + 0.00 0.00 2/15102 cmistake [718] + 0.00 0.00 112/56052475 get_resourcetype [194] + 0.00 0.00 112/598129 u_setfaction [1111] + 0.00 0.00 114/1361 unit_has_cursed_item [1577] +----------------------------------------------- +[953] 0.0 0.00 0.00 1564+36 [953] + 0.00 0.00 1582 write_triggers [954] + 0.00 0.00 18 timeout_write [1711] +----------------------------------------------- + 18 timeout_write [1711] + 0.00 0.00 1564/1564 write_handler [955] +[954] 0.0 0.00 0.00 1582 write_triggers [954] + 0.00 0.00 2304/2304 killunit_write [978] + 0.00 0.00 769/769 shock_write [1050] + 0.00 0.00 12/12 changefaction_write [1258] + 0.00 0.00 6/6 changerace_write [1287] + 0.00 0.00 2/2 giveitem_write [1309] + 0.00 0.00 1/1 clonedied_write [1321] + 0.00 0.00 1/1 caldera_write [1795] + 18 timeout_write [1711] +----------------------------------------------- + 0.00 0.00 1564/1564 a_write [299] +[955] 0.0 0.00 0.00 1564 write_handler [955] + 0.00 0.00 1564/1564 write_triggers [954] +----------------------------------------------- + 0.00 0.00 10/482 set_combatspell [1146] + 0.00 0.00 221/482 cast_cmd [760] + 0.00 0.00 251/482 cancast [833] +[956] 0.0 0.00 0.00 482 knowsspell [956] + 0.00 0.00 482/492 u_hasspell [951] +----------------------------------------------- + 0.00 0.00 21/21 cast_combatspell [623] +[957] 0.0 0.00 0.00 21 sp_kampfzauber [957] + 0.00 0.00 45/80630 terminate [242] + 0.00 0.00 45/372173 select_enemy [172] + 0.00 0.00 21/1486 message_all [834] + 0.00 0.00 21/967784 msg_message [132] + 0.00 0.00 21/201744 lovar [644] + 0.00 0.00 21/876979 count_enemies [611] + 0.00 0.00 21/74 spell_damage [1657] + 0.00 0.00 21/74 get_force [1656] + 0.00 0.00 21/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1/178429 sp_holyground [1068] + 0.00 0.00 59/178429 setstealth_cmd [182] + 0.00 0.00 115/178429 reshow [822] + 0.00 0.00 178254/178429 age_piracy [959] +[958] 0.0 0.00 0.00 178429 a_removeall [958] + 0.00 0.00 2172/454395 a_free [558] +----------------------------------------------- + 0.00 0.00 178254/178254 move_pirates [326] +[959] 0.0 0.00 0.00 178254 age_piracy [959] + 0.00 0.00 178254/178429 a_removeall [958] +----------------------------------------------- + 0.00 0.00 210/210 cr_render [196] +[960] 0.0 0.00 0.00 210 cr_resources [960] + 0.00 0.00 352/4434556 translate [75] + 0.00 0.00 352/24887945 locale_string [27] + 0.00 0.00 352/13259934 resourcename [233] +----------------------------------------------- + 0.00 0.00 604/604 parse_symbol [42] +[961] 0.0 0.00 0.00 604 eval_spell [961] + 0.00 0.00 604/86400 spell_name [646] + 0.00 0.00 604/13102790 opstack_pop [176] + 0.00 0.00 604/13102790 opstack_push [202] + 0.00 0.00 604/13399069 balloc [363] +----------------------------------------------- + 0.00 0.00 666/666 race_namegen [905] +[962] 0.0 0.00 0.00 666 generic_name [962] + 0.00 0.00 666/24887945 locale_string [27] + 0.00 0.00 666/2818494 rc_name_s [260] + 0.00 0.00 666/129167539 u_race [89] + 0.00 0.00 666/3862 unit_setname [1540] +----------------------------------------------- + 0.00 0.00 47/47 reshow_other [823] +[963] 0.0 0.00 0.00 47 display_race [963] + 0.00 0.00 495/24887945 locale_string [27] + 0.00 0.00 47/48 addmessage [1069] + 0.00 0.00 211/17451017 strlcpy_w [67] + 0.00 0.00 47/779486 locale_getstring [266] + 0.00 0.00 456/36653945 wrptr [178] + 0.00 0.00 86/4133717 mkname [261] + 0.00 0.00 47/2818494 rc_name_s [260] + 0.00 0.00 211/5461936 slprintf [548] +----------------------------------------------- + 0.00 0.00 9352/9352 nr_spell [507] +[964] 0.0 0.00 0.00 9352 write_spell_modifier [964] + 0.00 0.00 2478/34611296 strlcpy [45] +----------------------------------------------- + 0.00 0.00 147/147 do_contact [250] +[965] 0.0 0.00 0.00 147 contact_cmd [965] + 0.00 0.00 147/888603 findunit [123] + 0.00 0.00 147/284005 read_unitid [413] + 0.00 0.00 115/115 usetcontact [1147] + 0.00 0.00 147/1027665 init_order [613] + 0.00 0.00 115/192 can_contact [1634] +----------------------------------------------- + 0.00 0.00 4/39 mailfaction [1106] + 0.00 0.00 35/39 mailunit [921] +[966] 0.0 0.00 0.00 39 deliverMail [966] + 0.00 0.00 39/1437425 cansee [22] + 0.00 0.00 39/967784 msg_message [132] + 0.00 0.00 39/392959 add_message [434] + 0.00 0.00 39/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 5049/5049 piracy_cmd [660] +[967] 0.0 0.00 0.00 5049 find_piracy_target [967] + 0.00 0.00 5049/51974272 a_find [65] + 0.00 0.00 2/9953180 alliedunit [31] +----------------------------------------------- + 0.00 0.00 6/6 magic [157] +[968] 0.0 0.00 0.00 6 sp_mallornhain [968] + 0.00 0.00 6/28 report_effect [861] + 0.00 0.00 12/967784 msg_message [132] + 0.00 0.00 6/201744 lovar [644] + 0.00 0.00 6/10053919 rtrees [302] + 0.00 0.00 12/1009028 msg_release [1373] + 0.00 0.00 6/608 co_get_region [1594] + 0.00 0.00 6/229715 rsettrees [1410] +----------------------------------------------- + 0.00 0.00 1/3178 res_changeitem [101] + 0.00 0.00 1/3178 make_zombie [1267] + 0.00 0.00 3/3178 drown [394] + 0.00 0.00 4/3178 age_firedragon [1123] + 0.00 0.00 7/3178 age_ghoul [1024] + 0.00 0.00 16/3178 damage_unit [1044] + 0.00 0.00 17/3178 age_zombie [1019] + 0.00 0.00 19/3178 age_skeleton [1008] + 0.00 0.00 27/3178 hunger [808] + 0.00 0.00 41/3178 dissolve_units [241] + 0.00 0.00 425/3178 aftermath [701] + 0.00 0.00 681/3178 absorbed_by_monster [804] + 0.00 0.00 1936/3178 transfermen [899] +[969] 0.0 0.00 0.00 3178 scale_number [969] + 0.00 0.00 3035/51974272 a_find [65] + 0.00 0.00 1279/7641081 genrand_int31 [171] + 0.00 0.00 50953/51060 remove_skill [1456] + 0.00 0.00 3036/603524 set_number [1387] +----------------------------------------------- + 0.00 0.00 52/196 zombie_name [1056] + 0.00 0.00 70/196 skeleton_name [1035] + 0.00 0.00 74/196 ghoul_name [1029] +[970] 0.0 0.00 0.00 196 make_name [970] + 0.00 0.00 407/779486 locale_getstring [266] + 0.00 0.00 588/7641081 genrand_int31 [171] + 0.00 0.00 3/3 count_particles [1089] + 0.00 0.00 76/34611296 strlcpy [45] + 0.00 0.00 542/987128 strlcat [1374] + 0.00 0.00 196/3862 unit_setname [1540] +----------------------------------------------- + 0.00 0.00 2/1201 sp_bloodsacrifice [1209] + 0.00 0.00 1199/1201 res_changeaura [972] +[971] 0.0 0.00 0.00 1201 change_spellpoints [971] + 0.00 0.00 1201/2426021 get_mage [198] +----------------------------------------------- + 0.00 0.00 216/1199 change_resource [240] + 0.00 0.00 983/1199 get_resource [99] +[972] 0.0 0.00 0.00 1199 res_changeaura [972] + 0.00 0.00 1199/1201 change_spellpoints [971] +----------------------------------------------- + 0.00 0.00 8/226 do_combatmagic [825] + 0.00 0.00 23/226 do_combatspell [702] + 0.00 0.00 195/226 magic [157] +[973] 0.0 0.00 0.00 226 fumble [973] + 0.00 0.00 226/12320804 effskill [100] + 0.00 0.00 226/2426021 get_mage [198] + 0.00 0.00 452/12246335 ct_find [114] + 0.00 0.00 452/10190660 get_curse [143] + 0.00 0.00 226/4984610 config_get_int [348] + 0.00 0.00 83/7641081 genrand_int31 [171] + 0.00 0.00 452/4201030 curse_active [543] + 0.00 0.00 452/651711 oldcursename [1381] + 0.00 0.00 226/26995 inside_building [1486] + 0.00 0.00 226/26164 building_is_active [1488] +----------------------------------------------- + 0.00 0.00 4/4 magic [157] +[974] 0.0 0.00 0.00 4 sp_goodwinds [974] + 0.00 0.00 4/45 create_curse [800] + 0.00 0.00 13/12265 r_addmessage [779] + 0.00 0.00 4/967784 msg_message [132] + 0.00 0.00 4/12246335 ct_find [114] + 0.00 0.00 4/608 co_get_region [1594] + 0.00 0.00 4/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 4475/4475 build [691] +[975] 0.0 0.00 0.00 4475 matmod [975] + 0.00 0.00 4475/51974272 a_find [65] + 0.00 0.00 505/505 mm_smithy [1203] +----------------------------------------------- + +[976] 0.0 0.00 0.00 tolua_region_get_resource [976] + 0.00 0.00 3355/2032164 rt_find [597] + 0.00 0.00 2772/10053919 rtrees [302] + 0.00 0.00 3355/3355 region_getresource [1058] + 0.00 0.00 6127/7889 special_resources [1526] +----------------------------------------------- + 0.00 0.00 324/324 cb_foreach_i [924] +[977] 0.0 0.00 0.00 324 add_resourcename_cb [977] + 0.00 0.00 648/24887945 locale_string [27] + 0.00 0.00 648/4457785 transliterate [358] + 0.00 0.00 648/13259934 resourcename [233] + 0.00 0.00 324/2124526 locale_index [1354] +----------------------------------------------- + 0.00 0.00 2304/2304 write_triggers [954] +[978] 0.0 0.00 0.00 2304 killunit_write [978] + 0.00 0.00 2304/604861 write_unit_reference [557] +----------------------------------------------- + 0.00 0.00 406/406 readfaction [767] +[979] 0.0 0.00 0.00 406 faction_setorigin [979] + 0.00 0.00 406/760673 addlist [217] +----------------------------------------------- + 0.00 0.00 324/324 cb_foreach_i [924] +[980] 0.0 0.00 0.00 324 add_itemname_cb [980] + 0.00 0.00 628/24887945 locale_string [27] + 0.00 0.00 628/4457785 transliterate [358] + 0.00 0.00 628/13259934 resourcename [233] + 0.00 0.00 324/2124526 locale_index [1354] +----------------------------------------------- + 0.00 0.00 1/1 randomevents [91] +[981] 0.0 0.00 0.00 1 volcano_update [981] + 0.00 0.00 6/6 volcano_outbreak [1023] + 0.00 0.00 648/7641081 genrand_int31 [171] + 0.00 0.00 37/967784 msg_message [132] + 0.00 0.00 37/392959 add_message [434] + 0.00 0.00 85/51974272 a_find [65] + 0.00 0.00 6/6 rrandneighbour [1221] + 0.00 0.00 37/1009028 msg_release [1373] + 0.00 0.00 2/178270 get_terrain [1423] +----------------------------------------------- + 0.00 0.00 7/2977 allocate_resource [752] + 0.00 0.00 9/2977 movement_speed [155] + 0.00 0.00 55/2977 use_bloodpotion [935] + 0.00 0.00 95/2977 build [691] + 0.00 0.00 232/2977 do_potion [941] + 0.00 0.00 1118/2977 study_cmd [105] + 0.00 0.00 1461/2977 get_food [88] +[982] 0.0 0.00 0.00 2977 change_effect [982] + 0.00 0.00 2977/51974272 a_find [65] + 0.00 0.00 105/451774 a_remove [366] + 0.00 0.00 159/779419 a_add [555] + 0.00 0.00 159/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 287/287 readorders [43] +[983] 0.0 0.00 0.00 287 factionorders [983] + 0.00 0.00 287/228907 getid [483] + 0.00 0.00 286/2281756 gettoken [195] + 0.00 0.00 287/4625636 findfaction [259] + 0.00 0.00 4/967784 msg_message [132] + 0.00 0.00 4/392959 add_message [434] + 0.00 0.00 5/5100840 itoa36 [116] + 0.00 0.00 286/286 checkpasswd [1268] + 0.00 0.00 5/49235 log_debug [1245] + 0.00 0.00 4/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 30250/30250 peasants [658] +[984] 0.0 0.00 0.00 30250 peasant_luck_effect [984] + 0.00 0.00 174/147217 normalvariate [376] + 0.00 0.00 58/1336242 rng_injectable_double [396] + 0.00 0.00 58/30308 peasant_growth_factor [928] + 0.00 0.00 58/58 peasant_luck_factor [1277] +----------------------------------------------- + 0.00 0.00 621/621 process [7] +[985] 0.0 0.00 0.00 621 group_cmd [985] + 0.00 0.00 621/54318 getstrtoken [710] + 0.00 0.00 621/735 join_group [1083] + 0.00 0.00 621/1027665 init_order [613] +----------------------------------------------- + 0.00 0.00 105/105 terraform_region [932] +[986] 0.0 0.00 0.00 105 terraform_resources [986] + 0.00 0.00 174/146997 dice_rand [409] + 0.00 0.00 138/752645 chance [495] + 0.00 0.00 58/58 add_resource [1162] + 0.00 0.00 105/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 1/361 tolua_region_tostring [1291] + 0.00 0.00 2/361 sp_igjarjuk [923] + 0.00 0.00 10/361 spawn_dragons [411] + 0.00 0.00 50/361 rsetherbtype [537] + 0.00 0.00 92/361 spawn_undead [629] + 0.00 0.00 206/361 do_battle [64] +[987] 0.0 0.00 0.00 361 regionname [987] + 0.00 0.00 361/515911 write_regionname [280] +----------------------------------------------- + 0.00 0.00 3/3 magic [157] +[988] 0.0 0.00 0.00 3 sp_eternizewall [988] + 0.00 0.00 3/45 create_curse [800] + 0.00 0.00 3/967784 msg_message [132] + 0.00 0.00 5/12265 r_addmessage [779] + 0.00 0.00 3/12246335 ct_find [114] + 0.00 0.00 3/608 co_get_region [1594] + 0.00 0.00 3/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 7/7 do_combatmagic [825] +[989] 0.0 0.00 0.00 7 sp_healing [989] + 0.00 0.00 7/7 fighters [1012] + 0.00 0.00 7/7 scramble_fighters [1116] + 0.00 0.00 14/14 heal_fighters [1158] + 0.00 0.00 7/1486 message_all [834] + 0.00 0.00 7/967784 msg_message [132] + 0.00 0.00 7/7 has_ao_healing [1269] + 0.00 0.00 7/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 16/16 produce [29] +[990] 0.0 0.00 0.00 16 spy_cmd [990] + 0.00 0.00 8/8 spy_message [1038] + 0.00 0.00 96/12320804 effskill [100] + 0.00 0.00 16/282847 getunit [205] + 0.00 0.00 12/1753922 invisible [139] + 0.00 0.00 6/967784 msg_message [132] + 0.00 0.00 8/472418 produceexp [322] + 0.00 0.00 10/392959 add_message [434] + 0.00 0.00 4/41248 msg_feedback [647] + 0.00 0.00 24/752645 chance [495] + 0.00 0.00 16/1027665 init_order [613] + 0.00 0.00 12/192 can_contact [1634] + 0.00 0.00 10/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 35/145 mailunit [921] + 0.00 0.00 110/145 steal_cmd [766] +[991] 0.0 0.00 0.00 145 findunitr [991] + 0.00 0.00 145/1118718 ufindhash [109] +----------------------------------------------- + 0.00 0.00 318/760 resolve_mage [856] + 0.00 0.00 442/760 resolve_familiar [846] +[992] 0.0 0.00 0.00 760 set_familiar [992] + 0.00 0.00 2280/51974272 a_find [65] + 0.00 0.00 760/779419 a_add [555] + 0.00 0.00 760/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 3/3 magic [157] +[993] 0.0 0.00 0.00 3 sp_charmingsong [993] + 0.00 0.00 2/45 create_curse [800] + 0.00 0.00 90/12320804 effskill [100] + 0.00 0.00 3/3 target_resists_magic [1154] + 0.00 0.00 2/967784 msg_message [132] + 0.00 0.00 1/15102 cmistake [718] + 0.00 0.00 1/1 report_failure [1285] + 0.00 0.00 2/392959 add_message [434] + 0.00 0.00 6/11 add_trigger [1260] + 0.00 0.00 2/12246335 ct_find [114] + 0.00 0.00 2/7641081 genrand_int31 [171] + 0.00 0.00 3/3 can_charm [1338] + 0.00 0.00 2/598129 u_setfaction [1111] + 0.00 0.00 2/154110 rule_stealth_anon [1325] + 0.00 0.00 4/5 trigger_killunit [1752] + 0.00 0.00 2/2 trigger_changefaction [1783] + 0.00 0.00 2/5 trigger_timeout [1753] + 0.00 0.00 2/1291427 set_order [1365] + 0.00 0.00 2/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1584/1584 attrib_allocation [914] +[994] 0.0 0.00 0.00 1584 produce_resource [994] + 0.00 0.00 1584/34611296 strlcpy [45] + 0.00 0.00 1584/987128 strlcat [1374] +----------------------------------------------- + 0.00 0.00 249/767 eff_spelllevel [845] + 0.00 0.00 249/767 cancast [833] + 0.00 0.00 269/767 pay_spell [805] +[995] 0.0 0.00 0.00 767 spellcost [995] + 0.00 0.00 767/2831 countspells [903] + 0.00 0.00 767/56052475 get_resourcetype [194] +----------------------------------------------- + 0.00 0.00 183/183 msg_curse [664] +[996] 0.0 0.00 0.00 183 cinfo_magicrunes [996] + 0.00 0.00 174/967784 msg_message [132] +----------------------------------------------- + 0.00 0.00 163/163 msg_curse [664] +[997] 0.0 0.00 0.00 163 cinfo_shipnodrift [997] + 0.00 0.00 163/967784 msg_message [132] +----------------------------------------------- + 0.00 0.00 1522/1522 a_write [299] +[998] 0.0 0.00 0.00 1522 a_write_unit [998] + 0.00 0.00 1522/604861 write_unit_reference [557] +----------------------------------------------- + 0.00 0.00 71/71 give_cmd [102] +[999] 0.0 0.00 0.00 71 disband_men [999] + 0.00 0.00 71/967784 msg_message [132] + 0.00 0.00 71/659 can_give_men [940] + 0.00 0.00 71/1936 transfermen [899] + 0.00 0.00 71/71815034 get_race [12] + 0.00 0.00 71/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 8/225 do_combatmagic [825] + 0.00 0.00 21/225 do_combatspell [702] + 0.00 0.00 196/225 magic [157] +[1000] 0.0 0.00 0.00 225 spellpower [1000] + 0.00 0.00 450/12246335 ct_find [114] + 0.00 0.00 225/5395063 i_get [130] + 0.00 0.00 450/10190660 get_curse [143] + 0.00 0.00 225/4984610 config_get_int [348] + 0.00 0.00 225/2032164 rt_find [597] + 0.00 0.00 450/4201030 curse_active [543] + 0.00 0.00 225/26995 inside_building [1486] + 0.00 0.00 225/26164 building_is_active [1488] +----------------------------------------------- + 0.00 0.00 2723/2723 split_allocations [743] +[1001] 0.0 0.00 0.00 2723 get_allocator [1001] + 0.00 0.00 2723/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 15/15 drifting_ships [490] +[1002] 0.0 0.00 0.00 15 overload [1002] + 0.00 0.00 15/47902 getshipweight [212] +----------------------------------------------- + 0.00 0.00 133/324 travel [81] + 0.00 0.00 191/324 sail [181] +[1003] 0.0 0.00 0.00 324 caught_target [1003] + 0.00 0.00 131/9953180 alliedunit [31] + 0.00 0.00 8/1437425 cansee [22] + 0.00 0.00 324/51974272 a_find [65] + 0.00 0.00 4/967784 msg_message [132] + 0.00 0.00 4/392959 add_message [434] + 0.00 0.00 133/133 present [1643] + 0.00 0.00 4/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 3659/3659 study_cmd [105] +[1004] 0.0 0.00 0.00 3659 ExpensiveMigrants [1004] + 0.00 0.00 3659/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 20/182 create_potion [821] + 0.00 0.00 71/182 manufacture [759] + 0.00 0.00 91/182 build_building [696] +[1005] 0.0 0.00 0.00 182 msg_materials_required [1005] + 0.00 0.00 182/41248 msg_feedback [647] +----------------------------------------------- + 0.00 0.00 957/957 parse_messages [832] +[1006] 0.0 0.00 0.00 957 crt_register [1006] + 0.00 0.00 957/32337529 hashstring [37] + 0.00 0.00 2468/2468 tsf_find [1554] +----------------------------------------------- + 0.00 0.00 957/957 parse_messages [832] +[1007] 0.0 0.00 0.00 957 mt_register [1007] + 0.00 0.00 957/32337529 hashstring [37] + 0.00 0.00 957/957 mt_id [1587] +----------------------------------------------- + 0.00 0.00 1363/1363 age_unit [336] +[1008] 0.0 0.00 0.00 1363 age_skeleton [1008] + 0.00 0.00 725/7641081 genrand_int31 [171] + 0.00 0.00 725/3902878 get_monsters [293] + 0.00 0.00 38/1381157 unit_max_hp [136] + 0.00 0.00 19/71815034 get_race [12] + 0.00 0.00 19/3178 scale_number [969] + 0.00 0.00 19/600145 u_setrace [1389] +----------------------------------------------- + 0.00 0.00 1125/1125 leave [432] +[1009] 0.0 0.00 0.00 1125 leave_building [1009] + 0.00 0.00 92/92 building_update_owner [1010] +----------------------------------------------- + 0.00 0.00 92/92 leave_building [1009] +[1010] 0.0 0.00 0.00 92 building_update_owner [1010] + 0.00 0.00 92/209572 building_owner_ex [253] +----------------------------------------------- + 0.00 0.00 37/37 init_transportation [384] +[1011] 0.0 0.00 0.00 37 transport [1011] + 0.00 0.00 70/282847 getunit [205] + 0.00 0.00 148/55492327 getkeyword [54] + 0.00 0.00 70/1027665 init_order [613] + 0.00 0.00 37/1629412 LongHunger [536] +----------------------------------------------- + 0.00 0.00 7/7 sp_healing [989] +[1012] 0.0 0.00 0.00 7 fighters [1012] + 0.00 0.00 308/1662377 get_unitrow [154] + 0.00 0.00 8/25 allysf [1160] +----------------------------------------------- + 0.00 0.00 1091/1091 loot_items [810] +[1013] 0.0 0.00 0.00 1091 loot_quota [1013] + 0.00 0.00 1062/752645 chance [495] + 0.00 0.00 1062/717218 config_get_flt [714] +----------------------------------------------- + 0.00 0.00 2/2 make_cmd [383] +[1014] 0.0 0.00 0.00 2 create_ship [1014] + 0.00 0.00 2/2887 leave [432] + 0.00 0.00 2/115 build_ship [839] + 0.00 0.00 2/14326 replace_order [526] + 0.00 0.00 2/122 maxbuild [946] + 0.00 0.00 2/2 new_ship [1229] + 0.00 0.00 4/12320804 effskill [100] + 0.00 0.00 2/447808 create_order [341] + 0.00 0.00 2/24887945 locale_string [27] + 0.00 0.00 2/129167539 u_race [89] + 0.00 0.00 2/8506411 besieged [547] + 0.00 0.00 2/27640 u_set_ship [1485] + 0.00 0.00 2/1936876 free_order [1356] +----------------------------------------------- + 0.00 0.00 359/2421 give_men [857] + 0.00 0.00 2062/2421 create_unit [296] +[1015] 0.0 0.00 0.00 2421 set_racename [1015] + 0.00 0.00 2421/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 1/573 config_read [460] + 0.00 0.00 1/573 reports [2] + 0.00 0.00 1/573 writepasswd [1074] + 0.00 0.00 1/573 readgame [60] + 0.00 0.00 1/573 writegame [82] + 0.00 0.00 2/573 writeturn [1253] + 0.00 0.00 2/573 report_summary [614] + 0.00 0.00 2/573 score [23] + 0.00 0.00 3/573 json_include [1283] + 0.00 0.00 559/573 write_reports [3] +[1016] 0.0 0.00 0.00 573 join_path [1016] + 0.00 0.00 1146/34611296 strlcpy [45] +----------------------------------------------- + 0.00 0.00 106/106 a_age [418] +[1017] 0.0 0.00 0.00 106 age_reduceproduction [1017] + 0.00 0.00 100/967784 msg_message [132] + 0.00 0.00 100/392959 add_message [434] + 0.00 0.00 100/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1/307 mail_cmd [844] + 0.00 0.00 306/307 continue_ship [813] +[1018] 0.0 0.00 0.00 307 getship [1018] + 0.00 0.00 307/228907 getid [483] + 0.00 0.00 307/28818 findship [1483] +----------------------------------------------- + 0.00 0.00 688/688 age_unit [336] +[1019] 0.0 0.00 0.00 688 age_zombie [1019] + 0.00 0.00 665/7641081 genrand_int31 [171] + 0.00 0.00 665/3902878 get_monsters [293] + 0.00 0.00 34/1381157 unit_max_hp [136] + 0.00 0.00 17/71815034 get_race [12] + 0.00 0.00 17/3178 scale_number [969] + 0.00 0.00 17/600145 u_setrace [1389] +----------------------------------------------- + 0.00 0.00 133/133 travel [81] +[1020] 0.0 0.00 0.00 133 reroute [1020] + 0.00 0.00 233/113487 next_region [601] +----------------------------------------------- + 0.00 0.00 124/124 age_building [712] +[1021] 0.0 0.00 0.00 124 age_stonecircle [1021] + 0.00 0.00 124/125 r_standard_to_astral [1067] + 0.00 0.00 87/1441945 is_mage [262] + 0.00 0.00 124/987612 get_astralplane [482] + 0.00 0.00 98/752645 chance [495] + 0.00 0.00 15/12320804 effskill [100] + 0.00 0.00 15/12246335 ct_find [114] + 0.00 0.00 97/129167539 u_race [89] + 0.00 0.00 124/56052475 get_resourcetype [194] + 0.00 0.00 15/10190660 get_curse [143] + 0.00 0.00 1/967784 msg_message [132] + 0.00 0.00 1/392959 add_message [434] + 0.00 0.00 1/11241829 i_change [115] + 0.00 0.00 140/26995 inside_building [1486] + 0.00 0.00 1/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 12/12 volcano_outbreak [1023] +[1022] 0.0 0.00 0.00 12 volcano_destruction [1022] + 0.00 0.00 16/16 damage_unit [1044] + 0.00 0.00 13/967784 msg_message [132] + 0.00 0.00 12/1375380 remove_empty_units_in_region [134] + 0.00 0.00 13/392959 add_message [434] + 0.00 0.00 12/7641081 genrand_int31 [171] + 0.00 0.00 12/779419 a_add [555] + 0.00 0.00 12/51974272 a_find [65] + 0.00 0.00 36/229715 rsettrees [1410] + 0.00 0.00 13/1009028 msg_release [1373] + 0.00 0.00 12/12 make_reduceproduction [1722] +----------------------------------------------- + 0.00 0.00 6/6 volcano_update [981] +[1023] 0.0 0.00 0.00 6 volcano_outbreak [1023] + 0.00 0.00 12/12 volcano_destruction [1022] +----------------------------------------------- + 0.00 0.00 708/708 age_unit [336] +[1024] 0.0 0.00 0.00 708 age_ghoul [1024] + 0.00 0.00 653/7641081 genrand_int31 [171] + 0.00 0.00 653/3902878 get_monsters [293] + 0.00 0.00 14/1381157 unit_max_hp [136] + 0.00 0.00 7/71815034 get_race [12] + 0.00 0.00 7/3178 scale_number [969] + 0.00 0.00 7/600145 u_setrace [1389] +----------------------------------------------- + 0.00 0.00 2/2 magic [157] +[1025] 0.0 0.00 0.00 2 sp_summon_familiar [1025] + 0.00 0.00 1/2889 create_unit [296] + 0.00 0.00 1/1380398 nr_render [25] + 0.00 0.00 8/2934859 skillname [122] + 0.00 0.00 1/1 make_familiar [1219] + 0.00 0.00 2/967784 msg_message [132] + 0.00 0.00 15/34611296 strlcpy [45] + 0.00 0.00 1/15102 cmistake [718] + 0.00 0.00 58/21345834 skill_enabled [365] + 0.00 0.00 1/392959 add_message [434] + 0.00 0.00 1/24887945 locale_string [27] + 0.00 0.00 15/36653945 wrptr [178] + 0.00 0.00 2/54351 get_familiar [796] + 0.00 0.00 1/1 select_familiar [1322] + 0.00 0.00 2/608 co_get_region [1594] + 0.00 0.00 2/1009028 msg_release [1373] + 0.00 0.00 1/599650 setstatus [1390] +----------------------------------------------- + 0.00 0.00 279/279 cr_render [196] +[1026] 0.0 0.00 0.00 279 cr_spell [1026] + 0.00 0.00 279/86400 spell_name [646] +----------------------------------------------- + 0.00 0.00 196/196 magic [157] +[1027] 0.0 0.00 0.00 196 verify_targets [1027] + 0.00 0.00 16/16 verify_unit [1028] + 0.00 0.00 4/4 verify_building [1255] + 0.00 0.00 196/608 co_get_region [1594] + 0.00 0.00 22/22 verify_ship [1704] +----------------------------------------------- + 0.00 0.00 16/16 verify_targets [1027] +[1028] 0.0 0.00 0.00 16 verify_unit [1028] + 0.00 0.00 14/1437425 cansee [22] + 0.00 0.00 16/888603 findunit [123] +----------------------------------------------- + 0.00 0.00 74/74 race_namegen [905] +[1029] 0.0 0.00 0.00 74 ghoul_name [1029] + 0.00 0.00 74/196 make_name [970] +----------------------------------------------- + 0.00 0.00 4/338 recruit [650] + 0.00 0.00 103/338 reshow_other [823] + 0.00 0.00 231/338 setstealth_cmd [182] +[1030] 0.0 0.00 0.00 338 findrace [1030] + 0.00 0.00 338/302482 findtoken [501] + 0.00 0.00 338/4558423 get_translations [437] +----------------------------------------------- + 0.00 0.00 3/242 drown [394] + 0.00 0.00 5/242 chaos [848] + 0.00 0.00 234/242 travel_route [147] +[1031] 0.0 0.00 0.00 242 canfly [1031] + 0.00 0.00 242/5395063 i_get [130] + 0.00 0.00 242/1177511 it_find [385] + 0.00 0.00 240/116002 get_movement [750] + 0.00 0.00 242/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 6/6 sp_summonundead [896] +[1032] 0.0 0.00 0.00 6 skill_summoned [1032] + 0.00 0.00 54/2457 set_level [774] + 0.00 0.00 6/1381157 unit_max_hp [136] + 0.00 0.00 6/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 2/6 init_keywords [1099] + 0.00 0.00 2/6 init_skills [1101] + 0.00 0.00 2/6 init_parameters [1100] +[1033] 0.0 0.00 0.00 6 init_translations [1033] + 0.00 0.00 264/24887945 locale_string [27] + 0.00 0.00 264/371 add_translation [1145] + 0.00 0.00 58/58 skill_key [1205] + 0.00 0.00 6/4558423 get_translations [437] + 0.00 0.00 118/118 keyword_key [1647] + 0.00 0.00 88/88 parameter_key [1655] +----------------------------------------------- + 0.00 0.00 1/1 magic [157] +[1034] 0.0 0.00 0.00 1 sp_summonshadowlords [1034] + 0.00 0.00 1/2889 create_unit [296] + 0.00 0.00 2/2457 set_level [774] + 0.00 0.00 1/967784 msg_message [132] + 0.00 0.00 1/392959 add_message [434] + 0.00 0.00 1/71815034 get_race [12] + 0.00 0.00 1/129167539 u_race [89] + 0.00 0.00 1/45891 get_level [934] + 0.00 0.00 1/608 co_get_region [1594] + 0.00 0.00 1/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 70/70 race_namegen [905] +[1035] 0.0 0.00 0.00 70 skeleton_name [1035] + 0.00 0.00 70/196 make_name [970] +----------------------------------------------- + 0.00 0.00 119/119 recruit [650] +[1036] 0.0 0.00 0.00 119 syntax_error [1036] + 0.00 0.00 119/15240 msg_error [744] + 0.00 0.00 119/392959 add_message [434] + 0.00 0.00 119/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 65/65 steal_cmd [766] +[1037] 0.0 0.00 0.00 65 max_skill [1037] + 0.00 0.00 200/12320804 effskill [100] +----------------------------------------------- + 0.00 0.00 8/8 spy_cmd [990] +[1038] 0.0 0.00 0.00 8 spy_message [1038] + 0.00 0.00 48/12320804 eff_skill [334] + 0.00 0.00 22/967784 msg_message [132] + 0.00 0.00 48/2934859 skillname [122] + 0.00 0.00 48/884940 itoa10 [338] + 0.00 0.00 22/392959 add_message [434] + 0.00 0.00 8/4374788 visible_faction [68] + 0.00 0.00 8/598234 report_status [318] + 0.00 0.00 1/2426021 get_mage [198] + 0.00 0.00 22/1009028 msg_release [1373] + 0.00 0.00 1/1 add_seen_faction [1788] +----------------------------------------------- + 0.00 0.00 1610/1610 transfermen [899] +[1039] 0.0 0.00 0.00 1610 transfer_curse [1039] + 0.00 0.00 1610/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 1/1 magic [157] +[1040] 0.0 0.00 0.00 1 sp_generous [1040] + 0.00 0.00 1/45 create_curse [800] + 0.00 0.00 4/1437425 cansee [22] + 0.00 0.00 4/12265 r_addmessage [779] + 0.00 0.00 1/967784 msg_message [132] + 0.00 0.00 2/12246335 ct_find [114] + 0.00 0.00 1/10190660 get_curse [143] + 0.00 0.00 1/4201030 curse_active [543] + 0.00 0.00 1/608 co_get_region [1594] + 0.00 0.00 1/651711 oldcursename [1381] + 0.00 0.00 1/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1573/1573 display_cmd [859] +[1041] 0.0 0.00 0.00 1573 usetprivate [1041] + 0.00 0.00 1573/51974272 a_find [65] + 0.00 0.00 1/451774 a_remove [366] + 0.00 0.00 3/779419 a_add [555] + 0.00 0.00 3/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 121/121 tolua_msg_send_faction [1043] +[1042] 0.0 0.00 0.00 121 msg_send_faction [1042] + 0.00 0.00 121/1009159 msg_create [228] + 0.00 0.00 121/392959 add_message [434] +----------------------------------------------- + +[1043] 0.0 0.00 0.00 tolua_msg_send_faction [1043] + 0.00 0.00 121/121 msg_send_faction [1042] +----------------------------------------------- + 0.00 0.00 16/16 volcano_destruction [1022] +[1044] 0.0 0.00 0.00 16 damage_unit [1044] + 0.00 0.00 60/146997 dice_rand [409] + 0.00 0.00 16/7957 magic_resistance [727] + 0.00 0.00 20/71815034 get_race [12] + 0.00 0.00 16/3178 scale_number [969] + 0.00 0.00 60/60 nb_armor [1273] + 0.00 0.00 4/5395063 i_get [130] + 0.00 0.00 4/2858912 get_effect [225] + 0.00 0.00 36/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 1/1 magic [157] +[1045] 0.0 0.00 0.00 1 sp_enterastral [1045] + 0.00 0.00 12/1437425 cansee [22] + 0.00 0.00 4/967784 msg_message [132] + 0.00 0.00 12/12265 r_addmessage [779] + 0.00 0.00 2/109785 move_unit [421] + 0.00 0.00 2/279395 weight [459] + 0.00 0.00 1/125 r_standard_to_astral [1067] + 0.00 0.00 2/12246335 ct_find [114] + 0.00 0.00 2/10190660 get_curse [143] + 0.00 0.00 2/8898 ucontact [927] + 0.00 0.00 2/797288 can_survive [640] + 0.00 0.00 2/4201030 curse_active [543] + 0.00 0.00 1/3 getplaneid [1337] + 0.00 0.00 4/1009028 msg_release [1373] + 0.00 0.00 2/651711 oldcursename [1381] + 0.00 0.00 1/608 co_get_region [1594] +----------------------------------------------- + 0.00 0.00 195/195 enter_ship [733] +[1046] 0.0 0.00 0.00 195 mayboard [1046] + 0.00 0.00 112/9953180 alliedunit [31] + 0.00 0.00 186/8898 ucontact [927] + 0.00 0.00 195/3358315 ship_owner [438] +----------------------------------------------- + 0.00 0.00 3659/3659 study_cmd [105] +[1047] 0.0 0.00 0.00 3659 is_migrant [1047] + 0.00 0.00 4069/129167539 u_race [89] + 0.00 0.00 260/793 is_familiar [1092] + 0.00 0.00 150/12560453 rc_changed [256] + 0.00 0.00 1/71815034 get_race [12] +----------------------------------------------- + 0.00 0.00 535/1270 create_unit [296] + 0.00 0.00 735/1270 join_group [1083] +[1048] 0.0 0.00 0.00 1270 set_group [1048] + 0.00 0.00 631/779419 a_add [555] + 0.00 0.00 380/51974272 a_find [65] + 0.00 0.00 23/451774 a_remove [366] + 0.00 0.00 631/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 55/1848 renumber_unit [1159] + 0.00 0.00 1793/1848 remove_unit [499] +[1049] 0.0 0.00 0.00 1848 uunhash [1049] + 0.00 0.00 1848/2903884 jenkins_hash [439] +----------------------------------------------- + 0.00 0.00 769/769 write_triggers [954] +[1050] 0.0 0.00 0.00 769 shock_write [1050] + 0.00 0.00 769/604861 write_unit_reference [557] +----------------------------------------------- + 0.00 0.00 5049/5049 piracy_cmd [660] +[1051] 0.0 0.00 0.00 5049 validate_pirate [1051] + 0.00 0.00 5049/129167539 u_race [89] + 0.00 0.00 6/3358315 ship_owner [438] +----------------------------------------------- + 0.00 0.00 2491/2491 a_read_i [390] +[1052] 0.0 0.00 0.00 2491 a_readeffect [1052] + 0.00 0.00 2491/2032164 rt_find [597] +----------------------------------------------- + 0.00 0.00 15/15 drifting_ships [490] +[1053] 0.0 0.00 0.00 15 drift_target [1053] + 0.00 0.00 79/39810 check_ship_allowed [657] + 0.00 0.00 58/369586 r_connect [474] + 0.00 0.00 15/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.00 39/39 reshow_other [823] +[1054] 0.0 0.00 0.00 39 display_item [1054] + 0.00 0.00 39/967784 msg_message [132] + 0.00 0.00 39/779486 locale_getstring [266] + 0.00 0.00 39/392959 add_message [434] + 0.00 0.00 47/4133717 mkname [261] + 0.00 0.00 8/24887945 locale_string [27] + 0.00 0.00 39/13259934 resourcename [233] + 0.00 0.00 39/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 13/1297 follow_unit [331] + 0.00 0.00 1284/1297 follow_ship [749] +[1055] 0.0 0.00 0.00 1297 hunted_dir [1055] + 0.00 0.00 1297/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 52/52 race_namegen [905] +[1056] 0.0 0.00 0.00 52 zombie_name [1056] + 0.00 0.00 52/196 make_name [970] +----------------------------------------------- + +[1057] 0.0 0.00 0.00 tolua_region_set_resource [1057] + 0.00 0.00 1139/2032164 rt_find [597] + 0.00 0.00 1139/1139 region_setresource [1097] + 0.00 0.00 1762/7889 special_resources [1526] + 0.00 0.00 623/229715 rsettrees [1410] +----------------------------------------------- + 0.00 0.00 3355/3355 tolua_region_get_resource [976] +[1058] 0.0 0.00 0.00 3355 region_getresource [1058] + 0.00 0.00 6714/56052475 get_resourcetype [194] + 0.00 0.00 45/2605004 rpeasants [435] + 0.00 0.00 41/4666665 rmoney [452] + 0.00 0.00 3269/1160345 rhorses [1369] +----------------------------------------------- + 0.00 0.00 2/11 make_wormhole [1150] + 0.00 0.00 9/11 build_building [696] +[1059] 0.0 0.00 0.00 11 new_building [1059] + 0.00 0.00 11/10232 update_lighthouse [605] + 0.00 0.00 11/24887945 locale_string [27] + 0.00 0.00 11/5100840 itoa36 [116] + 0.00 0.00 3/218425 buildingtype [414] + 0.00 0.00 11/13 newcontainerid [1263] + 0.00 0.00 11/5461936 slprintf [548] + 0.00 0.00 11/46196 bhash [1464] +----------------------------------------------- + 0.00 0.00 47/47 reduce_weight [404] +[1060] 0.0 0.00 0.00 47 give_peasants [1060] + 0.00 0.00 47/1481407 parse_order [117] + 0.00 0.00 94/24887945 locale_string [27] + 0.00 0.00 47/5461936 slprintf [548] + 0.00 0.00 47/2009097 keyword [1355] + 0.00 0.00 47/48 unit_addorder [1684] +----------------------------------------------- + 0.00 0.00 5/569 datapath [1289] + 0.00 0.00 564/569 reportpath [1063] +[1061] 0.0 0.00 0.00 569 relpath [1061] + 0.00 0.00 569/34611296 strlcpy [45] +----------------------------------------------- + 0.00 0.00 8/8 magic [157] +[1062] 0.0 0.00 0.00 8 do_fumble [1062] + 0.00 0.00 1/10 sp_hain [931] + 0.00 0.00 15/967784 msg_message [132] + 0.00 0.00 15/392959 add_message [434] + 0.00 0.00 10/7641081 genrand_int31 [171] + 0.00 0.00 3/1873 set_spellpoints [933] + 0.00 0.00 1/1 fumble_default [1284] + 0.00 0.00 2/71815034 get_race [12] + 0.00 0.00 2/2831 countspells [903] + 0.00 0.00 2/3 trigger_changerace [1297] + 0.00 0.00 2/752645 chance [495] + 0.00 0.00 2/11 add_trigger [1260] + 0.00 0.00 2/129167539 u_race [89] + 0.00 0.00 1/2032164 rt_find [597] + 0.00 0.00 15/1009028 msg_release [1373] + 0.00 0.00 8/608 co_get_region [1594] + 0.00 0.00 2/5 trigger_timeout [1753] + 0.00 0.00 2/600145 u_setrace [1389] + 0.00 0.00 2/121 lua_callspell [1645] + 0.00 0.00 1/1 trigger_giveitem [1891] + 0.00 0.00 1/1 t_add [1865] +----------------------------------------------- + 0.00 0.00 1/564 load_inifile [1293] + 0.00 0.00 1/564 parse_inifile [1317] + 0.00 0.00 1/564 reports [2] + 0.00 0.00 2/564 create_directories [1294] + 0.00 0.00 559/564 write_reports [3] +[1063] 0.0 0.00 0.00 564 reportpath [1063] + 0.00 0.00 564/569 relpath [1061] +----------------------------------------------- + 0.00 0.00 1/1 magic [157] +[1064] 0.0 0.00 0.00 1 sp_flying_ship [1064] + 0.00 0.00 1/1 levitate_ship [1071] + 0.00 0.00 5/392959 add_message [434] + 0.00 0.00 1/967784 msg_message [132] + 0.00 0.00 1/608 co_get_region [1594] + 0.00 0.00 1/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 39/39 plan_dragon [273] +[1065] 0.0 0.00 0.00 39 random_growl [1065] + 0.00 0.00 39/967784 msg_message [132] + 0.00 0.00 39/1552289 rname [200] + 0.00 0.00 39/392959 add_message [434] + 0.00 0.00 39/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 83/303 create_castorder_combat [1137] + 0.00 0.00 220/303 cast_cmd [760] +[1066] 0.0 0.00 0.00 303 create_castorder [1066] + 0.00 0.00 303/635885 copy_order [441] + 0.00 0.00 303/499 MagicPower [1195] +----------------------------------------------- + 0.00 0.00 1/125 sp_enterastral [1045] + 0.00 0.00 124/125 age_stonecircle [1021] +[1067] 0.0 0.00 0.00 125 r_standard_to_astral [1067] + 0.00 0.00 125/125 tpregion [1085] + 0.00 0.00 125/987488 is_astral [479] +----------------------------------------------- + 0.00 0.00 1/1 magic [157] +[1068] 0.0 0.00 0.00 1 sp_holyground [1068] + 0.00 0.00 1/45 create_curse [800] + 0.00 0.00 1/967784 msg_message [132] + 0.00 0.00 1/1 report_spell [1301] + 0.00 0.00 1/12246335 ct_find [114] + 0.00 0.00 1/178429 a_removeall [958] + 0.00 0.00 1/608 co_get_region [1594] + 0.00 0.00 1/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1/48 tolua_unit_addnotice [1256] + 0.00 0.00 47/48 display_race [963] +[1069] 0.0 0.00 0.00 48 addmessage [1069] + 0.00 0.00 48/48 caddmessage [1070] +----------------------------------------------- + 0.00 0.00 48/48 addmessage [1069] +[1070] 0.0 0.00 0.00 48 caddmessage [1070] + 0.00 0.00 48/967784 msg_message [132] + 0.00 0.00 47/392959 add_message [434] + 0.00 0.00 1/12265 r_addmessage [779] + 0.00 0.00 48/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1/1 sp_flying_ship [1064] +[1071] 0.0 0.00 0.00 1 levitate_ship [1071] + 0.00 0.00 1/1 shipcurse_flyingship [1072] +----------------------------------------------- + 0.00 0.00 1/1 levitate_ship [1071] +[1072] 0.0 0.00 0.00 1 shipcurse_flyingship [1072] + 0.00 0.00 1/45 create_curse [800] + 0.00 0.00 2/12246335 ct_find [114] + 0.00 0.00 2/10190660 get_curse [143] + 0.00 0.00 2/4201030 curse_active [543] + 0.00 0.00 1/651711 oldcursename [1381] +----------------------------------------------- + 0.00 0.00 2096/2096 a_write [299] +[1073] 0.0 0.00 0.00 2096 a_writeeffect [1073] + 0.00 0.00 2096/13259934 resourcename [233] +----------------------------------------------- + 0.00 0.00 1/1 tolua_write_passwords [1075] +[1074] 0.0 0.00 0.00 1 writepasswd [1074] + 0.00 0.00 232/5100840 itoa36 [116] + 0.00 0.00 1/573 join_path [1016] + 0.00 0.00 1/64 log_info [1339] + 0.00 0.00 1/9 basepath [1730] +----------------------------------------------- + +[1075] 0.0 0.00 0.00 tolua_write_passwords [1075] + 0.00 0.00 1/1 writepasswd [1074] +----------------------------------------------- + 0.00 0.00 124/124 parse_symbol [42] +[1076] 0.0 0.00 0.00 124 eval_unit_dative [1076] + 0.00 0.00 122/2383101 unitname [142] + 0.00 0.00 124/13102790 opstack_pop [176] + 0.00 0.00 124/13102790 opstack_push [202] + 0.00 0.00 124/13399069 balloc [363] + 0.00 0.00 2/24887945 locale_string [27] +----------------------------------------------- + 0.00 0.00 9312/21517 spawn_undead [629] + 0.00 0.00 12205/21517 spawn_dragons [411] +[1077] 0.0 0.00 0.00 21517 chaosfactor [1077] + 0.00 0.00 981/179235 get_chaoscount [717] +----------------------------------------------- + 0.00 0.00 3/404 use_healingpotion [1119] + 0.00 0.00 56/404 use_bloodpotion [935] + 0.00 0.00 345/404 end_potion [814] +[1078] 0.0 0.00 0.00 404 usetpotionuse [1078] + 0.00 0.00 389/779419 a_add [555] + 0.00 0.00 404/51974272 a_find [65] + 0.00 0.00 389/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 4782/4782 expandrecruit [349] +[1079] 0.0 0.00 0.00 4782 select_recruitment [1079] + 0.00 0.00 3340/129167539 u_race [89] + 0.00 0.00 1670/1670 any_recruiters [1566] + 0.00 0.00 1670/1670 horse_recruiters [1567] +----------------------------------------------- + 0.00 0.00 127/127 tolua_msg_create [1081] +[1080] 0.0 0.00 0.00 127 msg_create_message [1080] + 0.00 0.00 127/1010116 mt_find [227] +----------------------------------------------- + +[1081] 0.0 0.00 0.00 tolua_msg_create [1081] + 0.00 0.00 127/127 msg_create_message [1080] +----------------------------------------------- + 0.00 0.00 9/9 move_icebergs [534] +[1082] 0.0 0.00 0.00 9 melt_iceberg [1082] + 0.00 0.00 9/105 terraform_region [932] + 0.00 0.00 9/178263 drown [394] + 0.00 0.00 8/451774 a_remove [366] + 0.00 0.00 3/967784 msg_message [132] + 0.00 0.00 3/392959 add_message [434] + 0.00 0.00 9/51974272 a_find [65] + 0.00 0.00 9/1511812 newterrain [1359] + 0.00 0.00 3/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 114/735 u_setfaction [1111] + 0.00 0.00 621/735 group_cmd [985] +[1083] 0.0 0.00 0.00 735 join_group [1083] + 0.00 0.00 735/1270 set_group [1048] + 0.00 0.00 453/453 find_groupbyname [1217] + 0.00 0.00 3/1697 new_group [1565] + 0.00 0.00 3/3 init_group [1764] +----------------------------------------------- + 0.00 0.00 48/48 terraform_region [932] +[1084] 0.0 0.00 0.00 48 makename [1084] + 0.00 0.00 598/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.00 125/125 r_standard_to_astral [1067] +[1085] 0.0 0.00 0.00 125 tpregion [1085] + 0.00 0.00 125/459083 findregion [420] + 0.00 0.00 125/987488 is_astral [479] + 0.00 0.00 250/250 real2tp [1612] +----------------------------------------------- + 0.00 0.00 1/1 read_xml [791] +[1086] 0.0 0.00 0.00 1 parse_resources [1086] + 0.00 0.00 157/157 xml_readitem [1107] + 0.00 0.00 12/39 bt_get_or_create [1114] + 0.00 0.00 159/383 rt_get_or_create [1139] + 0.00 0.00 1/1 init_resources [1228] + 0.00 0.00 7/779419 a_add [555] + 0.00 0.00 2/68430117 rc_find [15] + 0.00 0.00 2/150 rc_get_or_create [1105] + 0.00 0.00 7/51974272 a_find [65] + 0.00 0.00 1/1 init_itemtypes [1307] + 0.00 0.00 318/6576 xml_bvalue [1532] + 0.00 0.00 54/54 it_set_appearance [1679] + 0.00 0.00 19/178 parse_function [1637] + 0.00 0.00 7/7 rmt_create [1741] + 0.00 0.00 7/779868 a_new [1376] + 0.00 0.00 6/501 xml_fvalue [1599] + 0.00 0.00 6/465 get_function [1600] + 0.00 0.00 4/5453 xml_ivalue [1533] +----------------------------------------------- + 0.00 0.00 49/49 plan_dragon [273] +[1087] 0.0 0.00 0.00 49 get_money_for_dragon [1087] + 0.00 0.00 10/160206 monster_attacks [248] + 0.00 0.00 43/447808 create_order [341] + 0.00 0.00 43/752645 chance [495] + 0.00 0.00 59/4666665 rmoney [452] + 0.00 0.00 10/6610983 is_guard [211] + 0.00 0.00 43/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 9/188 travel_route [147] + 0.00 0.00 179/188 check_ship_allowed [657] +[1088] 0.0 0.00 0.00 188 is_freezing [1088] + 0.00 0.00 188/71815034 get_race [12] + 0.00 0.00 188/129167539 u_race [89] + 0.00 0.00 9/12246335 ct_find [114] + 0.00 0.00 9/10190660 get_curse [143] + 0.00 0.00 9/4201030 curse_active [543] + 0.00 0.00 9/651711 oldcursename [1381] +----------------------------------------------- + 0.00 0.00 3/3 make_name [970] +[1089] 0.0 0.00 0.00 3 count_particles [1089] + 0.00 0.00 117/779486 locale_getstring [266] +----------------------------------------------- + 0.00 0.00 1/328 reshow_other [823] + 0.00 0.00 327/328 reshow [822] +[1090] 0.0 0.00 0.00 328 display_potion [1090] + 0.00 0.00 328/779419 a_add [555] + 0.00 0.00 328/51974272 a_find [65] + 0.00 0.00 328/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 75/1583 drain_exp [850] + 0.00 0.00 1508/1583 demon_skillchange [826] +[1091] 0.0 0.00 0.00 1583 reduce_skill [1091] + 0.00 0.00 27/47562 skill_weeks [509] +----------------------------------------------- + 0.00 0.00 4/793 cast_cmd [760] + 0.00 0.00 5/793 count_skill [868] + 0.00 0.00 260/793 is_migrant [1047] + 0.00 0.00 524/793 study_cmd [105] +[1092] 0.0 0.00 0.00 793 is_familiar [1092] + 0.00 0.00 793/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 12/12 economics [78] +[1093] 0.0 0.00 0.00 12 forget_cmd [1093] + 0.00 0.00 12/2457 set_level [774] + 0.00 0.00 12/967784 msg_message [132] + 0.00 0.00 12/392959 add_message [434] + 0.00 0.00 12/2281756 gettoken [195] + 0.00 0.00 12/996009 get_skill [423] + 0.00 0.00 6/12246335 ct_find [114] + 0.00 0.00 12/1027665 init_order [613] + 0.00 0.00 6/10190660 get_curse [143] + 0.00 0.00 6/4201030 curse_active [543] + 0.00 0.00 12/1009028 msg_release [1373] + 0.00 0.00 6/651711 oldcursename [1381] +----------------------------------------------- + 0.00 0.00 7/27 create_icebergs [538] + 0.00 0.00 20/27 move_icebergs [534] +[1094] 0.0 0.00 0.00 27 move_iceberg [1094] + 0.00 0.00 1/6963 move_ship [374] + 0.00 0.00 4/967784 msg_message [132] + 0.00 0.00 37/7641081 genrand_int31 [171] + 0.00 0.00 36/36 runhash [1247] + 0.00 0.00 36/178290 rhash [737] + 0.00 0.00 27/51974272 a_find [65] + 0.00 0.00 4/392959 add_message [434] + 0.00 0.00 13/779419 a_add [555] + 0.00 0.00 1/369586 r_connect [474] + 0.00 0.00 1/3358315 ship_owner [438] + 0.00 0.00 1/717218 config_get_flt [714] + 0.00 0.00 13/13 make_iceberg [1718] + 0.00 0.00 4/1009028 msg_release [1373] + 0.00 0.00 1/160 damage_ship [1641] +----------------------------------------------- + 0.00 0.00 27/27 race_namegen [905] +[1095] 0.0 0.00 0.00 27 dragon_name [1095] + 0.00 0.00 58/779486 locale_getstring [266] + 0.00 0.00 92/7641081 genrand_int31 [171] + 0.00 0.00 18/1552289 rname [200] + 0.00 0.00 22/34611296 strlcpy [45] + 0.00 0.00 52/987128 strlcat [1374] + 0.00 0.00 27/560 oldterrain [1596] + 0.00 0.00 27/3862 unit_setname [1540] +----------------------------------------------- + 0.00 0.00 348/348 use_potion [801] +[1096] 0.0 0.00 0.00 348 begin_potion [1096] + 0.00 0.00 348/348 ugetpotionuse [1133] + 0.00 0.00 348/4984610 config_get_int [348] + 0.00 0.00 3/967784 msg_message [132] + 0.00 0.00 3/392959 add_message [434] + 0.00 0.00 3/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1139/1139 tolua_region_set_resource [1057] +[1097] 0.0 0.00 0.00 1139 region_setresource [1097] + 0.00 0.00 3335/56052475 get_resourcetype [194] + 0.00 0.00 41/2186159 rsetmoney [553] + 0.00 0.00 1098/257693 rsethorses [1408] +----------------------------------------------- + 0.00 0.00 295/295 age_unit [336] +[1098] 0.0 0.00 0.00 295 age_dragon [1098] + 0.00 0.00 295/7641081 genrand_int31 [171] + 0.00 0.00 10/1381157 unit_max_hp [136] + 0.00 0.00 5/71815034 get_race [12] + 0.00 0.00 5/600145 u_setrace [1389] +----------------------------------------------- + 0.00 0.00 2/2 init_locale [948] +[1099] 0.0 0.00 0.00 2 init_keywords [1099] + 0.00 0.00 2/6 init_translations [1033] +----------------------------------------------- + 0.00 0.00 2/2 init_locale [948] +[1100] 0.0 0.00 0.00 2 init_parameters [1100] + 0.00 0.00 2/6 init_translations [1033] +----------------------------------------------- + 0.00 0.00 2/2 init_locale [948] +[1101] 0.0 0.00 0.00 2 init_skills [1101] + 0.00 0.00 2/6 init_translations [1033] +----------------------------------------------- + 0.00 0.00 78/78 parse_symbol [42] +[1102] 0.0 0.00 0.00 78 eval_weight [1102] + 0.00 0.00 78/24887945 locale_string [27] + 0.00 0.00 78/13102790 opstack_pop [176] + 0.00 0.00 78/13102790 opstack_push [202] + 0.00 0.00 78/13399069 balloc [363] +----------------------------------------------- + +[1103] 0.0 0.00 0.00 tolua_unit_add_item [1103] + 0.00 0.00 121/1177511 it_find [385] + 0.00 0.00 121/11241829 i_change [115] +----------------------------------------------- + 0.00 0.00 1/1 read_xml [791] +[1104] 0.0 0.00 0.00 1 parse_races [1104] + 0.00 0.00 146/150 rc_get_or_create [1105] + 0.00 0.00 68/717287 get_param_flt [713] + 0.00 0.00 2798/6576 xml_bvalue [1532] + 0.00 0.00 2706/5453 xml_ivalue [1533] + 0.00 0.00 820/1041 findskill [1586] + 0.00 0.00 340/501 xml_fvalue [1599] + 0.00 0.00 69/178 parse_function [1637] + 0.00 0.00 67/67 parse_ai [1662] + 0.00 0.00 11/11 xml_spell [1727] + 0.00 0.00 3/3 parse_param [1765] +----------------------------------------------- + 0.00 0.00 2/150 xml_readweapon [1266] + 0.00 0.00 2/150 parse_resources [1086] + 0.00 0.00 146/150 parse_races [1104] +[1105] 0.0 0.00 0.00 150 rc_get_or_create [1105] + 0.00 0.00 150/68430271 rc_find_i [16] + 0.00 0.00 68/68 rc_create [1661] +----------------------------------------------- + 0.00 0.00 4/4 mail_cmd [844] +[1106] 0.0 0.00 0.00 4 mailfaction [1106] + 0.00 0.00 4/39 deliverMail [966] + 0.00 0.00 4/4625636 findfaction [259] +----------------------------------------------- + 0.00 0.00 157/157 parse_resources [1086] +[1107] 0.0 0.00 0.00 157 xml_readitem [1107] + 0.00 0.00 157/185 it_get_or_create [1115] + 0.00 0.00 157/191 xml_readconstruction [1183] + 0.00 0.00 23/23 xml_readweapon [1266] + 0.00 0.00 942/6576 xml_bvalue [1532] + 0.00 0.00 471/5453 xml_ivalue [1533] + 0.00 0.00 72/72 default_score [1659] + 0.00 0.00 55/178 parse_function [1637] + 0.00 0.00 15/15 xml_readpotion [1714] + 0.00 0.00 8/8 xml_readarmor [1736] + 0.00 0.00 7/7 xml_readluxury [1745] +----------------------------------------------- + 0.00 0.00 1761/1761 give_item [126] +[1108] 0.0 0.00 0.00 1761 give_horses [1108] + 0.00 0.00 5/860263 use_pooled [39] + 0.00 0.00 5/283711 item2resource [561] + 0.00 0.00 5/1160345 rhorses [1369] + 0.00 0.00 5/257693 rsethorses [1408] +----------------------------------------------- + 0.00 0.00 114/702 give_unit [952] + 0.00 0.00 588/702 give_men [857] +[1109] 0.0 0.00 0.00 702 max_transfers [1109] + 0.00 0.00 702/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 62/62 msg_curse [664] +[1110] 0.0 0.00 0.00 62 cinfo_speed [1110] + 0.00 0.00 28/967784 msg_message [132] +----------------------------------------------- + 0.00 0.00 1/598129 make_zombie [1267] + 0.00 0.00 2/598129 sp_charmingsong [993] + 0.00 0.00 112/598129 give_unit [952] + 0.00 0.00 2889/598129 create_unit [296] + 0.00 0.00 595125/598129 read_unit [74] +[1111] 0.0 0.00 0.00 598129 u_setfaction [1111] + 0.00 0.00 114/1644867 free_orders [306] + 0.00 0.00 114/735 join_group [1083] + 0.00 0.00 114/3383689 update_interval [551] + 0.00 0.00 228/603524 set_number [1387] + 0.00 0.00 114/1291427 set_order [1365] +----------------------------------------------- + 0.00 0.00 199/95593 travel_i [92] + 0.00 0.00 734/95593 leave [432] + 0.00 0.00 94660/95593 travel [81] +[1112] 0.0 0.00 0.00 95593 can_leave [1112] + 0.00 0.00 688/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 23/23 economics [78] +[1113] 0.0 0.00 0.00 23 destroy_cmd [1113] + 0.00 0.00 22/15102 cmistake [718] + 0.00 0.00 38/2281756 gettoken [195] + 0.00 0.00 1/1 destroy_road [1230] + 0.00 0.00 22/1027665 init_order [613] + 0.00 0.00 1/534930 isparam [668] +----------------------------------------------- + 0.00 0.00 12/39 parse_resources [1086] + 0.00 0.00 27/39 parse_buildings [1131] +[1114] 0.0 0.00 0.00 39 bt_get_or_create [1114] + 0.00 0.00 39/560965 bt_find_i [236] + 0.00 0.00 27/27 bt_register [1698] +----------------------------------------------- + 0.00 0.00 1/185 init_resources [1228] + 0.00 0.00 27/185 json_terrain [1189] + 0.00 0.00 157/185 xml_readitem [1107] +[1115] 0.0 0.00 0.00 185 it_get_or_create [1115] + 0.00 0.00 185/1177511 it_find [385] + 0.00 0.00 185/185 it_register [1636] +----------------------------------------------- + 0.00 0.00 7/7 sp_healing [989] +[1116] 0.0 0.00 0.00 7 scramble_fighters [1116] + 0.00 0.00 290/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.00 4/4 mail_cmd [844] +[1117] 0.0 0.00 0.00 4 seefaction [1117] + 0.00 0.00 4/1437425 cansee [22] +----------------------------------------------- + 0.00 0.00 134/134 msg_curse [664] +[1118] 0.0 0.00 0.00 134 cinfo_slave [1118] + 0.00 0.00 24/967784 msg_message [132] +----------------------------------------------- + 0.00 0.00 3/3 use_item [765] +[1119] 0.0 0.00 0.00 3 use_healingpotion [1119] + 0.00 0.00 3/860263 use_pooled [39] + 0.00 0.00 3/967784 msg_message [132] + 0.00 0.00 4/4 heal [1224] + 0.00 0.00 3/392959 add_message [434] + 0.00 0.00 3/404 usetpotionuse [1078] + 0.00 0.00 3/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1/1 read_xml [791] +[1120] 0.0 0.00 0.00 1 parse_spells [1120] + 0.00 0.00 137/34611296 strlcpy [45] + 0.00 0.00 233/2032164 rt_find [597] + 0.00 0.00 1660/6576 xml_bvalue [1532] + 0.00 0.00 731/5453 xml_ivalue [1533] + 0.00 0.00 274/465 get_function [1600] + 0.00 0.00 166/166 create_spell [1639] + 0.00 0.00 29/178 parse_function [1637] +----------------------------------------------- + 0.00 0.00 12/60 kill_troop [532] + 0.00 0.00 48/60 terraform_region [932] +[1121] 0.0 0.00 0.00 60 equip_items [1121] + 0.00 0.00 23/146997 dice_rand [409] + 0.00 0.00 23/822780 i_new [1375] + 0.00 0.00 23/87004 i_add [1442] +----------------------------------------------- + 0.00 0.00 23/48 join_allies [693] + 0.00 0.00 25/48 allysf [1160] +[1122] 0.0 0.00 0.00 48 allysfm [1122] + 0.00 0.00 27/10375491 alliedgroup [34] + 0.00 0.00 14/1205451 alliedfaction [162] +----------------------------------------------- + 0.00 0.00 182/182 age_unit [336] +[1123] 0.0 0.00 0.00 182 age_firedragon [1123] + 0.00 0.00 182/7641081 genrand_int31 [171] + 0.00 0.00 8/1381157 unit_max_hp [136] + 0.00 0.00 4/71815034 get_race [12] + 0.00 0.00 4/3178 scale_number [969] + 0.00 0.00 4/600145 u_setrace [1389] +----------------------------------------------- + 0.00 0.00 1/1 json_config [464] +[1124] 0.0 0.00 0.00 1 json_keywords [1124] + 0.00 0.00 2/2 json_keyword [1127] + 0.00 0.00 2/6 get_or_create_locale [1275] +----------------------------------------------- + 0.00 0.00 206/206 aftermath [701] +[1125] 0.0 0.00 0.00 206 battle_effects [1125] + 0.00 0.00 246/2605004 rpeasants [435] + 0.00 0.00 34/264251 rsetpeasants [545] + 0.00 0.00 34/37974 deathcounts [843] + 0.00 0.00 34/18059 add_chaoscount [1198] + 0.00 0.00 406/406 PopulationDamage [1605] +----------------------------------------------- + 0.00 0.00 34/34 race_namegen [905] +[1126] 0.0 0.00 0.00 34 dracoid_name [1126] + 0.00 0.00 208/7641081 genrand_int31 [171] + 0.00 0.00 34/34611296 strlcpy [45] + 0.00 0.00 109/987128 strlcat [1374] + 0.00 0.00 34/3862 unit_setname [1540] +----------------------------------------------- + 0.00 0.00 2/2 json_keywords [1124] +[1127] 0.0 0.00 0.00 2 json_keyword [1127] + 0.00 0.00 61/3496 locale_setstring [918] + 0.00 0.00 107/107 init_keyword [1179] + 0.00 0.00 61/4133717 mkname [261] + 0.00 0.00 61/65 findkeyword [1665] +----------------------------------------------- + 0.00 0.00 167/167 teach_cmd [272] +[1128] 0.0 0.00 0.00 167 academy_teaching_bonus [1128] + 0.00 0.00 167/892307 learn_skill [471] +----------------------------------------------- + 0.00 0.00 2/2 init_locale [948] +[1129] 0.0 0.00 0.00 2 init_terrains_translation [1129] + 0.00 0.00 36/24887945 locale_string [27] + 0.00 0.00 36/8993 addtoken [811] + 0.00 0.00 2/4558423 get_translations [437] + 0.00 0.00 2/4 terrains [1760] +----------------------------------------------- + 0.00 0.00 2/2 a_age [418] +[1130] 0.0 0.00 0.00 2 wormhole_age [1130] + 0.00 0.00 2/2 remove_building [1153] + 0.00 0.00 3/967784 msg_message [132] + 0.00 0.00 4/392959 add_message [434] + 0.00 0.00 1/109785 move_unit [421] + 0.00 0.00 3/1009028 msg_release [1373] + 0.00 0.00 1/1 has_limited_skills [1808] +----------------------------------------------- + 0.00 0.00 1/1 read_xml [791] +[1131] 0.0 0.00 0.00 1 parse_buildings [1131] + 0.00 0.00 27/39 bt_get_or_create [1114] + 0.00 0.00 27/191 xml_readconstruction [1183] + 0.00 0.00 17/2032164 rt_find [597] + 0.00 0.00 1/1 init_smithy [1312] + 0.00 0.00 250/6576 xml_bvalue [1532] + 0.00 0.00 179/5453 xml_ivalue [1533] + 0.00 0.00 27/501 xml_fvalue [1599] + 0.00 0.00 3/178 parse_function [1637] +----------------------------------------------- + 0.00 0.00 38/38 loot_items [810] +[1132] 0.0 0.00 0.00 38 select_ally [1132] + 0.00 0.00 33/1662377 get_unitrow [154] + 0.00 0.00 38/38 count_allies [1220] + 0.00 0.00 29/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.00 348/348 begin_potion [1096] +[1133] 0.0 0.00 0.00 348 ugetpotionuse [1133] + 0.00 0.00 348/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 5/234 give_men [857] + 0.00 0.00 5/234 transfermen [899] + 0.00 0.00 224/234 leave_ship [540] +[1134] 0.0 0.00 0.00 234 set_leftship [1134] + 0.00 0.00 234/779419 a_add [555] + 0.00 0.00 234/234 make_leftship [1615] +----------------------------------------------- + 0.00 0.00 324/1572 report_computer [9] + 0.00 0.00 324/1572 report_plaintext [4] + 0.00 0.00 924/1572 score [23] +[1135] 0.0 0.00 0.00 1572 write_score [1135] + 0.00 0.00 1572/5461936 slprintf [548] +----------------------------------------------- + 0.00 0.00 224/457 update_spells [381] + 0.00 0.00 233/457 readfaction [767] +[1136] 0.0 0.00 0.00 457 FactionSpells [1136] + 0.00 0.00 457/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 9/83 do_combatmagic [825] + 0.00 0.00 74/83 cast_combatspell [623] +[1137] 0.0 0.00 0.00 83 create_castorder_combat [1137] + 0.00 0.00 83/303 create_castorder [1066] +----------------------------------------------- + 0.00 0.00 102761/102761 give_cmd [102] +[1138] 0.0 0.00 0.00 102761 check_give [1138] + 0.00 0.00 22/41248 msg_feedback [647] + 0.00 0.00 102761/217696 can_give [1335] +----------------------------------------------- + 0.00 0.00 6/383 init_resources [1228] + 0.00 0.00 56/383 json_terrain [1189] + 0.00 0.00 159/383 parse_resources [1086] + 0.00 0.00 162/383 xml_readrequirements [1186] +[1139] 0.0 0.00 0.00 383 rt_get_or_create [1139] + 0.00 0.00 545/2032164 rt_find [597] + 0.00 0.00 162/162 rt_register [1640] +----------------------------------------------- + 0.00 0.00 44/44 ct_checknames [1142] +[1140] 0.0 0.00 0.00 44 curse_name [1140] + 0.00 0.00 44/24887945 locale_string [27] + 0.00 0.00 44/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 1/1 init_reports [399] +[1141] 0.0 0.00 0.00 1 check_messages_exist [1141] + 0.00 0.00 1/1 ct_checknames [1142] +----------------------------------------------- + 0.00 0.00 1/1 check_messages_exist [1141] +[1142] 0.0 0.00 0.00 1 ct_checknames [1142] + 0.00 0.00 44/44 curse_name [1140] +----------------------------------------------- + 0.00 0.00 2/2 init_locale [948] +[1143] 0.0 0.00 0.00 2 init_directions [1143] + 0.00 0.00 26/24887945 locale_string [27] + 0.00 0.00 26/8993 addtoken [811] + 0.00 0.00 2/2 register_special_direction [1259] + 0.00 0.00 2/4558423 get_translations [437] +----------------------------------------------- + 0.00 0.00 176/176 kill_troop [532] +[1144] 0.0 0.00 0.00 176 default_spoil [1144] + 0.00 0.00 176/7641081 genrand_int31 [171] + 0.00 0.00 9/1177511 it_find [385] + 0.00 0.00 9/822780 i_new [1375] + 0.00 0.00 9/87004 i_add [1442] +----------------------------------------------- + 0.00 0.00 107/371 init_keyword [1179] + 0.00 0.00 264/371 init_translations [1033] +[1145] 0.0 0.00 0.00 371 add_translation [1145] + 0.00 0.00 371/4457785 transliterate [358] +----------------------------------------------- + 0.00 0.00 10/10 combatspell_cmd [898] +[1146] 0.0 0.00 0.00 10 set_combatspell [1146] + 0.00 0.00 10/492 u_hasspell [951] + 0.00 0.00 10/482 knowsspell [956] + 0.00 0.00 10/2426021 get_mage [198] +----------------------------------------------- + 0.00 0.00 115/115 contact_cmd [965] +[1147] 0.0 0.00 0.00 115 usetcontact [1147] + 0.00 0.00 114/779419 a_add [555] + 0.00 0.00 115/51974272 a_find [65] + 0.00 0.00 114/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 2/2 breed_cmd [741] +[1148] 0.0 0.00 0.00 2 breedtrees [1148] + 0.00 0.00 1/860263 use_pooled [39] + 0.00 0.00 1/1 planttrees [1206] + 0.00 0.00 1/541982 get_pooled [104] + 0.00 0.00 1/967784 msg_message [132] + 0.00 0.00 2/12320804 effskill [100] + 0.00 0.00 1/472418 produceexp [322] + 0.00 0.00 1/392959 add_message [434] + 0.00 0.00 1/7641081 genrand_int31 [171] + 0.00 0.00 1/10053919 rtrees [302] + 0.00 0.00 2/56052475 get_resourcetype [194] + 0.00 0.00 2/40692 get_gamedate [1466] + 0.00 0.00 1/229715 rsettrees [1410] + 0.00 0.00 1/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1245/1245 leveled_allocation [888] +[1149] 0.0 0.00 0.00 1245 use_default [1149] + 0.00 0.00 170/7641081 genrand_int31 [171] + 0.00 0.00 85/143 update_resource [1237] +----------------------------------------------- + 0.00 0.00 1/1 make_wormholes [1151] +[1150] 0.0 0.00 0.00 1 make_wormhole [1150] + 0.00 0.00 2/11 new_building [1059] + 0.00 0.00 2/967784 msg_message [132] + 0.00 0.00 2/392959 add_message [434] + 0.00 0.00 2/779419 a_add [555] + 0.00 0.00 2/779868 a_new [1376] + 0.00 0.00 2/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1/1 wormholes_update [906] +[1151] 0.0 0.00 0.00 1 make_wormholes [1151] + 0.00 0.00 1/1 make_wormhole [1150] +----------------------------------------------- + 0.00 0.00 1/22 destroy_road [1230] + 0.00 0.00 21/22 build_road [950] +[1152] 0.0 0.00 0.00 22 rsetroad [1152] + 0.00 0.00 22/2225796 get_borders [120] + 0.00 0.00 6/22644 new_border [705] +----------------------------------------------- + 0.00 0.00 2/2 wormhole_age [1130] +[1153] 0.0 0.00 0.00 2 remove_building [1153] + 0.00 0.00 2/10232 update_lighthouse [605] + 0.00 0.00 6/560926 bt_find [237] + 0.00 0.00 2/48457 bfindhash [1461] + 0.00 0.00 2/1342832 handle_event [1363] + 0.00 0.00 2/12 bunhash [1720] +----------------------------------------------- + 0.00 0.00 3/3 sp_charmingsong [993] +[1154] 0.0 0.00 0.00 3 target_resists_magic [1154] + 0.00 0.00 20/12320804 eff_skill [334] + 0.00 0.00 3/7957 magic_resistance [727] + 0.00 0.00 3/12320804 effskill [100] + 0.00 0.00 3/752645 chance [495] +----------------------------------------------- + 0.00 0.00 1/3 tolua_get_nmrs [1208] + 0.00 0.00 2/3 report_summary [614] +[1155] 0.0 0.00 0.00 3 update_nmrs [1155] + 0.00 0.00 52/5100840 itoa36 [116] + 0.00 0.00 3/27 NMRTimeout [1264] + 0.00 0.00 52/49235 log_debug [1245] +----------------------------------------------- + 0.00 0.00 1/1 process [7] +[1156] 0.0 0.00 0.00 1 renumber_factions [1156] + 0.00 0.00 232/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 2/2 init_locale [948] +[1157] 0.0 0.00 0.00 2 init_options_translation [1157] + 0.00 0.00 22/24887945 locale_string [27] + 0.00 0.00 22/8993 addtoken [811] + 0.00 0.00 2/4558423 get_translations [437] +----------------------------------------------- + 0.00 0.00 14/14 sp_healing [989] +[1158] 0.0 0.00 0.00 14 heal_fighters [1158] + 0.00 0.00 802/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 55/55 renumber_cmd [780] +[1159] 0.0 0.00 0.00 55 renumber_unit [1159] + 0.00 0.00 55/779419 a_add [555] + 0.00 0.00 55/285923 ualias [692] + 0.00 0.00 55/598069 uhash [667] + 0.00 0.00 55/1848 uunhash [1049] + 0.00 0.00 55/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 8/25 fighters [1012] + 0.00 0.00 17/25 helping [1177] +[1160] 0.0 0.00 0.00 25 allysf [1160] + 0.00 0.00 25/48 allysfm [1122] +----------------------------------------------- + +[1161] 0.0 0.00 0.00 config_get_locales [1161] + 0.00 0.00 2/11719 locale_name [568] + 0.00 0.00 4/4 nextlocale [1758] +----------------------------------------------- + 0.00 0.00 58/58 terraform_resources [986] +[1162] 0.0 0.00 0.00 58 add_resource [1162] + 0.00 0.00 58/58 terraform_default [1165] + 0.00 0.00 58/143 update_resource [1237] + 0.00 0.00 58/58 rmt_get [1672] +----------------------------------------------- + +[1163] 0.0 0.00 0.00 tolua_unit_setskill [1163] + 0.00 0.00 6/2457 set_level [774] + 0.00 0.00 6/1041 findskill [1586] +----------------------------------------------- + 0.00 0.00 1/1 read_game [62] +[1164] 0.0 0.00 0.00 1 read_planes [1164] + 0.00 0.00 13/760673 addlist [217] + 0.00 0.00 13/840577 read_attribs [388] + 0.00 0.00 13/13 getplanebyid [1717] + 0.00 0.00 13/51239 read_faction_reference [1455] +----------------------------------------------- + 0.00 0.00 58/58 add_resource [1162] +[1165] 0.0 0.00 0.00 58 terraform_default [1165] + 0.00 0.00 116/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.00 10/10 read_triggers [798] +[1166] 0.0 0.00 0.00 10 changefaction_read [1166] + 0.00 0.00 10/9763 read_reference [726] + 0.00 0.00 10/51239 read_faction_reference [1455] + 0.00 0.00 10/34565 ur_add [1472] +----------------------------------------------- + 0.00 0.00 43/43 combatspell_cmd [898] +[1167] 0.0 0.00 0.00 43 unset_combatspell [1167] + 0.00 0.00 43/2426021 get_mage [198] +----------------------------------------------- + 0.00 0.00 2/462 report_summary [614] + 0.00 0.00 230/462 report_computer [9] + 0.00 0.00 230/462 report_plaintext [4] +[1168] 0.0 0.00 0.00 462 game_name [1168] + 0.00 0.00 462/20777534 config_get [224] +----------------------------------------------- + 0.00 0.00 61/61 parse_equipment [1170] +[1169] 0.0 0.00 0.00 61 add_items [1169] + 0.00 0.00 66/1177511 it_find [385] + 0.00 0.00 65/65 equipment_setitem [1664] +----------------------------------------------- + 0.00 0.00 1/1 read_xml [791] +[1170] 0.0 0.00 0.00 1 parse_equipment [1170] + 0.00 0.00 61/61 add_items [1169] + 0.00 0.00 61/73 create_equipment [1658] + 0.00 0.00 61/61 add_callbacks [1666] + 0.00 0.00 61/61 add_spells [1668] + 0.00 0.00 61/61 add_skills [1667] + 0.00 0.00 61/61 add_subsets [1669] +----------------------------------------------- + 0.00 0.00 231/231 remove_idle_players [391] +[1171] 0.0 0.00 0.00 231 RemoveNMRNewbie [1171] + 0.00 0.00 231/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 1/1583 can_charm [1338] + 0.00 0.00 4/1583 study_cmd [105] + 0.00 0.00 1578/1583 build [691] +[1172] 0.0 0.00 0.00 1583 skill_limit [1172] + 0.00 0.00 226/4984610 config_get_int [348] + 0.00 0.00 1583/1583 allied_skilllimit [1330] +----------------------------------------------- + 0.00 0.00 26/26 cast_cmd [760] +[1173] 0.0 0.00 0.00 26 add_spellparameter [1173] + 0.00 0.00 22/22 addparam_ship [1212] + 0.00 0.00 16/16 addparam_unit [1214] + 0.00 0.00 6/6 addparam_building [1261] +----------------------------------------------- + 0.00 0.00 125/125 chaos [848] +[1174] 0.0 0.00 0.00 125 random_unit [1174] + 0.00 0.00 31/71815034 get_race [12] + 0.00 0.00 15/7641081 genrand_int31 [171] + 0.00 0.00 31/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 1/207 init_processor [1310] + 0.00 0.00 206/207 do_battle [64] +[1175] 0.0 0.00 0.00 207 rule_force_leave [1175] + 0.00 0.00 207/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 62/62 do_potion [941] +[1176] 0.0 0.00 0.00 62 potion_luck [1176] + 0.00 0.00 58/779419 a_add [555] + 0.00 0.00 62/51974272 a_find [65] + 0.00 0.00 58/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 432/432 get_tactics [1178] +[1177] 0.0 0.00 0.00 432 helping [1177] + 0.00 0.00 17/25 allysf [1160] +----------------------------------------------- + 0.00 0.00 378/378 battle_attacks [79] +[1178] 0.0 0.00 0.00 378 get_tactics [1178] + 0.00 0.00 432/432 helping [1177] +----------------------------------------------- + 0.00 0.00 107/107 json_keyword [1127] +[1179] 0.0 0.00 0.00 107 init_keyword [1179] + 0.00 0.00 107/371 add_translation [1145] + 0.00 0.00 107/4558423 get_translations [437] +----------------------------------------------- + 0.00 0.00 191/191 enter_ship [733] +[1180] 0.0 0.00 0.00 191 CheckOverload [1180] + 0.00 0.00 191/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 174/174 breed_cmd [741] +[1181] 0.0 0.00 0.00 174 findresourcetype [1181] + 0.00 0.00 174/4457785 transliterate [358] + 0.00 0.00 174/2124526 locale_index [1354] +----------------------------------------------- + 0.00 0.00 54/54 parse_symbol [42] +[1182] 0.0 0.00 0.00 54 eval_add [1182] + 0.00 0.00 108/13102790 opstack_pop [176] + 0.00 0.00 54/13102790 opstack_push [202] +----------------------------------------------- + 0.00 0.00 7/191 parse_ships [1305] + 0.00 0.00 27/191 parse_buildings [1131] + 0.00 0.00 157/191 xml_readitem [1107] +[1183] 0.0 0.00 0.00 191 xml_readconstruction [1183] + 0.00 0.00 84/84 xml_readrequirements [1186] + 0.00 0.00 1/779419 a_add [555] + 0.00 0.00 504/5453 xml_ivalue [1533] + 0.00 0.00 84/1041 findskill [1586] + 0.00 0.00 1/465 get_function [1600] + 0.00 0.00 1/2 make_skillmod [1777] +----------------------------------------------- + 0.00 0.00 1/1 breed_cmd [741] +[1184] 0.0 0.00 0.00 1 plant [1184] + 0.00 0.00 2/541982 get_pooled [104] + 0.00 0.00 1/41248 msg_feedback [647] + 0.00 0.00 1/12320804 effskill [100] + 0.00 0.00 1/392959 add_message [434] + 0.00 0.00 1/56052475 get_resourcetype [194] + 0.00 0.00 1/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 508/508 regeneration [942] +[1185] 0.0 0.00 0.00 508 MagicRegeneration [1185] + 0.00 0.00 508/717218 config_get_flt [714] +----------------------------------------------- + 0.00 0.00 84/84 xml_readconstruction [1183] +[1186] 0.0 0.00 0.00 84 xml_readrequirements [1186] + 0.00 0.00 162/383 rt_get_or_create [1139] + 0.00 0.00 162/5453 xml_ivalue [1533] +----------------------------------------------- + 0.00 0.00 1/3 do_combatmagic [825] + 0.00 0.00 2/3 do_combatspell [702] +[1187] 0.0 0.00 0.00 3 report_failed_spell [1187] + 0.00 0.00 3/1486 message_all [834] + 0.00 0.00 3/967784 msg_message [132] + 0.00 0.00 3/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 6/6 sp_summonundead [896] +[1188] 0.0 0.00 0.00 6 make_undead_unit [1188] + 0.00 0.00 6/2931 name_unit [803] + 0.00 0.00 6/1644867 free_orders [306] +----------------------------------------------- + 0.00 0.00 18/18 json_terrains [1190] +[1189] 0.0 0.00 0.00 18 json_terrain [1189] + 0.00 0.00 27/185 it_get_or_create [1115] + 0.00 0.00 56/383 rt_get_or_create [1139] + 0.00 0.00 29/29 json_terrain_production [1694] + 0.00 0.00 18/18 json_flags [1707] +----------------------------------------------- + 0.00 0.00 1/1 json_config [464] +[1190] 0.0 0.00 0.00 1 json_terrains [1190] + 0.00 0.00 18/18 json_terrain [1189] + 0.00 0.00 18/52 get_or_create_terrain [1680] +----------------------------------------------- + 0.00 0.00 53/53 get_resource [99] +[1191] 0.0 0.00 0.00 53 lua_getresource [1191] + 0.00 0.00 53/34611296 strlcpy [45] + 0.00 0.00 53/987128 strlcat [1374] +----------------------------------------------- + 0.00 0.00 52/52 msg_curse [664] +[1192] 0.0 0.00 0.00 52 cinfo_skillmod [1192] + 0.00 0.00 6/967784 msg_message [132] +----------------------------------------------- + 0.00 0.00 4/955 make_route [289] + 0.00 0.00 951/955 sail [181] +[1193] 0.0 0.00 0.00 955 movement_error [1193] + 0.00 0.00 4/967784 msg_message [132] + 0.00 0.00 4/293362 get_direction [496] + 0.00 0.00 1/41248 msg_feedback [647] +----------------------------------------------- + +[1194] 0.0 0.00 0.00 tolua_unit_get_name [1194] + 0.00 0.00 86/3351853 unit_getname [332] +----------------------------------------------- + 0.00 0.00 196/499 magic [157] + 0.00 0.00 303/499 create_castorder [1066] +[1195] 0.0 0.00 0.00 499 MagicPower [1195] + 0.00 0.00 279/20777534 config_get [224] +----------------------------------------------- + 0.00 0.00 266/266 age_unit [336] +[1196] 0.0 0.00 0.00 266 age_undead [1196] + 0.00 0.00 82/3902878 get_monsters [293] +----------------------------------------------- + +[1197] 0.0 0.00 0.00 tolua_faction_get_locale [1197] + 0.00 0.00 1/11719 locale_name [568] +----------------------------------------------- + 0.00 0.00 34/18059 battle_effects [1125] + 0.00 0.00 18025/18059 chaos_update [514] +[1198] 0.0 0.00 0.00 18059 add_chaoscount [1198] + 0.00 0.00 89/51974272 a_find [65] + 0.00 0.00 6/779419 a_add [555] + 0.00 0.00 6/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 569/569 setstealth_cmd [182] +[1199] 0.0 0.00 0.00 569 u_seteffstealth [1199] + 0.00 0.00 569/21345834 skill_enabled [365] + 0.00 0.00 2/51974272 a_find [65] +----------------------------------------------- + 0.00 0.00 15/15 change_resource [240] +[1200] 0.0 0.00 0.00 15 res_changepeasants [1200] + 0.00 0.00 15/264251 rsetpeasants [545] + 0.00 0.00 30/2605004 rpeasants [435] +----------------------------------------------- + 0.00 0.00 30/30 monster_move [129] +[1201] 0.0 0.00 0.00 30 treeman_neighbour [1201] + 0.00 0.00 30/1087065 get_neighbours [480] + 0.00 0.00 25/7641081 genrand_int31 [171] + 0.00 0.00 533/560 oldterrain [1596] +----------------------------------------------- + 0.00 0.00 6/6 process [7] +[1202] 0.0 0.00 0.00 6 send_cmd [1202] + 0.00 0.00 6/6 findoption [1241] + 0.00 0.00 6/69432 getparam [681] + 0.00 0.00 6/2281756 gettoken [195] + 0.00 0.00 6/1027665 init_order [613] +----------------------------------------------- + 0.00 0.00 505/505 matmod [975] +[1203] 0.0 0.00 0.00 505 mm_smithy [1203] + 0.00 0.00 505/56052475 get_resourcetype [194] +----------------------------------------------- + 0.00 0.00 4/118 give_men [857] + 0.00 0.00 114/118 give_unit [952] +[1204] 0.0 0.00 0.00 118 rule_transfermen [1204] + 0.00 0.00 118/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 58/58 init_translations [1033] +[1205] 0.0 0.00 0.00 58 skill_key [1205] + 0.00 0.00 58/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 1/1 breedtrees [1148] +[1206] 0.0 0.00 0.00 1 planttrees [1206] + 0.00 0.00 1/541982 get_pooled [104] + 0.00 0.00 1/41248 msg_feedback [647] + 0.00 0.00 1/12320804 effskill [100] + 0.00 0.00 1/392959 add_message [434] + 0.00 0.00 1/56052475 get_resourcetype [194] + 0.00 0.00 1/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 1/1 write_game [83] +[1207] 0.0 0.00 0.00 1 write_planes [1207] + 0.00 0.00 13/841675 a_write [299] + 0.00 0.00 1/1248014 listlen [190] +----------------------------------------------- + +[1208] 0.0 0.00 0.00 tolua_get_nmrs [1208] + 0.00 0.00 1/3 update_nmrs [1155] + 0.00 0.00 1/27 NMRTimeout [1264] +----------------------------------------------- + 0.00 0.00 2/2 magic [157] +[1209] 0.0 0.00 0.00 2 sp_bloodsacrifice [1209] + 0.00 0.00 2/967784 msg_message [132] + 0.00 0.00 2/12320804 effskill [100] + 0.00 0.00 2/392959 add_message [434] + 0.00 0.00 2/1201 change_spellpoints [971] + 0.00 0.00 2/201744 lovar [644] + 0.00 0.00 2/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 6/6 tolua_msg_send_region [1211] +[1210] 0.0 0.00 0.00 6 msg_send_region [1210] + 0.00 0.00 6/1009159 msg_create [228] + 0.00 0.00 6/392959 add_message [434] +----------------------------------------------- + +[1211] 0.0 0.00 0.00 tolua_msg_send_region [1211] + 0.00 0.00 6/6 msg_send_region [1210] +----------------------------------------------- + 0.00 0.00 22/22 add_spellparameter [1173] +[1212] 0.0 0.00 0.00 22 addparam_ship [1212] + 0.00 0.00 22/688711 atoi36 [440] +----------------------------------------------- + 0.00 0.00 48/48 chaos [848] +[1213] 0.0 0.00 0.00 48 chaosterrain [1213] + 0.00 0.00 48/7641081 genrand_int31 [171] + 0.00 0.00 2/4 terrains [1760] +----------------------------------------------- + 0.00 0.00 16/16 add_spellparameter [1173] +[1214] 0.0 0.00 0.00 16 addparam_unit [1214] + 0.00 0.00 16/688711 atoi36 [440] + 0.00 0.00 16/534930 isparam [668] +----------------------------------------------- + 0.00 0.00 3/3 read_triggers [798] +[1215] 0.0 0.00 0.00 3 changerace_read [1215] + 0.00 0.00 3/9763 read_reference [726] + 0.00 0.00 6/6 read_race_reference [1278] +----------------------------------------------- + 0.00 0.00 6787/6787 find_groupbyname [1217] +[1216] 0.0 0.00 0.00 6787 unicode_utf8_strcasecmp [1216] + 0.00 0.00 248/46391457 unicode_utf8_to_ucs4 [177] +----------------------------------------------- + 0.00 0.00 453/453 join_group [1083] +[1217] 0.0 0.00 0.00 453 find_groupbyname [1217] + 0.00 0.00 6787/6787 unicode_utf8_strcasecmp [1216] +----------------------------------------------- + +[1218] 0.0 0.00 0.00 tolua_dict_get [1218] + 0.00 0.00 58/51974272 a_find [65] + 0.00 0.00 58/58 dict_name [1671] + 0.00 0.00 58/58 dict_get [1670] +----------------------------------------------- + 0.00 0.00 1/1 sp_summon_familiar [1025] +[1219] 0.0 0.00 0.00 1 make_familiar [1219] + 0.00 0.00 1/1 oldfamiliars [1240] + 0.00 0.00 1/1381157 unit_max_hp [136] + 0.00 0.00 1/1 create_newfamiliar [1288] + 0.00 0.00 2/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 38/38 select_ally [1132] +[1220] 0.0 0.00 0.00 38 count_allies [1220] + 0.00 0.00 38/317239 count_side [666] +----------------------------------------------- + 0.00 0.00 6/6 volcano_update [981] +[1221] 0.0 0.00 0.00 6 rrandneighbour [1221] + 0.00 0.00 8/369586 r_connect [474] + 0.00 0.00 6/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.00 1/3 writeturn [1253] + 0.00 0.00 2/3 report_summary [614] +[1222] 0.0 0.00 0.00 3 gamedate2 [1222] + 0.00 0.00 9/24887945 locale_string [27] + 0.00 0.00 3/40692 get_gamedate [1466] +----------------------------------------------- + 0.00 0.00 88/88 hunger [808] +[1223] 0.0 0.00 0.00 88 hunger_damage [1223] + 0.00 0.00 73/20777534 config_get [224] + 0.00 0.00 88/26776263 get_param [235] +----------------------------------------------- + 0.00 0.00 4/4 use_healingpotion [1119] +[1224] 0.0 0.00 0.00 4 heal [1224] + 0.00 0.00 4/1381157 unit_max_hp [136] +----------------------------------------------- + 0.00 0.00 4/4 name_cmd [835] +[1225] 0.0 0.00 0.00 4 try_rename [1225] + 0.00 0.00 3/593636 building_owner [232] + 0.00 0.00 1/15102 cmistake [718] +----------------------------------------------- + 0.00 0.00 80/80 tolua_msg_set_resource [1227] +[1226] 0.0 0.00 0.00 80 msg_set_resource [1226] + 0.00 0.00 80/2032164 rt_find [597] + 0.00 0.00 80/451 mtype_get_param [1602] +----------------------------------------------- + +[1227] 0.0 0.00 0.00 tolua_msg_set_resource [1227] + 0.00 0.00 80/80 msg_set_resource [1226] +----------------------------------------------- + 0.00 0.00 1/1 parse_resources [1086] +[1228] 0.0 0.00 0.00 1 init_resources [1228] + 0.00 0.00 1/1 init_oldpotions [1235] + 0.00 0.00 6/383 rt_get_or_create [1139] + 0.00 0.00 1/185 it_get_or_create [1115] +----------------------------------------------- + 0.00 0.00 2/2 create_ship [1014] +[1229] 0.0 0.00 0.00 2 new_ship [1229] + 0.00 0.00 2/760673 addlist [217] + 0.00 0.00 2/24887945 locale_string [27] + 0.00 0.00 2/5100840 itoa36 [116] + 0.00 0.00 2/13 newcontainerid [1263] + 0.00 0.00 2/5461936 slprintf [548] + 0.00 0.00 2/19085 shash [1502] +----------------------------------------------- + 0.00 0.00 1/1 destroy_cmd [1113] +[1230] 0.0 0.00 0.00 1 destroy_road [1230] + 0.00 0.00 1/22 rsetroad [1152] + 0.00 0.00 1/143730 rroad [508] + 0.00 0.00 1/12320804 effskill [100] + 0.00 0.00 1/293362 get_direction [496] + 0.00 0.00 1/2281756 gettoken [195] + 0.00 0.00 3/6610983 is_guard [211] +----------------------------------------------- + 0.00 0.00 24/24 cast_cmd [760] +[1231] 0.0 0.00 0.00 24 is_moving_ship [1231] + 0.00 0.00 24/55492327 getkeyword [54] + 0.00 0.00 24/3358315 ship_owner [438] +----------------------------------------------- + 0.00 0.00 10/10 spawn_dragons [411] +[1232] 0.0 0.00 0.00 10 nrand [1232] + 0.00 0.00 27/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.00 1/1 use_item [765] +[1233] 0.0 0.00 0.00 1 use_skillpotion [1233] + 0.00 0.00 1/967784 msg_message [132] + 0.00 0.00 7/892307 learn_skill [471] + 0.00 0.00 1/392959 add_message [434] + 0.00 0.00 1/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 111/111 steal_cmd [766] +[1234] 0.0 0.00 0.00 111 check_steal [1234] + 0.00 0.00 111/129167539 u_race [89] + 0.00 0.00 111/18647447 getplane [596] +----------------------------------------------- + 0.00 0.00 1/1 init_resources [1228] +[1235] 0.0 0.00 0.00 1 init_oldpotions [1235] + 0.00 0.00 15/1177511 it_find [385] +----------------------------------------------- + 0.00 0.00 143/143 update_resource [1237] +[1236] 0.0 0.00 0.00 143 ResourceFactor [1236] + 0.00 0.00 143/717218 config_get_flt [714] +----------------------------------------------- + 0.00 0.00 58/143 add_resource [1162] + 0.00 0.00 85/143 use_default [1149] +[1237] 0.0 0.00 0.00 143 update_resource [1237] + 0.00 0.00 143/143 ResourceFactor [1236] +----------------------------------------------- + 0.00 0.00 2/2 a_read_i [390] +[1238] 0.0 0.00 0.00 2 wormhole_read [1238] + 0.00 0.00 2/9763 read_reference [726] +----------------------------------------------- + 0.00 0.00 8/8 skillmod [214] +[1239] 0.0 0.00 0.00 8 mod_elves_only [1239] + 0.00 0.00 8/71815034 get_race [12] + 0.00 0.00 8/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 1/1 make_familiar [1219] +[1240] 0.0 0.00 0.00 1 oldfamiliars [1240] + 0.00 0.00 1/2375 equip_unit [775] + 0.00 0.00 1/1 create_mage [1315] + 0.00 0.00 1/129167539 u_race [89] + 0.00 0.00 1/2742 get_equipment [1551] +----------------------------------------------- + 0.00 0.00 6/6 send_cmd [1202] +[1241] 0.0 0.00 0.00 6 findoption [1241] + 0.00 0.00 6/302482 findtoken [501] + 0.00 0.00 6/4558423 get_translations [437] +----------------------------------------------- + 0.00 0.00 2/2 process [7] +[1242] 0.0 0.00 0.00 2 claim_cmd [1242] + 0.00 0.00 3/2281756 gettoken [195] + 0.00 0.00 4/11241829 i_change [115] + 0.00 0.00 2/6010308 i_find [127] + 0.00 0.00 2/1027665 init_order [613] + 0.00 0.00 2/191379 finditemtype [735] +----------------------------------------------- + 0.00 0.00 5/49317 log_warning [1342] + 0.00 0.00 13/49317 log_error [1340] + 0.00 0.00 64/49317 log_info [1339] + 0.00 0.00 49235/49317 log_debug [1245] +[1243] 0.0 0.00 0.00 49317 log_write [1243] + 0.00 0.00 18/18 check_dupe [1244] + 0.00 0.00 49331/49331 log_stdio [1459] +----------------------------------------------- + 0.00 0.00 18/18 log_write [1243] +[1244] 0.0 0.00 0.00 18 check_dupe [1244] + 0.00 0.00 15/34611296 strlcpy [45] +----------------------------------------------- + 0.00 0.00 1/49235 parse_config [1292] + 0.00 0.00 1/49235 eressea_run [1346] + 0.00 0.00 1/49235 give_men [857] + 0.00 0.00 1/49235 disable_feature [771] + 0.00 0.00 2/49235 readgame [60] + 0.00 0.00 4/49235 tolua_log_eressea_log_debug00 [1343] + 0.00 0.00 5/49235 factionorders [983] + 0.00 0.00 10/49235 spawn_dragons [411] + 0.00 0.00 50/49235 rsetherbtype [537] + 0.00 0.00 52/49235 update_nmrs [1155] + 0.00 0.00 68/49235 process [7] + 0.00 0.00 92/49235 spawn_undead [629] + 0.00 0.00 176/49235 write_game [83] + 0.00 0.00 182/49235 read_game [62] + 0.00 0.00 206/49235 do_battle [64] + 0.00 0.00 232/49235 write_reports [3] + 0.00 0.00 233/49235 readfaction [767] + 0.00 0.00 6664/49235 findtoken [501] + 0.00 0.00 41255/49235 log_orders [251] +[1245] 0.0 0.00 0.00 49235 log_debug [1245] + 0.00 0.00 49235/49317 log_write [1243] +----------------------------------------------- + +[1246] 0.0 0.00 0.00 tolua_faction_get [1246] + 0.00 0.00 12/13 tolua_toid [1274] + 0.00 0.00 12/4625636 findfaction [259] +----------------------------------------------- + 0.00 0.00 36/36 move_iceberg [1094] +[1247] 0.0 0.00 0.00 36 runhash [1247] + 0.00 0.00 36/2903884 jenkins_hash [439] +----------------------------------------------- + 0.00 0.00 230/230 report_computer [9] +[1248] 0.0 0.00 0.00 230 show_alliances_cr [1248] + 0.00 0.00 230/20836359 f_get_alliance [455] +----------------------------------------------- + 0.00 0.00 1/1 main [541] +[1249] 0.0 0.00 0.00 1 game_init [1249] + 0.00 0.00 1/1 register_spells [1251] + 0.00 0.00 1/1 register_triggers [1855] + 0.00 0.00 1/1 kernel_init [1814] + 0.00 0.00 1/1 register_races [1849] + 0.00 0.00 1/1 register_cr [1838] + 0.00 0.00 1/1 register_nr [1847] + 0.00 0.00 1/1 register_xmas [1859] + 0.00 0.00 1/1 register_resources [1852] + 0.00 0.00 1/1 register_names [1846] + 0.00 0.00 1/1 register_museum [1845] + 0.00 0.00 1/1 register_itemfunctions [1842] + 0.00 0.00 1/1 register_buildings [1837] + 0.00 0.00 1/1 register_itemtypes [1843] + 0.00 0.00 1/1 wormholes_register [1895] + 0.00 0.00 1/1 register_arena [1832] + 0.00 0.00 1/1 register_gmcmd [1841] + 0.00 0.00 1/1 register_attributes [1834] + 0.00 0.00 1/1 register_xmlreader [1860] + 0.00 0.00 1/1 chaos_register [1797] +----------------------------------------------- + 0.00 0.00 1/1 register_spells [1251] +[1250] 0.0 0.00 0.00 1 register_spelldata [1250] + 0.00 0.00 12/34611296 strlcpy [45] + 0.00 0.00 151/240 register_function [1614] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1251] 0.0 0.00 0.00 1 register_spells [1251] + 0.00 0.00 1/1 register_spelldata [1250] + 0.00 0.00 5/240 register_function [1614] + 0.00 0.00 2/55 at_register [1678] + 0.00 0.00 2/44 ct_register [1686] + 0.00 0.00 1/1 register_borders [1835] + 0.00 0.00 1/1 register_shipcurse [1853] + 0.00 0.00 1/1 register_regioncurse [1850] + 0.00 0.00 1/1 register_unitcurse [1856] + 0.00 0.00 1/1 register_flyingship [1840] + 0.00 0.00 1/1 register_magicresistance [1844] + 0.00 0.00 1/1 register_buildingcurse [1836] +----------------------------------------------- + 0.00 0.00 1/1 read_xml [791] +[1252] 0.0 0.00 0.00 1 parse_calendar [1252] + 0.00 0.00 18/4133717 mkname [261] + 0.00 0.00 11/5453 xml_ivalue [1533] +----------------------------------------------- + 0.00 0.00 1/1 report_summary [614] +[1253] 0.0 0.00 0.00 1 writeturn [1253] + 0.00 0.00 1/3 gamedate2 [1222] + 0.00 0.00 2/573 join_path [1016] + 0.00 0.00 2/9 basepath [1730] +----------------------------------------------- + +[1254] 0.0 0.00 0.00 tolua_get_unit [1254] + 0.00 0.00 1/888603 findunit [123] + 0.00 0.00 1/13 tolua_toid [1274] +----------------------------------------------- + 0.00 0.00 4/4 verify_targets [1027] +[1255] 0.0 0.00 0.00 4 verify_building [1255] + 0.00 0.00 1/967784 msg_message [132] + 0.00 0.00 1/392959 add_message [434] + 0.00 0.00 4/48455 findbuilding [1462] + 0.00 0.00 1/1009028 msg_release [1373] +----------------------------------------------- + +[1256] 0.0 0.00 0.00 tolua_unit_addnotice [1256] + 0.00 0.00 1/48 addmessage [1069] +----------------------------------------------- + +[1257] 0.0 0.00 0.00 tolua_faction_tostring [1257] + 0.00 0.00 5/1295787 factionname [247] +----------------------------------------------- + 0.00 0.00 12/12 write_triggers [954] +[1258] 0.0 0.00 0.00 12 changefaction_write [1258] + 0.00 0.00 12/604861 write_unit_reference [557] + 0.00 0.00 12/647569 write_faction_reference [1382] +----------------------------------------------- + 0.00 0.00 2/2 init_directions [1143] +[1259] 0.0 0.00 0.00 2 register_special_direction [1259] + 0.00 0.00 2/24887945 locale_string [27] + 0.00 0.00 2/8993 addtoken [811] + 0.00 0.00 2/4558423 get_translations [437] +----------------------------------------------- + 0.00 0.00 1/11 use_bloodpotion [935] + 0.00 0.00 2/11 do_fumble [1062] + 0.00 0.00 2/11 create_newfamiliar [1288] + 0.00 0.00 6/11 sp_charmingsong [993] +[1260] 0.0 0.00 0.00 11 add_trigger [1260] + 0.00 0.00 11/51974272 a_find [65] + 0.00 0.00 7/779419 a_add [555] + 0.00 0.00 7/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 6/6 add_spellparameter [1173] +[1261] 0.0 0.00 0.00 6 addparam_building [1261] + 0.00 0.00 6/688711 atoi36 [440] +----------------------------------------------- + 0.00 0.00 1/1 read_triggers [798] +[1262] 0.0 0.00 0.00 1 giveitem_read [1262] + 0.00 0.00 1/9763 read_reference [726] + 0.00 0.00 1/1177511 it_find [385] +----------------------------------------------- + 0.00 0.00 2/13 new_ship [1229] + 0.00 0.00 11/13 new_building [1059] +[1263] 0.0 0.00 0.00 13 newcontainerid [1263] + 0.00 0.00 13/7641081 genrand_int31 [171] + 0.00 0.00 16/28818 findship [1483] + 0.00 0.00 16/48455 findbuilding [1462] +----------------------------------------------- + 0.00 0.00 1/27 tolua_get_nmrs [1208] + 0.00 0.00 1/27 remove_idle_players [391] + 0.00 0.00 2/27 report_summary [614] + 0.00 0.00 3/27 update_nmrs [1155] + 0.00 0.00 20/27 nmr_warnings [878] +[1264] 0.0 0.00 0.00 27 NMRTimeout [1264] + 0.00 0.00 27/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 13/13 create_curse [800] +[1265] 0.0 0.00 0.00 13 set_curseingmagician [1265] + 0.00 0.00 13/10190660 get_curse [143] +----------------------------------------------- + 0.00 0.00 23/23 xml_readitem [1107] +[1266] 0.0 0.00 0.00 23 xml_readweapon [1266] + 0.00 0.00 3/68430117 rc_find [15] + 0.00 0.00 2/150 rc_get_or_create [1105] + 0.00 0.00 303/6576 xml_bvalue [1532] + 0.00 0.00 108/5453 xml_ivalue [1533] + 0.00 0.00 23/501 xml_fvalue [1599] + 0.00 0.00 23/1041 findskill [1586] + 0.00 0.00 23/23 new_weapontype [1703] + 0.00 0.00 3/3 racelist_insert [1766] + 0.00 0.00 3/178 parse_function [1637] +----------------------------------------------- + 0.00 0.00 1/1 remove_unit [499] +[1267] 0.0 0.00 0.00 1 make_zombie [1267] + 0.00 0.00 1/1381157 unit_max_hp [136] + 0.00 0.00 1/71815034 get_race [12] + 0.00 0.00 1/3178 scale_number [969] + 0.00 0.00 1/3902878 get_monsters [293] + 0.00 0.00 1/598129 u_setfaction [1111] + 0.00 0.00 1/600145 u_setrace [1389] +----------------------------------------------- + 0.00 0.00 286/286 factionorders [983] +[1268] 0.0 0.00 0.00 286 checkpasswd [1268] + 0.00 0.00 4/1295787 factionname [247] + 0.00 0.00 4/5 log_warning [1342] + 0.00 0.00 286/286 password_verify [1610] +----------------------------------------------- + 0.00 0.00 7/7 sp_healing [989] +[1269] 0.0 0.00 0.00 7 has_ao_healing [1269] + 0.00 0.00 7/1177511 it_find [385] + 0.00 0.00 7/7 i_findc [1737] +----------------------------------------------- + 0.00 0.00 1/1 read_triggers [798] +[1270] 0.0 0.00 0.00 1 caldera_read [1270] + 0.00 0.00 1/9763 read_reference [726] +----------------------------------------------- + 0.00 0.00 1/1 read_triggers [798] +[1271] 0.0 0.00 0.00 1 clonedied_read [1271] + 0.00 0.00 1/9763 read_reference [726] +----------------------------------------------- + 0.00 0.00 1/1 do_battles [63] +[1272] 0.0 0.00 0.00 1 init_rules [1272] + 0.00 0.00 16/4984610 config_get_int [348] + 0.00 0.00 3/12246335 ct_find [114] +----------------------------------------------- + 0.00 0.00 60/60 damage_unit [1044] +[1273] 0.0 0.00 0.00 60 nb_armor [1273] + 0.00 0.00 60/129167539 u_race [89] +----------------------------------------------- + 0.00 0.00 1/13 tolua_get_unit [1254] + 0.00 0.00 12/13 tolua_faction_get [1246] +[1274] 0.0 0.00 0.00 13 tolua_toid [1274] + 0.00 0.00 5/688711 atoi36 [440] +----------------------------------------------- + 0.00 0.00 2/6 json_keywords [1124] + 0.00 0.00 2/6 make_locales [1303] + 0.00 0.00 2/6 init_locales [947] +[1275] 0.0 0.00 0.00 6 get_or_create_locale [1275] + 0.00 0.00 6/32337529 hashstring [37] +----------------------------------------------- + +[1276] 0.0 0.00 0.00 tolua_unit_add_order [1276] + 0.00 0.00 1/1481407 parse_order [117] + 0.00 0.00 1/48 unit_addorder [1684] +----------------------------------------------- + 0.00 0.00 58/58 peasant_luck_effect [984] +[1277] 0.0 0.00 0.00 58 peasant_luck_factor [1277] + 0.00 0.00 58/717218 config_get_flt [714] +----------------------------------------------- + 0.00 0.00 6/6 changerace_read [1215] +[1278] 0.0 0.00 0.00 6 read_race_reference [1278] + 0.00 0.00 4/68430271 rc_find_i [16] +----------------------------------------------- + 0.00 0.00 2/2 border_name [641] +[1279] 0.0 0.00 0.00 2 b_namequestportal [1279] + 0.00 0.00 2/24887945 locale_string [27] + 0.00 0.00 2/4133717 mkname [261] +----------------------------------------------- + 0.00 0.00 38/3002 renumber_cmd [780] + 0.00 0.00 146/3002 createunitid [317] + 0.00 0.00 2818/3002 newunitid [319] +[1280] 0.0 0.00 0.00 3002 forbiddenid [1280] + 0.00 0.00 4/688711 atoi36 [440] +----------------------------------------------- + +[1281] 0.0 0.00 0.00 tolua_getkey [1281] + 0.00 0.00 3/688711 atoi36 [440] + 0.00 0.00 3/178257 key_get [719] +----------------------------------------------- + 0.00 0.00 206/206 start_battle [297] +[1282] 0.0 0.00 0.00 206 make_battle [1282] + 0.00 0.00 206/18647447 getplane [596] +----------------------------------------------- + 1 json_config [464] +[1283] 0.0 0.00 0.00 1 json_include [1283] + 0.00 0.00 3/573 join_path [1016] + 3 json_config [464] +----------------------------------------------- + 0.00 0.00 1/1 do_fumble [1062] +[1284] 0.0 0.00 0.00 1 fumble_default [1284] + 0.00 0.00 1/15102 cmistake [718] +----------------------------------------------- + 0.00 0.00 1/1 sp_charmingsong [993] +[1285] 0.0 0.00 0.00 1 report_failure [1285] + 0.00 0.00 1/15102 cmistake [718] +----------------------------------------------- + 0.00 0.00 12/12 drifting_ships [490] +[1286] 0.0 0.00 0.00 12 msg_to_ship_inmates [1286] + 0.00 0.00 2/392959 add_message [434] + 0.00 0.00 12/1009028 msg_release [1373] +----------------------------------------------- + 0.00 0.00 6/6 write_triggers [954] +[1287] 0.0 0.00 0.00 6 changerace_write [1287] + 0.00 0.00 6/604861 write_unit_reference [557] + 0.00 0.00 12/12 write_race_reference [1723] +----------------------------------------------- + 0.00 0.00 1/1 make_familiar [1219] +[1288] 0.0 0.00 0.00 1 create_newfamiliar [1288] + 0.00 0.00 3/779419 a_add [555] + 0.00 0.00 2/11 add_trigger [1260] + 0.00 0.00 3/51974272 a_find [65] + 0.00 0.00 3/779868 a_new [1376] + 0.00 0.00 1/5 trigger_killunit [1752] + 0.00 0.00 1/1 trigger_shock [1892] +----------------------------------------------- + 0.00 0.00 1/5 load_inifile [1293] + 0.00 0.00 1/5 readgame [60] + 0.00 0.00 1/5 writegame [82] + 0.00 0.00 2/5 create_directories [1294] +[1289] 0.0 0.00 0.00 5 datapath [1289] + 0.00 0.00 5/569 relpath [1061] +----------------------------------------------- + 0.00 0.00 1/1 ally_cmd [877] +[1290] 0.0 0.00 0.00 1 removelist [1290] + 0.00 0.00 1/113845 choplist [565] +----------------------------------------------- + +[1291] 0.0 0.00 0.00 tolua_region_tostring [1291] + 0.00 0.00 1/361 regionname [987] +----------------------------------------------- + 0.00 0.00 1/1 main [541] +[1292] 0.0 0.00 0.00 1 parse_config [1292] + 0.00 0.00 1/1 load_inifile [1293] + 0.00 0.00 1/49235 log_debug [1245] +----------------------------------------------- + 0.00 0.00 1/1 parse_config [1292] +[1293] 0.0 0.00 0.00 1 load_inifile [1293] + 0.00 0.00 1/1 make_locales [1303] + 0.00 0.00 1/5 datapath [1289] + 0.00 0.00 1/564 reportpath [1063] + 0.00 0.00 1/9 basepath [1730] +----------------------------------------------- + 0.00 0.00 1/2 init_reports [399] + 0.00 0.00 1/2 writegame [82] +[1294] 0.0 0.00 0.00 2 create_directories [1294] + 0.00 0.00 2/5 datapath [1289] + 0.00 0.00 2/564 reportpath [1063] +----------------------------------------------- + 0.00 0.00 30/30 drifting_ships [490] +[1295] 0.0 0.00 0.00 30 overload_start [1295] + 0.00 0.00 30/717218 config_get_flt [714] +----------------------------------------------- + +[1296] 0.0 0.00 0.00 tolua_get_region [1296] + 0.00 0.00 1/459083 findregion [420] + 0.00 0.00 1/1206547 findplane [457] + 0.00 0.00 1/3587241 pnormalize [1350] +----------------------------------------------- + 0.00 0.00 1/3 use_bloodpotion [935] + 0.00 0.00 2/3 do_fumble [1062] +[1297] 0.0 0.00 0.00 3 trigger_changerace [1297] + 0.00 0.00 3/2868601 u_irace [257] + 0.00 0.00 3/129167539 u_race [89] + 0.00 0.00 3/3113 t_new [1546] +----------------------------------------------- + 0.00 0.00 206/206 do_battle [64] +[1298] 0.0 0.00 0.00 206 make_heroes [1298] + 0.00 0.00 24/129167539 u_race [89] +----------------------------------------------- + +[1299] 0.0 0.00 0.00 tolua_atoi36 [1299] + 0.00 0.00 2/688711 atoi36 [440] +----------------------------------------------- + +[1300] 0.0 0.00 0.00 tolua_unit_tostring [1300] + 0.00 0.00 1/2383101 unitname [142] +----------------------------------------------- + 0.00 0.00 1/1 sp_holyground [1068] +[1301] 0.0 0.00 0.00 1 report_spell [1301] + 0.00 0.00 1/12265 r_addmessage [779] +----------------------------------------------- + +[1302] 0.0 0.00 0.00 tolua_region_get_next [1302] + 0.00 0.00 1/369586 r_connect [474] +----------------------------------------------- + 0.00 0.00 1/1 load_inifile [1293] +[1303] 0.0 0.00 0.00 1 make_locales [1303] + 0.00 0.00 2/6 get_or_create_locale [1275] +----------------------------------------------- + 0.00 0.00 1/1 movewhere [350] +[1304] 0.0 0.00 0.00 1 get_translation [1304] + 0.00 0.00 1/302482 findtoken [501] + 0.00 0.00 1/4558423 get_translations [437] +----------------------------------------------- + 0.00 0.00 1/1 read_xml [791] +[1305] 0.0 0.00 0.00 1 parse_ships [1305] + 0.00 0.00 7/191 xml_readconstruction [1183] + 0.00 0.00 63/5453 xml_ivalue [1533] + 0.00 0.00 34/52 get_or_create_terrain [1680] + 0.00 0.00 21/6576 xml_bvalue [1532] + 0.00 0.00 14/501 xml_fvalue [1599] + 0.00 0.00 7/7 st_get_or_create [1743] +----------------------------------------------- + +[1306] 0.0 0.00 0.00 tolua_building_tostring [1306] + 0.00 0.00 1/180818 buildingname [621] +----------------------------------------------- + 0.00 0.00 1/1 parse_resources [1086] +[1307] 0.0 0.00 0.00 1 init_itemtypes [1307] + 0.00 0.00 1/1 init_seed [1320] + 0.00 0.00 1/1 init_mallornseed [1319] +----------------------------------------------- + 0.00 0.00 1/1 age_unit [336] +[1308] 0.0 0.00 0.00 1 age_illusion [1308] + 0.00 0.00 1/71815034 get_race [12] +----------------------------------------------- + 0.00 0.00 2/2 write_triggers [954] +[1309] 0.0 0.00 0.00 2 giveitem_write [1309] + 0.00 0.00 2/604861 write_unit_reference [557] +----------------------------------------------- + 0.00 0.00 1/1 processorders [6] +[1310] 0.0 0.00 0.00 1 init_processor [1310] + 0.00 0.00 4/4984610 config_get_int [348] + 0.00 0.00 1/207 rule_force_leave [1175] + 0.00 0.00 29/29 add_proc_order [1692] + 0.00 0.00 13/13 add_proc_global [1716] + 0.00 0.00 8/8 add_proc_region [1733] + 0.00 0.00 6/11194781 keyword_disabled [1348] + 0.00 0.00 3/3 add_proc_unit [1762] + 0.00 0.00 3/3 add_proc_postregion [1761] +----------------------------------------------- + 0.00 0.00 1/1 game_done [542] +[1311] 0.0 0.00 0.00 1 free_locales [1311] + 0.00 0.00 6/4558423 get_translations [437] + 0.00 0.00 12/267 freetokens [1611] +----------------------------------------------- + 0.00 0.00 1/1 parse_buildings [1131] +[1312] 0.0 0.00 0.00 1 init_smithy [1312] + 0.00 0.00 2/779419 a_add [555] + 0.00 0.00 1/2 make_skillmod [1777] + 0.00 0.00 1/1 make_matmod [1821] +----------------------------------------------- + +[1313] 0.0 0.00 0.00 tolua_unit_clear_orders [1313] + 0.00 0.00 1/1644867 free_orders [306] +----------------------------------------------- + 0.00 0.00 1/1 read_attribs [388] +[1314] 0.0 0.00 0.00 1 a_upgradekeys [1314] + 0.00 0.00 1/779419 a_add [555] + 0.00 0.00 1/51974272 a_find [65] + 0.00 0.00 1/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 1/1 oldfamiliars [1240] +[1315] 0.0 0.00 0.00 1 create_mage [1315] + 0.00 0.00 1/779419 a_add [555] + 0.00 0.00 1/51974272 a_find [65] + 0.00 0.00 1/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 1/1 main [541] +[1316] 0.0 0.00 0.00 1 lua_init [1316] + 0.00 0.00 1/1 tolua_bindings_open [1318] + 0.00 0.00 2/2 tolua_unit_open [1782] + 0.00 0.00 1/1 openlibs [1824] + 0.00 0.00 1/1 register_tolua_helpers [1854] + 0.00 0.00 1/2 tolua_eressea_open [1780] + 0.00 0.00 1/1 tolua_sqlite_open [1887] + 0.00 0.00 1/1 tolua_building_open [1867] + 0.00 0.00 1/1 tolua_ship_open [1886] + 0.00 0.00 1/1 tolua_region_open [1884] + 0.00 0.00 1/1 tolua_faction_open [1870] + 0.00 0.00 1/1 tolua_message_open [1875] + 0.00 0.00 1/1 tolua_order_open [1876] + 0.00 0.00 1/1 tolua_gmtool_open [1872] + 0.00 0.00 1/1 tolua_dict_open [1869] + 0.00 0.00 1/1 tolua_storage_open [1888] +----------------------------------------------- + 0.00 0.00 1/1 tolua_bindings_open [1318] +[1317] 0.0 0.00 0.00 1 parse_inifile [1317] + 0.00 0.00 1/564 reportpath [1063] + 0.00 0.00 1/20777534 config_get [224] + 0.00 0.00 1/9 basepath [1730] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1318] 0.0 0.00 0.00 1 tolua_bindings_open [1318] + 0.00 0.00 1/1 parse_inifile [1317] + 0.00 0.00 1/1 tolua_bind_open [1866] +----------------------------------------------- + 0.00 0.00 1/1 init_itemtypes [1307] +[1319] 0.0 0.00 0.00 1 init_mallornseed [1319] + 0.00 0.00 1/779419 a_add [555] + 0.00 0.00 1/2032164 rt_find [597] + 0.00 0.00 1/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 1/1 init_itemtypes [1307] +[1320] 0.0 0.00 0.00 1 init_seed [1320] + 0.00 0.00 1/779419 a_add [555] + 0.00 0.00 1/2032164 rt_find [597] + 0.00 0.00 1/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 1/1 write_triggers [954] +[1321] 0.0 0.00 0.00 1 clonedied_write [1321] + 0.00 0.00 1/604861 write_unit_reference [557] +----------------------------------------------- + 0.00 0.00 1/1 sp_summon_familiar [1025] +[1322] 0.0 0.00 0.00 1 select_familiar [1322] + 0.00 0.00 1/7641081 genrand_int31 [171] +----------------------------------------------- + 0.00 0.00 5/1613387 get_cmp_region_owner [1347] + 0.00 0.00 233/1613387 readfaction [767] + 0.00 0.00 36937/1613387 cr_output_region [10] + 0.00 0.00 127676/1613387 describe [35] + 0.00 0.00 178254/1613387 ageing [185] + 0.00 0.00 356508/1613387 score [23] + 0.00 0.00 913774/1613387 is_guardian_r [186] +[1323] 0.0 0.00 0.00 1613387 rule_region_owners [1323] + 0.00 0.00 2/4984610 config_get_int [348] + 0.00 0.00 1613387/2386892 config_changed [1352] +----------------------------------------------- + 0.00 0.00 1/2 read_game [62] + 0.00 0.00 1/2 write_game [83] +[1324] 0.0 0.00 0.00 2 game_id [1324] + 0.00 0.00 2/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 2/154110 sp_charmingsong [993] + 0.00 0.00 230/154110 setstealth_cmd [182] + 0.00 0.00 153878/154110 read_unit [74] +[1325] 0.0 0.00 0.00 154110 rule_stealth_anon [1325] + 0.00 0.00 2/4984610 config_get_int [348] + 0.00 0.00 154110/2386892 config_changed [1352] +----------------------------------------------- + 0.00 0.00 5/5 chaos [848] +[1326] 0.0 0.00 0.00 5 set_money [1326] + 0.00 0.00 5/56052475 get_resourcetype [194] + 0.00 0.00 5/822780 i_new [1375] + 0.00 0.00 5/87004 i_add [1442] +----------------------------------------------- + 0.00 0.00 82525/508632 expandwork [277] + 0.00 0.00 426107/508632 default_wage [173] +[1327] 0.0 0.00 0.00 508632 rule_blessed_harvest [1327] + 0.00 0.00 1/4984610 config_get_int [348] + 0.00 0.00 508632/2386892 config_changed [1352] +----------------------------------------------- + 0.00 0.00 1803/103079 gift_items [891] + 0.00 0.00 101276/103079 can_give [1335] +[1328] 0.0 0.00 0.00 103079 rule_give [1328] + 0.00 0.00 1/4984610 config_get_int [348] + 0.00 0.00 103079/2386892 config_changed [1352] +----------------------------------------------- + 0.00 0.00 4/3003 steal_cmd [766] + 0.00 0.00 61/3003 build [691] + 0.00 0.00 2938/3003 allocate_resource [752] +[1329] 0.0 0.00 0.00 3003 roqf_factor [1329] + 0.00 0.00 1/4984610 config_get_int [348] + 0.00 0.00 3003/2386892 config_changed [1352] +----------------------------------------------- + 0.00 0.00 1583/1583 skill_limit [1172] +[1330] 0.0 0.00 0.00 1583 allied_skilllimit [1330] + 0.00 0.00 1/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 230/1214 report_computer [9] + 0.00 0.00 230/1214 report_plaintext [4] + 0.00 0.00 754/1214 checkunitnumber [402] +[1331] 0.0 0.00 0.00 1214 rule_faction_limit [1331] + 0.00 0.00 1/4984610 config_get_int [348] + 0.00 0.00 1214/2386892 config_changed [1352] +----------------------------------------------- + 0.00 0.00 754/754 checkunitnumber [402] +[1332] 0.0 0.00 0.00 754 rule_alliance_limit [1332] + 0.00 0.00 1/4984610 config_get_int [348] + 0.00 0.00 754/2386892 config_changed [1352] +----------------------------------------------- + 0.00 0.00 1/1 remove_idle_players [391] +[1333] 0.0 0.00 0.00 1 nmr_death [1333] + 0.00 0.00 1/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 1/1 economics [78] +[1334] 0.0 0.00 0.00 1 recruit_init [1334] + 0.00 0.00 1/4984610 config_get_int [348] +----------------------------------------------- + 0.00 0.00 102761/217696 check_give [1138] + 0.00 0.00 114935/217696 give_cmd [102] +[1335] 0.0 0.00 0.00 217696 can_give [1335] + 0.00 0.00 101276/103079 rule_give [1328] +----------------------------------------------- + 0.00 0.00 1/1 magic [157] +[1336] 0.0 0.00 0.00 1 sp_seduce [1336] + 0.00 0.00 1/129167539 u_race [89] + 0.00 0.00 1/56052475 get_resourcetype [194] +----------------------------------------------- + 0.00 0.00 1/3 sp_enterastral [1045] + 0.00 0.00 2/3 sp_viewreality [784] +[1337] 0.0 0.00 0.00 3 getplaneid [1337] + 0.00 0.00 3/18647447 getplane [596] +----------------------------------------------- + 0.00 0.00 3/3 sp_charmingsong [993] +[1338] 0.0 0.00 0.00 3 can_charm [1338] + 0.00 0.00 1/1583 skill_limit [1172] +----------------------------------------------- + 0.00 0.00 1/64 reports [2] + 0.00 0.00 1/64 immigration [294] + 0.00 0.00 1/64 processorders [6] + 0.00 0.00 1/64 writepasswd [1074] + 0.00 0.00 1/64 disable_feature [771] + 0.00 0.00 2/64 remove_idle_players [391] + 0.00 0.00 2/64 sp_igjarjuk [923] + 0.00 0.00 2/64 readorders [43] + 0.00 0.00 3/64 report_summary [614] + 0.00 0.00 10/64 tolua_log_eressea_log_info00 [1341] + 0.00 0.00 40/64 write_unit [97] +[1339] 0.0 0.00 0.00 64 log_info [1339] + 0.00 0.00 64/49317 log_write [1243] +----------------------------------------------- + 0.00 0.00 1/13 tolua_log_eressea_log_error00 [1344] + 0.00 0.00 12/13 read_game [62] +[1340] 0.0 0.00 0.00 13 log_error [1340] + 0.00 0.00 13/49317 log_write [1243] +----------------------------------------------- + +[1341] 0.0 0.00 0.00 tolua_log_eressea_log_info00 [1341] + 0.00 0.00 10/64 log_info [1339] +----------------------------------------------- + 0.00 0.00 1/5 tolua_log_eressea_log_warning00 [1345] + 0.00 0.00 4/5 checkpasswd [1268] +[1342] 0.0 0.00 0.00 5 log_warning [1342] + 0.00 0.00 5/49317 log_write [1243] +----------------------------------------------- + +[1343] 0.0 0.00 0.00 tolua_log_eressea_log_debug00 [1343] + 0.00 0.00 4/49235 log_debug [1245] +----------------------------------------------- + +[1344] 0.0 0.00 0.00 tolua_log_eressea_log_error00 [1344] + 0.00 0.00 1/13 log_error [1340] +----------------------------------------------- + +[1345] 0.0 0.00 0.00 tolua_log_eressea_log_warning00 [1345] + 0.00 0.00 1/5 log_warning [1342] +----------------------------------------------- + 0.00 0.00 1/1 main [541] +[1346] 0.0 0.00 0.00 1 eressea_run [1346] + 0.00 0.00 1/49235 log_debug [1245] +----------------------------------------------- + 0.00 0.00 5/5 name_cmd [835] +[1347] 0.0 0.00 0.00 5 get_cmp_region_owner [1347] + 0.00 0.00 5/1613387 rule_region_owners [1323] +----------------------------------------------- + 0.00 0.00 1/11194781 defaultorders [249] + 0.00 0.00 6/11194781 init_processor [1310] + 0.00 0.00 29/11194781 add_proc_order [1692] + 0.00 0.00 1207012/11194781 create_order_i [175] + 0.00 0.00 1481322/11194781 get_keyword [274] + 0.00 0.00 8506411/11194781 besieged [547] +[1348] 0.0 0.00 0.00 11194781 keyword_disabled [1348] +----------------------------------------------- + 0.00 0.00 6656973/6656973 parse_string [86] +[1349] 0.0 0.00 0.00 6656973 bfree [1349] +----------------------------------------------- + 0.00 0.00 1/3587241 tolua_get_region [1296] + 0.00 0.00 5/3587241 cast_cmd [760] + 0.00 0.00 493/3587241 report_computer [9] + 0.00 0.00 7499/3587241 cr_regions [840] + 0.00 0.00 8892/3587241 r_astral_to_standard [783] + 0.00 0.00 10477/3587241 report_template [87] + 0.00 0.00 108425/3587241 update_lighthouse [605] + 0.00 0.00 132705/3587241 cr_region [662] + 0.00 0.00 163381/3587241 astralregions [329] + 0.00 0.00 178254/3587241 new_region [275] + 0.00 0.00 211668/3587241 cr_output_region [10] + 0.00 0.00 369586/3587241 r_connect [474] + 0.00 0.00 513251/3587241 write_regionname [280] + 0.00 0.00 932009/3587241 koor_reldirection [562] + 0.00 0.00 950595/3587241 f_regionid [161] +[1350] 0.0 0.00 0.00 3587241 pnormalize [1350] +----------------------------------------------- + 0.00 0.00 692/3166898 research_cmd [886] + 0.00 0.00 20639/3166898 herbsearch [493] + 0.00 0.00 32670/3166898 writeregion [519] + 0.00 0.00 3112897/3166898 growing_herbs [300] +[1351] 0.0 0.00 0.00 3166898 rherbs [1351] +----------------------------------------------- + 0.00 0.00 51/2386892 potion_water_of_life [945] + 0.00 0.00 232/2386892 prepare_report [8] + 0.00 0.00 754/2386892 rule_alliance_limit [1332] + 0.00 0.00 1214/2386892 rule_faction_limit [1331] + 0.00 0.00 2430/2386892 heal_factor [619] + 0.00 0.00 3003/2386892 roqf_factor [1329] + 0.00 0.00 103079/2386892 rule_give [1328] + 0.00 0.00 154110/2386892 rule_stealth_anon [1325] + 0.00 0.00 508632/2386892 rule_blessed_harvest [1327] + 0.00 0.00 1613387/2386892 rule_region_owners [1323] +[1352] 0.0 0.00 0.00 2386892 config_changed [1352] +----------------------------------------------- + 0.00 0.00 23/2379316 new_weapontype [1703] + 0.00 0.00 3531/2379316 make_fighter [424] + 0.00 0.00 2375762/2379316 armedmen [151] +[1353] 0.0 0.00 0.00 2379316 resource2weapon [1353] +----------------------------------------------- + 0.00 0.00 174/2124526 findresourcetype [1181] + 0.00 0.00 324/2124526 add_resourcename_cb [977] + 0.00 0.00 324/2124526 add_itemname_cb [980] + 0.00 0.00 3110/2124526 default_order [902] + 0.00 0.00 191379/2124526 finditemtype [735] + 0.00 0.00 1929215/2124526 create_order_i [175] +[1354] 0.0 0.00 0.00 2124526 locale_index [1354] +----------------------------------------------- + 0.00 0.00 47/2009097 give_peasants [1060] + 0.00 0.00 118/2009097 keyword_key [1647] + 0.00 0.00 136/2009097 make_movement_order [522] + 0.00 0.00 191/2009097 follow_ship [749] + 0.00 0.00 2081/2009097 nr_spell_syntax [732] + 0.00 0.00 2006524/2009097 get_command [108] +[1355] 0.0 0.00 0.00 2009097 keyword [1355] +----------------------------------------------- + 0.00 0.00 2/1936876 create_ship [1014] + 0.00 0.00 8/1936876 do_combatmagic [825] + 0.00 0.00 21/1936876 do_combatspell [702] + 0.00 0.00 99/1936876 piracy_cmd [660] + 0.00 0.00 133/1936876 travel [81] + 0.00 0.00 220/1936876 free_castorder [1609] + 0.00 0.00 262/1936876 defaultorders [249] + 0.00 0.00 310/1936876 remove_exclusive [571] + 0.00 0.00 490/1936876 build_building [696] + 0.00 0.00 514/1936876 do_enter [128] + 0.00 0.00 1670/1936876 free_recruitments [1568] + 0.00 0.00 5384/1936876 teach_cmd [272] + 0.00 0.00 8450/1936876 cycle_route [375] + 0.00 0.00 14326/1936876 replace_order [526] + 0.00 0.00 19315/1936876 expandorders [197] + 0.00 0.00 395426/1936876 unitorders [46] + 0.00 0.00 679696/1936876 set_order [1365] + 0.00 0.00 810550/1936876 free_orders [306] +[1356] 0.0 0.00 0.00 1936876 free_order [1356] + 0.00 0.00 1342381/1342381 release_data [1364] +----------------------------------------------- + 0.00 0.00 1785077/1785077 adjust_coordinates [234] +[1357] 0.0 0.00 0.00 1785077 faction_getorigin [1357] +----------------------------------------------- + 0.00 0.00 44924/1726748 attack [84] + 0.00 0.00 80630/1726748 terminate [242] + 0.00 0.00 1601194/1726748 weapon_effskill [168] +[1358] 0.0 0.00 0.00 1726748 is_riding [1358] +----------------------------------------------- + 0.00 0.00 1/1511812 eaten_by_monster [468] + 0.00 0.00 9/1511812 melt_iceberg [1082] + 0.00 0.00 29/1511812 terraform_region [932] + 0.00 0.00 48/1511812 chaos [848] + 0.00 0.00 105/1511812 bewegung_blockiert_von [631] + 0.00 0.00 114/1511812 build_road [950] + 0.00 0.00 847/1511812 buy [707] + 0.00 0.00 4628/1511812 expandselling [93] + 0.00 0.00 4629/1511812 produce [29] + 0.00 0.00 16651/1511812 sell [498] + 0.00 0.00 64838/1511812 calculate_emigration [603] + 0.00 0.00 139323/1511812 spawn_dragons [411] + 0.00 0.00 178254/1511812 move_icebergs [534] + 0.00 0.00 178261/1511812 create_icebergs [538] + 0.00 0.00 201709/1511812 make_summary [21] + 0.00 0.00 722366/1511812 skill_mod [264] +[1359] 0.0 0.00 0.00 1511812 newterrain [1359] +----------------------------------------------- + 0.00 0.00 1380398/1380398 translate [28] +[1360] 0.0 0.00 0.00 1380398 brelease [1360] +----------------------------------------------- + 0.00 0.00 1380398/1380398 translate [28] +[1361] 0.0 0.00 0.00 1380398 free_variables [1361] +----------------------------------------------- + 0.00 0.00 156/1380007 make_fighter [424] + 0.00 0.00 431/1380007 create_unit [296] + 0.00 0.00 39954/1380007 destroyfaction [392] + 0.00 0.00 151469/1380007 visible_faction [68] + 0.00 0.00 373997/1380007 nr_unit [11] + 0.00 0.00 401604/1380007 bufunit [17] + 0.00 0.00 412396/1380007 cr_output_unit [19] +[1362] 0.0 0.00 0.00 1380007 get_otherfaction [1362] +----------------------------------------------- + 0.00 0.00 1/1342832 destroyfaction [392] + 0.00 0.00 2/1342832 remove_building [1153] + 0.00 0.00 6/1342832 remove_ship [1748] + 0.00 0.00 1794/1342832 remove_unit [499] + 0.00 0.00 46184/1342832 age_building [712] + 0.00 0.00 178254/1342832 age_region [659] + 0.00 0.00 186260/1342832 give_item [126] + 0.00 0.00 315567/1342832 plan_monsters [52] + 0.00 0.00 614764/1342832 ageing [185] +[1363] 0.0 0.00 0.00 1342832 handle_event [1363] + 0.00 0.00 18/18 handle_triggers [1706] +----------------------------------------------- + 0.00 0.00 1342381/1342381 free_order [1356] +[1364] 0.0 0.00 0.00 1342381 release_data [1364] +----------------------------------------------- + 0.00 0.00 2/1291427 sp_charmingsong [993] + 0.00 0.00 3/1291427 cast_cmd [760] + 0.00 0.00 114/1291427 u_setfaction [1111] + 0.00 0.00 163/1291427 movement [47] + 0.00 0.00 703/1291427 follow_unit [331] + 0.00 0.00 2889/1291427 create_unit [296] + 0.00 0.00 6947/1291427 sail [181] + 0.00 0.00 103784/1291427 move_cmd [66] + 0.00 0.00 581697/1291427 update_long_order [270] + 0.00 0.00 595125/1291427 read_unit [74] +[1365] 0.0 0.00 0.00 1291427 set_order [1365] + 0.00 0.00 679696/1936876 free_order [1356] +----------------------------------------------- + 0.00 0.00 1252028/1252028 create_data [252] +[1366] 0.0 0.00 0.00 1252028 mkdata [1366] +----------------------------------------------- + 0.00 0.00 148748/1218663 terminate [242] + 0.00 0.00 363071/1218663 hits [131] + 0.00 0.00 706844/1218663 skilldiff [166] +[1367] 0.0 0.00 0.00 1218663 select_weapon [1367] + 0.00 0.00 516342/754589 preferred_weapon [1377] +----------------------------------------------- + 0.00 0.00 10565/1214628 list_address [635] + 0.00 0.00 453546/1214628 get_addresses [20] + 0.00 0.00 750517/1214628 nr_unit [11] +[1368] 0.0 0.00 0.00 1214628 is_allied [1368] +----------------------------------------------- + 0.00 0.00 5/1160345 give_horses [1108] + 0.00 0.00 5/1160345 gift_items [891] + 0.00 0.00 9/1160345 destroyfaction [392] + 0.00 0.00 3269/1160345 region_getresource [1058] + 0.00 0.00 28760/1160345 migrate [1478] + 0.00 0.00 32670/1160345 writeregion [519] + 0.00 0.00 45630/1160345 cr_output_region [10] + 0.00 0.00 91145/1160345 report_resources [210] + 0.00 0.00 225630/1160345 describe [35] + 0.00 0.00 356508/1160345 make_summary [21] + 0.00 0.00 376714/1160345 horses [330] +[1369] 0.0 0.00 0.00 1160345 rhorses [1369] +----------------------------------------------- + 0.00 0.00 1132609/1132609 update_long_order [270] +[1370] 0.0 0.00 0.00 1132609 is_long [1370] +----------------------------------------------- + 0.00 0.00 1067195/1067195 msg_free [1384] +[1371] 0.0 0.00 0.00 1067195 free_arg [1371] + 0.00 0.00 37202/37202 var_free_string [1470] + 0.00 0.00 209/209 var_free_resources [1628] +----------------------------------------------- + 0.00 0.00 1014205/1014205 add_seen_nb [386] +[1372] 0.0 0.00 0.00 1014205 add_seen [1372] +----------------------------------------------- + 0.00 0.00 1/1009028 sp_holyground [1068] + 0.00 0.00 1/1009028 sp_summonshadowlords [1034] + 0.00 0.00 1/1009028 sp_generous [1040] + 0.00 0.00 1/1009028 plant [1184] + 0.00 0.00 1/1009028 planttrees [1206] + 0.00 0.00 1/1009028 breedtrees [1148] + 0.00 0.00 1/1009028 promotion_cmd [917] + 0.00 0.00 1/1009028 age_stonecircle [1021] + 0.00 0.00 1/1009028 verify_building [1255] + 0.00 0.00 1/1009028 cast_cmd [760] + 0.00 0.00 1/1009028 sp_flying_ship [1064] + 0.00 0.00 1/1009028 use_skillpotion [1233] + 0.00 0.00 2/1009028 travel [81] + 0.00 0.00 2/1009028 sp_summon_familiar [1025] + 0.00 0.00 2/1009028 sp_bloodsacrifice [1209] + 0.00 0.00 2/1009028 sp_charmingsong [993] + 0.00 0.00 2/1009028 sp_viewreality [784] + 0.00 0.00 2/1009028 magic [157] + 0.00 0.00 2/1009028 create_icebergs [538] + 0.00 0.00 2/1009028 make_wormhole [1150] + 0.00 0.00 2/1009028 summon_allies [925] + 0.00 0.00 3/1009028 sp_eternizewall [988] + 0.00 0.00 3/1009028 report_failed_spell [1187] + 0.00 0.00 3/1009028 begin_potion [1096] + 0.00 0.00 3/1009028 give_control_cmd [287] + 0.00 0.00 3/1009028 drown [394] + 0.00 0.00 3/1009028 melt_iceberg [1082] + 0.00 0.00 3/1009028 wormhole_age [1130] + 0.00 0.00 3/1009028 use_healingpotion [1119] + 0.00 0.00 4/1009028 caught_target [1003] + 0.00 0.00 4/1009028 init_transportation [384] + 0.00 0.00 4/1009028 make_route [289] + 0.00 0.00 4/1009028 ship_ready [354] + 0.00 0.00 4/1009028 sp_goodwinds [974] + 0.00 0.00 4/1009028 sp_enterastral [1045] + 0.00 0.00 4/1009028 terminate [242] + 0.00 0.00 4/1009028 quit [276] + 0.00 0.00 4/1009028 move_iceberg [1094] + 0.00 0.00 4/1009028 factionorders [983] + 0.00 0.00 5/1009028 sp_song_of_peace [939] + 0.00 0.00 5/1009028 buy [707] + 0.00 0.00 7/1009028 sp_healing [989] + 0.00 0.00 9/1009028 sp_stormwinds [871] + 0.00 0.00 10/1009028 make_cmd [383] + 0.00 0.00 10/1009028 tax_cmd [697] + 0.00 0.00 10/1009028 spy_cmd [990] + 0.00 0.00 10/1009028 spawn_dragons [411] + 0.00 0.00 12/1009028 msg_to_ship_inmates [1286] + 0.00 0.00 12/1009028 sp_mallornhain [968] + 0.00 0.00 12/1009028 sp_summonundead [896] + 0.00 0.00 12/1009028 forget_cmd [1093] + 0.00 0.00 13/1009028 volcano_destruction [1022] + 0.00 0.00 15/1009028 do_fumble [1062] + 0.00 0.00 18/1009028 sp_hain [931] + 0.00 0.00 18/1009028 do_attack [80] + 0.00 0.00 18/1009028 attack_firesword [785] + 0.00 0.00 19/1009028 enter_building [695] + 0.00 0.00 21/1009028 sp_kampfzauber [957] + 0.00 0.00 22/1009028 spy_message [1038] + 0.00 0.00 24/1009028 nmr_warnings [878] + 0.00 0.00 24/1009028 cancast [833] + 0.00 0.00 26/1009028 sp_blessedharvest [847] + 0.00 0.00 33/1009028 travel_i [92] + 0.00 0.00 37/1009028 volcano_update [981] + 0.00 0.00 37/1009028 build_road [950] + 0.00 0.00 38/1009028 expandstealing [807] + 0.00 0.00 39/1009028 deliverMail [966] + 0.00 0.00 39/1009028 display_item [1054] + 0.00 0.00 39/1009028 random_growl [1065] + 0.00 0.00 41/1009028 dissolve_units [241] + 0.00 0.00 48/1009028 caddmessage [1070] + 0.00 0.00 51/1009028 potion_water_of_life [945] + 0.00 0.00 51/1009028 chaos [848] + 0.00 0.00 53/1009028 sp_dragonodem [627] + 0.00 0.00 55/1009028 start_battle [297] + 0.00 0.00 56/1009028 use_bloodpotion [935] + 0.00 0.00 58/1009028 add_recruits [371] + 0.00 0.00 76/1009028 steal_cmd [766] + 0.00 0.00 84/1009028 do_work [612] + 0.00 0.00 88/1009028 hunger [808] + 0.00 0.00 92/1009028 spawn_undead [629] + 0.00 0.00 100/1009028 age_reduceproduction [1017] + 0.00 0.00 110/1009028 peasants [658] + 0.00 0.00 115/1009028 build_ship [839] + 0.00 0.00 119/1009028 syntax_error [1036] + 0.00 0.00 120/1009028 plagues [781] + 0.00 0.00 149/1009028 create_potion [821] + 0.00 0.00 170/1009028 breedhorses [742] + 0.00 0.00 170/1009028 guard_on_cmd [656] + 0.00 0.00 328/1009028 mail_cmd [844] + 0.00 0.00 345/1009028 end_potion [814] + 0.00 0.00 349/1009028 research_cmd [886] + 0.00 0.00 377/1009028 manufacture [759] + 0.00 0.00 395/1009028 reportcasualties [881] + 0.00 0.00 508/1009028 regenerate_aura [346] + 0.00 0.00 567/1009028 eaten_by_monster [468] + 0.00 0.00 581/1009028 build_building [696] + 0.00 0.00 614/1009028 print_fighters [616] + 0.00 0.00 676/1009028 rp_battles [618] + 0.00 0.00 679/1009028 print_header [838] + 0.00 0.00 681/1009028 absorbed_by_monster [804] + 0.00 0.00 1080/1009028 report_plaintext [4] + 0.00 0.00 1225/1009028 give_item [126] + 0.00 0.00 1323/1009028 teach_cmd [272] + 0.00 0.00 1992/1009028 aftermath [701] + 0.00 0.00 2317/1009028 print_stats [525] + 0.00 0.00 2594/1009028 battle_report [503] + 0.00 0.00 2699/1009028 scared_by_monster [380] + 0.00 0.00 2938/1009028 split_allocations [743] + 0.00 0.00 5049/1009028 piracy_cmd [660] + 0.00 0.00 5810/1009028 report_transfer [724] + 0.00 0.00 5966/1009028 herbsearch [493] + 0.00 0.00 7043/1009028 sail [181] + 0.00 0.00 8710/1009028 maintain_buildings [339] + 0.00 0.00 8797/1009028 cmistake [718] + 0.00 0.00 11358/1009028 expandbuying [49] + 0.00 0.00 12398/1009028 fbattlerecord [688] + 0.00 0.00 12448/1009028 expandselling [93] + 0.00 0.00 12729/1009028 cr_output_curses [69] + 0.00 0.00 14939/1009028 maintain [478] + 0.00 0.00 15186/1009028 nr_curses_i [401] + 0.00 0.00 20258/1009028 study_cmd [105] + 0.00 0.00 29028/1009028 give_cmd [102] + 0.00 0.00 34409/1009028 add_income [625] + 0.00 0.00 80478/1009028 add_give [379] + 0.00 0.00 96460/1009028 travel_route [147] + 0.00 0.00 163573/1009028 describe [35] + 0.00 0.00 192618/1009028 statistics [70] + 0.00 0.00 247009/1009028 prices [85] +[1373] 0.0 0.00 0.00 1009028 msg_release [1373] + 0.00 0.00 633429/633429 msg_free [1384] +----------------------------------------------- + 0.00 0.00 52/987128 dragon_name [1095] + 0.00 0.00 53/987128 lua_getresource [1191] + 0.00 0.00 109/987128 dracoid_name [1126] + 0.00 0.00 116/987128 report_status [318] + 0.00 0.00 542/987128 make_name [970] + 0.00 0.00 886/987128 write_script [853] + 0.00 0.00 1584/987128 produce_resource [994] + 0.00 0.00 3123/987128 limit_resource [943] + 0.00 0.00 3334/987128 add_recruits [371] + 0.00 0.00 4016/987128 default_name [851] + 0.00 0.00 188092/987128 cycle_route [375] + 0.00 0.00 785221/987128 trailinto [207] +[1374] 0.0 0.00 0.00 987128 strlcat [1374] +----------------------------------------------- + 0.00 0.00 5/822780 set_money [1326] + 0.00 0.00 9/822780 default_spoil [1144] + 0.00 0.00 23/822780 equip_items [1121] + 0.00 0.00 60/822780 equip_unit_mask [776] + 0.00 0.00 86907/822780 change_money [337] + 0.00 0.00 735776/822780 i_change [115] +[1375] 0.0 0.00 0.00 822780 i_new [1375] +----------------------------------------------- + 0.00 0.00 1/779868 create_mage [1315] + 0.00 0.00 1/779868 init_seed [1320] + 0.00 0.00 1/779868 init_mallornseed [1319] + 0.00 0.00 1/779868 a_upgradekeys [1314] + 0.00 0.00 1/779868 make_matmod [1821] + 0.00 0.00 2/779868 make_wormhole [1150] + 0.00 0.00 2/779868 summon_allies [925] + 0.00 0.00 2/779868 make_skillmod [1777] + 0.00 0.00 3/779868 create_newfamiliar [1288] + 0.00 0.00 3/779868 usetprivate [1041] + 0.00 0.00 6/779868 add_chaoscount [1198] + 0.00 0.00 7/779868 parse_resources [1086] + 0.00 0.00 7/779868 add_trigger [1260] + 0.00 0.00 12/779868 make_reduceproduction [1722] + 0.00 0.00 13/779868 make_iceberg [1718] + 0.00 0.00 20/779868 init_transportation [384] + 0.00 0.00 25/779868 make_targetregion [1701] + 0.00 0.00 32/779868 growing_trees [624] + 0.00 0.00 32/779868 make_curse [802] + 0.00 0.00 35/779868 deathcounts [843] + 0.00 0.00 55/779868 renumber_unit [1159] + 0.00 0.00 58/779868 potion_luck [1176] + 0.00 0.00 97/779868 mk_piracy [1652] + 0.00 0.00 114/779868 usetcontact [1147] + 0.00 0.00 159/779868 change_effect [982] + 0.00 0.00 234/779868 make_leftship [1615] + 0.00 0.00 328/779868 display_potion [1090] + 0.00 0.00 389/779868 usetpotionuse [1078] + 0.00 0.00 433/779868 make_otherfaction [1603] + 0.00 0.00 631/779868 set_group [1048] + 0.00 0.00 754/779868 new_units [282] + 0.00 0.00 760/779868 set_familiar [992] + 0.00 0.00 894/779868 make_follow [1589] + 0.00 0.00 2063/779868 create_unit [296] + 0.00 0.00 2503/779868 sell [498] + 0.00 0.00 3233/779868 leave_trail [704] + 0.00 0.00 3642/779868 buy [707] + 0.00 0.00 4162/779868 show_new_spells [889] + 0.00 0.00 4738/779868 expandselling [93] + 0.00 0.00 5679/779868 expandbuying [49] + 0.00 0.00 11749/779868 teach_unit [426] + 0.00 0.00 27216/779868 travelthru_add [609] + 0.00 0.00 52117/779868 update_lighthouse [605] + 0.00 0.00 251814/779868 a_read_i [390] + 0.00 0.00 405840/779868 study_cmd [105] +[1376] 0.0 0.00 0.00 779868 a_new [1376] + 0.00 0.00 417580/417580 init_learning [1396] + 0.00 0.00 37453/37453 shiptrail_init [1469] + 0.00 0.00 4052/4052 curse_init [1539] + 0.00 0.00 2650/2650 a_initeffect [1552] + 0.00 0.00 2092/2092 init_mage [1558] + 0.00 0.00 2081/2081 a_init_reportspell [1561] + 0.00 0.00 1564/1564 init_handler [1570] + 0.00 0.00 763/763 init_skillmod [1592] + 0.00 0.00 97/97 piracy_init [1654] + 0.00 0.00 56/56 dict_init [1675] + 0.00 0.00 9/9 init_resourcelimit [1731] +----------------------------------------------- + 0.00 0.00 4005/754589 do_attack [80] + 0.00 0.00 234242/754589 attack [84] + 0.00 0.00 516342/754589 select_weapon [1367] +[1377] 0.0 0.00 0.00 754589 preferred_weapon [1377] +----------------------------------------------- + 0.00 0.00 1727/744202 travel_route [147] + 0.00 0.00 742475/744202 can_survive [640] +[1378] 0.0 0.00 0.00 744202 has_horses [1378] +----------------------------------------------- + 0.00 0.00 221718/734392 adjust_coordinates [234] + 0.00 0.00 512674/734392 koor_distance [476] +[1379] 0.0 0.00 0.00 734392 plane_height [1379] +----------------------------------------------- + 0.00 0.00 221718/734392 adjust_coordinates [234] + 0.00 0.00 512674/734392 koor_distance [476] +[1380] 0.0 0.00 0.00 734392 plane_width [1380] +----------------------------------------------- + 0.00 0.00 1/651711 sp_generous [1040] + 0.00 0.00 1/651711 shipcurse_flyingship [1072] + 0.00 0.00 2/651711 sp_enterastral [1045] + 0.00 0.00 6/651711 forget_cmd [1093] + 0.00 0.00 9/651711 is_freezing [1088] + 0.00 0.00 10/651711 sp_stormwinds [871] + 0.00 0.00 17/651711 produce [29] + 0.00 0.00 17/651711 process [7] + 0.00 0.00 17/651711 magic [157] + 0.00 0.00 22/651711 drifting_ships [490] + 0.00 0.00 34/651711 sp_viewreality [784] + 0.00 0.00 149/651711 sail [181] + 0.00 0.00 349/651711 can_give_men [940] + 0.00 0.00 452/651711 fumble [973] + 0.00 0.00 488/651711 give_men [857] + 0.00 0.00 508/651711 regenerate_aura [346] + 0.00 0.00 1689/651711 recruit [650] + 0.00 0.00 2815/651711 count_faction [219] + 0.00 0.00 5358/651711 max_spellpoints [755] + 0.00 0.00 8515/651711 describe [35] + 0.00 0.00 16560/651711 entertain_cmd [665] + 0.00 0.00 29173/651711 horses [330] + 0.00 0.00 32649/651711 growing_trees [624] + 0.00 0.00 37300/651711 cr_output_region [10] + 0.00 0.00 91155/651711 godcurse [405] + 0.00 0.00 94865/651711 ageing [185] + 0.00 0.00 159633/651711 entertainmoney [643] + 0.00 0.00 169917/651711 study_cmd [105] +[1381] 0.0 0.00 0.00 651711 oldcursename [1381] +----------------------------------------------- + 0.00 0.00 12/647569 changefaction_write [1258] + 0.00 0.00 232/647569 writefaction [762] + 0.00 0.00 51104/647569 write_groups [920] + 0.00 0.00 596221/647569 write_unit [97] +[1382] 0.0 0.00 0.00 647569 write_faction_reference [1382] +----------------------------------------------- + 0.00 0.00 1/642406 caldera_write [1795] + 0.00 0.00 46184/642406 write_game [83] + 0.00 0.00 596221/642406 write_unit [97] +[1383] 0.0 0.00 0.00 642406 write_building_reference [1383] +----------------------------------------------- + 0.00 0.00 633429/633429 msg_release [1373] +[1384] 0.0 0.00 0.00 633429 msg_free [1384] + 0.00 0.00 1067195/1067195 free_arg [1371] +----------------------------------------------- + 0.00 0.00 256354/619425 attack [84] + 0.00 0.00 363071/619425 hits [131] +[1385] 0.0 0.00 0.00 619425 getreload [1385] +----------------------------------------------- + 0.00 0.00 19078/615299 write_game [83] + 0.00 0.00 596221/615299 write_unit [97] +[1386] 0.0 0.00 0.00 615299 write_ship_reference [1386] +----------------------------------------------- + 0.00 0.00 3/603524 remove_unit [499] + 0.00 0.00 9/603524 destroyfaction [392] + 0.00 0.00 228/603524 u_setfaction [1111] + 0.00 0.00 369/603524 add_recruits [371] + 0.00 0.00 1865/603524 transfermen [899] + 0.00 0.00 2889/603524 create_unit [296] + 0.00 0.00 3036/603524 scale_number [969] + 0.00 0.00 595125/603524 read_unit [74] +[1387] 0.0 0.00 0.00 603524 set_number [1387] +----------------------------------------------- + 0.00 0.00 603246/603246 cr_output_unit [19] +[1388] 0.0 0.00 0.00 603246 level_days [1388] +----------------------------------------------- + 0.00 0.00 1/600145 make_zombie [1267] + 0.00 0.00 1/600145 use_bloodpotion [935] + 0.00 0.00 2/600145 do_fumble [1062] + 0.00 0.00 4/600145 age_firedragon [1123] + 0.00 0.00 5/600145 age_dragon [1098] + 0.00 0.00 7/600145 age_ghoul [1024] + 0.00 0.00 17/600145 age_zombie [1019] + 0.00 0.00 19/600145 age_skeleton [1008] + 0.00 0.00 359/600145 give_men [857] + 0.00 0.00 1716/600145 recruit [650] + 0.00 0.00 2889/600145 create_unit [296] + 0.00 0.00 595125/600145 read_unit [74] +[1389] 0.0 0.00 0.00 600145 u_setrace [1389] +----------------------------------------------- + 0.00 0.00 1/599650 sp_summon_familiar [1025] + 0.00 0.00 2/599650 summon_allies [925] + 0.00 0.00 23/599650 recruit_dracoids [837] + 0.00 0.00 754/599650 new_units [282] + 0.00 0.00 1683/599650 status_cmd [904] + 0.00 0.00 2062/599650 create_unit [296] + 0.00 0.00 595125/599650 read_unit [74] +[1390] 0.0 0.00 0.00 599650 setstatus [1390] +----------------------------------------------- + 0.00 0.00 5425/595705 drain_exp [850] + 0.00 0.00 34486/595705 effskill_study [504] + 0.00 0.00 108170/595705 transfermen [899] + 0.00 0.00 447624/595705 learn_skill [471] +[1391] 0.0 0.00 0.00 595705 unit_skill [1391] +----------------------------------------------- + 0.00 0.00 36929/515192 cr_output_region [10] + 0.00 0.00 52156/515192 describe [35] + 0.00 0.00 426107/515192 default_wage [173] +[1392] 0.0 0.00 0.00 515192 is_mourning [1392] + 0.00 0.00 515192/515192 owner_change [1393] +----------------------------------------------- + 0.00 0.00 515192/515192 is_mourning [1392] +[1393] 0.0 0.00 0.00 515192 owner_change [1393] +----------------------------------------------- + 0.00 0.00 512663/512663 koor_distance [476] +[1394] 0.0 0.00 0.00 512663 koor_distance_orig [1394] +----------------------------------------------- + 0.00 0.00 58/432940 att_modification [90] + 0.00 0.00 89/432940 entertainmoney [643] + 0.00 0.00 508/432940 regenerate_aura [346] + 0.00 0.00 820/432940 curse_geteffect_int [1590] + 0.00 0.00 5358/432940 max_spellpoints [755] + 0.00 0.00 426107/432940 default_wage [173] +[1395] 0.0 0.00 0.00 432940 curse_geteffect [1395] +----------------------------------------------- + 0.00 0.00 417580/417580 a_new [1376] +[1396] 0.0 0.00 0.00 417580 init_learning [1396] +----------------------------------------------- + 0.00 0.00 417577/417577 a_free [558] +[1397] 0.0 0.00 0.00 417577 done_learning [1397] +----------------------------------------------- + 0.00 0.00 417577/417577 study_cmd [105] +[1398] 0.0 0.00 0.00 417577 study_speedup [1398] +----------------------------------------------- + 0.00 0.00 392959/392959 add_message [434] +[1399] 0.0 0.00 0.00 392959 msg_addref [1399] +----------------------------------------------- + 0.00 0.00 86/374425 i_merge [1651] + 0.00 0.00 216/374425 gift_items [891] + 0.00 0.00 340/374425 free_fighter [1580] + 0.00 0.00 18220/374425 i_freeall [1515] + 0.00 0.00 87928/374425 change_money [337] + 0.00 0.00 98482/374425 i_change [115] + 0.00 0.00 169153/374425 statistics [70] +[1400] 0.0 0.00 0.00 374425 i_free [1400] +----------------------------------------------- + 0.00 0.00 1/353788 add_seen_faction [1788] + 0.00 0.00 3767/353788 cb_add_address [598] + 0.00 0.00 350020/353788 get_addresses [20] +[1401] 0.0 0.00 0.00 353788 add_seen_faction_i [1401] +----------------------------------------------- + 0.00 0.00 348444/348444 report_resources [210] +[1402] 0.0 0.00 0.00 348444 report_resource [1402] +----------------------------------------------- + 0.00 0.00 330438/330438 cr_render [196] +[1403] 0.0 0.00 0.00 330438 cr_unit [1403] +----------------------------------------------- + 0.00 0.00 5762/308950 buy [707] + 0.00 0.00 15730/308950 sell [498] + 0.00 0.00 287458/308950 expandselling [93] +[1404] 0.0 0.00 0.00 308950 r_demand [1404] +----------------------------------------------- + 0.00 0.00 297222/297222 render_messages [58] +[1405] 0.0 0.00 0.00 297222 messagehash [1405] +----------------------------------------------- + 0.00 0.00 279072/279072 cr_render [196] +[1406] 0.0 0.00 0.00 279072 cr_int [1406] +----------------------------------------------- + 0.00 0.00 86/257723 i_merge [1651] + 0.00 0.00 216/257723 gift_items [891] + 0.00 0.00 340/257723 free_fighter [1580] + 0.00 0.00 87928/257723 change_money [337] + 0.00 0.00 169153/257723 statistics [70] +[1407] 0.0 0.00 0.00 257723 i_remove [1407] +----------------------------------------------- + 0.00 0.00 5/257693 give_horses [1108] + 0.00 0.00 5/257693 gift_items [891] + 0.00 0.00 9/257693 destroyfaction [392] + 0.00 0.00 64/257693 terraform_region [932] + 0.00 0.00 1098/257693 region_setresource [1097] + 0.00 0.00 28760/257693 migrate [1478] + 0.00 0.00 32679/257693 readregion [209] + 0.00 0.00 195073/257693 horses [330] +[1408] 0.0 0.00 0.00 257693 rsethorses [1408] +----------------------------------------------- + 0.00 0.00 251867/251867 do_attack [80] +[1409] 0.0 0.00 0.00 251867 attacks_per_round [1409] +----------------------------------------------- + 0.00 0.00 1/229715 breedtrees [1148] + 0.00 0.00 6/229715 sp_mallornhain [968] + 0.00 0.00 9/229715 sp_hain [931] + 0.00 0.00 20/229715 dissolve_units [241] + 0.00 0.00 36/229715 volcano_destruction [1022] + 0.00 0.00 51/229715 potion_water_of_life [945] + 0.00 0.00 252/229715 terraform_region [932] + 0.00 0.00 623/229715 tolua_region_set_resource [1057] + 0.00 0.00 98037/229715 readregion [209] + 0.00 0.00 130680/229715 growing_trees [624] +[1410] 0.0 0.00 0.00 229715 rsettrees [1410] +----------------------------------------------- + 0.00 0.00 5/221723 rel_to_abs [1728] + 0.00 0.00 221718/221723 adjust_coordinates [234] +[1411] 0.0 0.00 0.00 221723 plane_center_x [1411] +----------------------------------------------- + 0.00 0.00 5/221723 rel_to_abs [1728] + 0.00 0.00 221718/221723 adjust_coordinates [234] +[1412] 0.0 0.00 0.00 221723 plane_center_y [1412] +----------------------------------------------- + 0.00 0.00 13/217405 expandselling [93] + 0.00 0.00 217392/217405 readregion [209] +[1413] 0.0 0.00 0.00 217405 r_setdemand [1413] +----------------------------------------------- + 0.00 0.00 209572/209572 cr_output_region [10] +[1414] 0.0 0.00 0.00 209572 cr_region_header [1414] +----------------------------------------------- + 0.00 0.00 174/204314 breedhorses [742] + 0.00 0.00 4629/204314 expandselling [93] + 0.00 0.00 5460/204314 buy [707] + 0.00 0.00 15797/204314 sell [498] + 0.00 0.00 178254/204314 produce [29] +[1415] 0.0 0.00 0.00 204314 bt_changed [1415] +----------------------------------------------- + 0.00 0.00 71388/203117 reserve_i [213] + 0.00 0.00 131729/203117 give_cmd [102] +[1416] 0.0 0.00 0.00 203117 atoip [1416] +----------------------------------------------- + 0.00 0.00 93450/196476 see_border [1440] + 0.00 0.00 103026/196476 cr_borders [135] +[1417] 0.0 0.00 0.00 196476 b_finvisible [1417] +----------------------------------------------- + 0.00 0.00 93450/196476 see_border [1440] + 0.00 0.00 103026/196476 cr_borders [135] +[1418] 0.0 0.00 0.00 196476 b_rvisibleroad [1418] +----------------------------------------------- + 0.00 0.00 15/192815 drifting_ships [490] + 0.00 0.00 39714/192815 sail [181] + 0.00 0.00 39832/192815 astralregions [329] + 0.00 0.00 113254/192815 make_route [289] +[1419] 0.0 0.00 0.00 192815 add_regionlist [1419] +----------------------------------------------- + 0.00 0.00 93450/190467 describe [35] + 0.00 0.00 97017/190467 cr_borders [135] +[1420] 0.0 0.00 0.00 190467 b_transparent [1420] +----------------------------------------------- + 0.00 0.00 52/178322 get_or_create_terrain [1680] + 0.00 0.00 178270/178322 get_terrain [1423] +[1421] 0.0 0.00 0.00 178322 terrain_find_i [1421] +----------------------------------------------- + 0.00 0.00 57/178311 terraform_region [932] + 0.00 0.00 178254/178311 readregion [209] +[1422] 0.0 0.00 0.00 178311 region_setinfo [1422] +----------------------------------------------- + 0.00 0.00 2/178270 volcano_update [981] + 0.00 0.00 14/178270 init_terrains [1810] + 0.00 0.00 178254/178270 readregion [209] +[1423] 0.0 0.00 0.00 178270 get_terrain [1423] + 0.00 0.00 178270/178322 terrain_find_i [1421] +----------------------------------------------- + 0.00 0.00 178254/178254 writeregion [519] +[1424] 0.0 0.00 0.00 178254 region_getinfo [1424] +----------------------------------------------- + 0.00 0.00 48/157830 internal_path_find [345] + 0.00 0.00 157782/157830 allowed_dragon [564] +[1425] 0.0 0.00 0.00 157830 allowed_fly [1425] +----------------------------------------------- + 0.00 0.00 152803/152803 free_nodes [1604] +[1426] 0.0 0.00 0.00 152803 free_node [1426] +----------------------------------------------- + 0.00 0.00 27734/152803 regions_in_range [675] + 0.00 0.00 125069/152803 internal_path_find [345] +[1427] 0.0 0.00 0.00 152803 new_node [1427] +----------------------------------------------- + 0.00 0.00 2295/147171 buildingtype_exists [1443] + 0.00 0.00 2920/147171 owner_buildingtyp [676] + 0.00 0.00 12068/147171 building_is_active [1488] + 0.00 0.00 16296/147171 inside_building [1486] + 0.00 0.00 113592/147171 nr_building [141] +[1428] 0.0 0.00 0.00 147171 building_finished [1428] +----------------------------------------------- + 0.00 0.00 141675/141675 addtoken [811] +[1429] 0.0 0.00 0.00 141675 mknode [1429] +----------------------------------------------- + 0.00 0.00 140305/140305 reserve_i [213] +[1430] 0.0 0.00 0.00 140305 set_resvalue [1430] +----------------------------------------------- + 0.00 0.00 12787/130867 canwalk [633] + 0.00 0.00 21443/130867 ridingcapacity [694] + 0.00 0.00 96637/130867 walkingcapacity [403] +[1431] 0.0 0.00 0.00 130867 get_transporters [1431] +----------------------------------------------- + 0.00 0.00 128596/128596 report_plaintext [4] +[1432] 0.0 0.00 0.00 128596 check_errno [1432] +----------------------------------------------- + 0.00 0.00 229/128135 list_address [635] + 0.00 0.00 127906/128135 report_plaintext [4] +[1433] 0.0 0.00 0.00 128135 rpline [1433] +----------------------------------------------- + 0.00 0.00 123744/123744 msg_feedback [647] +[1434] 0.0 0.00 0.00 123744 arg_set [1434] +----------------------------------------------- + 0.00 0.00 110533/110533 make_fighter [424] +[1435] 0.0 0.00 0.00 110533 weapon_weight [1435] +----------------------------------------------- + 0.00 0.00 2/109377 sp_viewreality [784] + 0.00 0.00 15/109377 drifting_ships [490] + 0.00 0.00 311/109377 cr_output_region [10] + 0.00 0.00 5680/109377 describe [35] + 0.00 0.00 103369/109377 move_cmd [66] +[1436] 0.0 0.00 0.00 109377 free_regionlist [1436] +----------------------------------------------- + 0.00 0.00 105958/105958 travel_route [147] +[1437] 0.0 0.00 0.00 105958 entrance_allowed [1437] +----------------------------------------------- + 0.00 0.00 48/101322 terraform_region [932] + 0.00 0.00 5966/101322 herbsearch [493] + 0.00 0.00 32679/101322 readregion [209] + 0.00 0.00 62629/101322 growing_herbs [300] +[1438] 0.0 0.00 0.00 101322 rsetherbs [1438] +----------------------------------------------- + 0.00 0.00 96208/96208 travel_route [147] +[1439] 0.0 0.00 0.00 96208 var_copy_regions [1439] +----------------------------------------------- + 0.00 0.00 93452/93452 describe [35] +[1440] 0.0 0.00 0.00 93452 see_border [1440] + 0.00 0.00 93450/196476 b_finvisible [1417] + 0.00 0.00 93450/196476 b_rvisibleroad [1418] + 0.00 0.00 14192/26515 b_uinvisible [1487] + 0.00 0.00 2/2 b_fvisible [1771] +----------------------------------------------- + 0.00 0.00 1/93120 use_pooled [39] + 0.00 0.00 93119/93120 give_item [126] +[1441] 0.0 0.00 0.00 93120 change_reservation [1441] +----------------------------------------------- + 0.00 0.00 5/87004 set_money [1326] + 0.00 0.00 9/87004 default_spoil [1144] + 0.00 0.00 23/87004 equip_items [1121] + 0.00 0.00 60/87004 equip_unit_mask [776] + 0.00 0.00 86907/87004 change_money [337] +[1442] 0.0 0.00 0.00 87004 i_add [1442] +----------------------------------------------- + 0.00 0.00 2/75797 build_building [696] + 0.00 0.00 5/75797 build_road [950] + 0.00 0.00 208/75797 demographics [50] + 0.00 0.00 322/75797 can_takeoff [854] + 0.00 0.00 344/75797 expandselling [93] + 0.00 0.00 344/75797 produce [29] + 0.00 0.00 1112/75797 sell [498] + 0.00 0.00 2495/75797 study_cmd [105] + 0.00 0.00 31155/75797 statistics [70] + 0.00 0.00 39810/75797 check_ship_allowed [657] +[1443] 0.0 0.00 0.00 75797 buildingtype_exists [1443] + 0.00 0.00 2295/147171 building_finished [1428] +----------------------------------------------- + 0.00 0.00 5/65345 expandloot [816] + 0.00 0.00 32670/65345 morale_update [1479] + 0.00 0.00 32670/65345 writeregion [519] +[1444] 0.0 0.00 0.00 65345 region_get_morale [1444] +----------------------------------------------- + 0.00 0.00 62267/62267 horses [330] +[1445] 0.0 0.00 0.00 62267 get_migrants [1445] +----------------------------------------------- + 0.00 0.00 89/59694 recruit [650] + 0.00 0.00 1567/59694 travel_route [147] + 0.00 0.00 4139/59694 produce [29] + 0.00 0.00 5588/59694 process [7] + 0.00 0.00 8501/59694 magic [157] + 0.00 0.00 39810/59694 check_ship_allowed [657] +[1446] 0.0 0.00 0.00 59694 r_insectstalled [1446] +----------------------------------------------- + 0.00 0.00 58524/58524 a_write [299] +[1447] 0.0 0.00 0.00 58524 a_writeint [1447] +----------------------------------------------- + 0.00 0.00 106/58518 a_readkey [1648] + 0.00 0.00 58412/58518 a_read_i [390] +[1448] 0.0 0.00 0.00 58518 a_readint [1448] +----------------------------------------------- + 0.00 0.00 56646/56646 a_write [299] +[1449] 0.0 0.00 0.00 56646 write_group [1449] +----------------------------------------------- + 0.00 0.00 56503/56503 read_group [1451] +[1450] 0.0 0.00 0.00 56503 find_group [1450] +----------------------------------------------- + 0.00 0.00 56503/56503 a_read_i [390] +[1451] 0.0 0.00 0.00 56503 read_group [1451] + 0.00 0.00 56503/56503 find_group [1450] +----------------------------------------------- + 0.00 0.00 2/55547 ally_cmd [877] + 0.00 0.00 98/55547 init_group [1764] + 0.00 0.00 5925/55547 addally [913] + 0.00 0.00 49522/55547 read_groups [782] +[1452] 0.0 0.00 0.00 55547 ally_add [1452] +----------------------------------------------- + 0.00 0.00 54735/54735 write_travelthru [327] +[1453] 0.0 0.00 0.00 54735 init_cb [1453] +----------------------------------------------- + 0.00 0.00 54163/54163 copy_arg [521] +[1454] 0.0 0.00 0.00 54163 var_copy_string [1454] +----------------------------------------------- + 0.00 0.00 10/51239 changefaction_read [1166] + 0.00 0.00 13/51239 read_planes [1164] + 0.00 0.00 51216/51239 read_groups [782] +[1455] 0.0 0.00 0.00 51239 read_faction_reference [1455] +----------------------------------------------- + 0.00 0.00 12/51060 set_level [774] + 0.00 0.00 95/51060 transfermen [899] + 0.00 0.00 50953/51060 scale_number [969] +[1456] 0.0 0.00 0.00 51060 remove_skill [1456] +----------------------------------------------- + 0.00 0.00 50673/50673 demographics [50] +[1457] 0.0 0.00 0.00 50673 update_resources [1457] +----------------------------------------------- + 0.00 0.00 49331/49331 log_stdio [1459] +[1458] 0.0 0.00 0.00 49331 log_prefix [1458] +----------------------------------------------- + 0.00 0.00 49331/49331 log_write [1243] +[1459] 0.0 0.00 0.00 49331 log_stdio [1459] + 0.00 0.00 49331/49331 log_prefix [1458] + 0.00 0.00 49331/49331 _log_write [3280] +----------------------------------------------- + 0.00 0.00 9/48565 build_building [696] + 0.00 0.00 323/48565 enter_building [695] + 0.00 0.00 837/48565 create_unit [296] + 0.00 0.00 47396/48565 read_unit [74] +[1460] 0.0 0.00 0.00 48565 u_set_building [1460] + 0.00 0.00 18971/18971 building_set_owner [1504] +----------------------------------------------- + 0.00 0.00 2/48457 remove_building [1153] + 0.00 0.00 48455/48457 findbuilding [1462] +[1461] 0.0 0.00 0.00 48457 bfindhash [1461] +----------------------------------------------- + 0.00 0.00 1/48455 resolve_building [1862] + 0.00 0.00 4/48455 verify_building [1255] + 0.00 0.00 16/48455 newcontainerid [1263] + 0.00 0.00 27/48455 renumber_cmd [780] + 0.00 0.00 401/48455 enter_building [695] + 0.00 0.00 610/48455 build_building [696] + 0.00 0.00 47396/48455 read_unit [74] +[1462] 0.0 0.00 0.00 48455 findbuilding [1462] + 0.00 0.00 48455/48457 bfindhash [1461] +----------------------------------------------- + 0.00 0.00 1466/46742 resolve_region_id [1575] + 0.00 0.00 45276/46742 read_borders [706] +[1463] 0.0 0.00 0.00 46742 findregionbyid [1463] +----------------------------------------------- + 0.00 0.00 10/46196 renumber_cmd [780] + 0.00 0.00 11/46196 new_building [1059] + 0.00 0.00 46175/46196 read_game [62] +[1464] 0.0 0.00 0.00 46196 bhash [1464] +----------------------------------------------- + 0.00 0.00 4307/44216 set_coast [875] + 0.00 0.00 39909/44216 sail [181] +[1465] 0.0 0.00 0.00 44216 flying_ship [1465] +----------------------------------------------- + 0.00 0.00 2/40692 tolua_get_season [2888] + 0.00 0.00 2/40692 breedtrees [1148] + 0.00 0.00 2/40692 demographics [50] + 0.00 0.00 3/40692 gamedate2 [1222] + 0.00 0.00 89/40692 recruit [650] + 0.00 0.00 230/40692 gamedate_season [944] + 0.00 0.00 460/40692 report_plaintext [4] + 0.00 0.00 39904/40692 sail [181] +[1466] 0.0 0.00 0.00 40692 get_gamedate [1466] +----------------------------------------------- + 0.00 0.00 39955/39955 a_write [299] +[1467] 0.0 0.00 0.00 39955 write_of [1467] +----------------------------------------------- + 0.00 0.00 37453/37453 a_age [418] +[1468] 0.0 0.00 0.00 37453 shiptrail_age [1468] +----------------------------------------------- + 0.00 0.00 37453/37453 a_new [1376] +[1469] 0.0 0.00 0.00 37453 shiptrail_init [1469] +----------------------------------------------- + 0.00 0.00 37202/37202 free_arg [1371] +[1470] 0.0 0.00 0.00 37202 var_free_string [1470] +----------------------------------------------- + 0.00 0.00 37024/37024 move_blocked [283] +[1471] 0.0 0.00 0.00 37024 b_blocknone [1471] +----------------------------------------------- + 0.00 0.00 10/34565 changefaction_read [1166] + 0.00 0.00 2941/34565 addally [913] + 0.00 0.00 3693/34565 read_reference [726] + 0.00 0.00 27921/34565 read_groups [782] +[1472] 0.0 0.00 0.00 34565 ur_add [1472] +----------------------------------------------- + 0.00 0.00 34420/34420 a_write [299] +[1473] 0.0 0.00 0.00 34420 a_writeshorts [1473] +----------------------------------------------- + 0.00 0.00 34382/34382 a_read_i [390] +[1474] 0.0 0.00 0.00 34382 a_readshorts [1474] +----------------------------------------------- + 0.00 0.00 34220/34220 a_read_i [390] +[1475] 0.0 0.00 0.00 34220 shiptrail_read [1475] +----------------------------------------------- + 0.00 0.00 48/32727 terraform_region [932] + 0.00 0.00 32679/32727 readregion [209] +[1476] 0.0 0.00 0.00 32727 region_set_morale [1476] +----------------------------------------------- + 0.00 0.00 32679/32679 readregion [209] +[1477] 0.0 0.00 0.00 32679 read_owner [1477] +----------------------------------------------- + 0.00 0.00 32670/32670 demographics [50] +[1478] 0.0 0.00 0.00 32670 migrate [1478] + 0.00 0.00 28760/1160345 rhorses [1369] + 0.00 0.00 28760/257693 rsethorses [1408] +----------------------------------------------- + 0.00 0.00 32670/32670 age_region [659] +[1479] 0.0 0.00 0.00 32670 morale_update [1479] + 0.00 0.00 32670/65345 region_get_morale [1444] +----------------------------------------------- + 0.00 0.00 32670/32670 writeregion [519] +[1480] 0.0 0.00 0.00 32670 write_owner [1480] +----------------------------------------------- + 0.00 0.00 31688/31688 cr_render [196] +[1481] 0.0 0.00 0.00 31688 cr_building [1481] +----------------------------------------------- + 0.00 0.00 30150/30150 nr_ship [111] +[1482] 0.0 0.00 0.00 30150 ship_damage_percent [1482] +----------------------------------------------- + 0.00 0.00 16/28818 newcontainerid [1263] + 0.00 0.00 22/28818 verify_ship [1704] + 0.00 0.00 31/28818 renumber_cmd [780] + 0.00 0.00 222/28818 enter_ship [733] + 0.00 0.00 283/28818 follow_ship [749] + 0.00 0.00 307/28818 getship [1018] + 0.00 0.00 525/28818 follow_unit [331] + 0.00 0.00 27412/28818 read_unit [74] +[1483] 0.0 0.00 0.00 28818 findship [1483] + 0.00 0.00 28818/28818 sfindhash [1484] +----------------------------------------------- + 0.00 0.00 28818/28818 findship [1483] +[1484] 0.0 0.00 0.00 28818 sfindhash [1484] +----------------------------------------------- + 0.00 0.00 2/27640 create_ship [1014] + 0.00 0.00 35/27640 create_unit [296] + 0.00 0.00 191/27640 enter_ship [733] + 0.00 0.00 27412/27640 read_unit [74] +[1485] 0.0 0.00 0.00 27640 u_set_ship [1485] + 0.00 0.00 18960/18963 ship_set_owner [1505] +----------------------------------------------- + 0.00 0.00 140/26995 age_stonecircle [1021] + 0.00 0.00 225/26995 spellpower [1000] + 0.00 0.00 226/26995 fumble [973] + 0.00 0.00 318/26995 in_safe_building [1585] + 0.00 0.00 508/26995 regenerate_aura [346] + 0.00 0.00 1733/26995 build [691] + 0.00 0.00 3563/26995 prepare_report [8] + 0.00 0.00 5920/26995 allocate_resource [752] + 0.00 0.00 6405/26995 active_building [560] + 0.00 0.00 7957/26995 magic_resistance [727] +[1486] 0.0 0.00 0.00 26995 inside_building [1486] + 0.00 0.00 16296/147171 building_finished [1428] + 0.00 0.00 16284/19671 buildingcapacity [1500] +----------------------------------------------- + 0.00 0.00 12323/26515 cr_borders [135] + 0.00 0.00 14192/26515 see_border [1440] +[1487] 0.0 0.00 0.00 26515 b_uinvisible [1487] +----------------------------------------------- + 0.00 0.00 225/26164 spellpower [1000] + 0.00 0.00 226/26164 fumble [973] + 0.00 0.00 508/26164 regenerate_aura [346] + 0.00 0.00 4530/26164 build [691] + 0.00 0.00 5920/26164 allocate_resource [752] + 0.00 0.00 6798/26164 active_building [560] + 0.00 0.00 7957/26164 magic_resistance [727] +[1488] 0.0 0.00 0.00 26164 building_is_active [1488] + 0.00 0.00 12068/147171 building_finished [1428] +----------------------------------------------- + 0.00 0.00 12828/26045 cr_output_curses [69] + 0.00 0.00 13217/26045 nr_curses_i [401] +[1489] 0.0 0.00 0.00 26045 curse_cansee [1489] +----------------------------------------------- + 0.00 0.00 25441/25441 readregion [209] +[1490] 0.0 0.00 0.00 25441 rmt_find [1490] +----------------------------------------------- + 0.00 0.00 1084/24449 print_header [838] + 0.00 0.00 2168/24449 aftermath [701] + 0.00 0.00 7336/24449 battle_report [503] + 0.00 0.00 13861/24449 print_stats [525] +[1491] 0.0 0.00 0.00 24449 seematrix [1491] +----------------------------------------------- + 0.00 0.00 23342/23342 a_free [558] +[1492] 0.0 0.00 0.00 23342 shiptrail_finalize [1492] +----------------------------------------------- + 0.00 0.00 23233/23233 cr_render [196] +[1493] 0.0 0.00 0.00 23233 cr_faction [1493] +----------------------------------------------- + 0.00 0.00 22643/22643 write_borders [1897] +[1494] 0.0 0.00 0.00 22643 b_validroad [1494] +----------------------------------------------- + 0.00 0.00 22643/22643 write_borders [1897] +[1495] 0.0 0.00 0.00 22643 b_writeroad [1495] +----------------------------------------------- + 0.00 0.00 22638/22638 read_borders [706] +[1496] 0.0 0.00 0.00 22638 find_bordertype [1496] +----------------------------------------------- + 0.00 0.00 22637/22637 read_borders [706] +[1497] 0.0 0.00 0.00 22637 b_readroad [1497] +----------------------------------------------- + 0.00 0.00 1104/22301 aftermath [701] + 0.00 0.00 7336/22301 battle_report [503] + 0.00 0.00 13861/22301 print_stats [525] +[1498] 0.0 0.00 0.00 22301 army_index [1498] +----------------------------------------------- + 0.00 0.00 7/21500 new_luxurytype [1739] + 0.00 0.00 5762/21500 buy [707] + 0.00 0.00 15731/21500 sell [498] +[1499] 0.0 0.00 0.00 21500 resource2luxury [1499] +----------------------------------------------- + 0.00 0.00 3387/19671 lighthouse_range [728] + 0.00 0.00 16284/19671 inside_building [1486] +[1500] 0.0 0.00 0.00 19671 buildingcapacity [1500] +----------------------------------------------- + 0.00 0.00 7/19089 st_get_or_create [1743] + 0.00 0.00 19082/19089 st_find [1503] +[1501] 0.0 0.00 0.00 19089 st_find_i [1501] +----------------------------------------------- + 0.00 0.00 1/19085 renumber_cmd [780] + 0.00 0.00 2/19085 new_ship [1229] + 0.00 0.00 19082/19085 read_game [62] +[1502] 0.0 0.00 0.00 19085 shash [1502] +----------------------------------------------- + 0.00 0.00 19082/19082 read_game [62] +[1503] 0.0 0.00 0.00 19082 st_find [1503] + 0.00 0.00 19082/19089 st_find_i [1501] +----------------------------------------------- + 0.00 0.00 18971/18971 u_set_building [1460] +[1504] 0.0 0.00 0.00 18971 building_set_owner [1504] +----------------------------------------------- + 0.00 0.00 3/18963 give_control [1763] + 0.00 0.00 18960/18963 u_set_ship [1485] +[1505] 0.0 0.00 0.00 18963 ship_set_owner [1505] +----------------------------------------------- + 0.00 0.00 17289/17289 teach_cmd [272] +[1506] 0.0 0.00 0.00 17289 parser_popstate [1506] +----------------------------------------------- + 0.00 0.00 17289/17289 teach_cmd [272] +[1507] 0.0 0.00 0.00 17289 parser_pushstate [1507] +----------------------------------------------- + 0.00 0.00 16737/16737 roadto [606] +[1508] 0.0 0.00 0.00 16737 dir_invert [1508] +----------------------------------------------- + 0.00 0.00 16191/16191 help_feed [678] +[1509] 0.0 0.00 0.00 16191 add_donation [1509] +----------------------------------------------- + 0.00 0.00 14994/14994 cr_render [196] +[1510] 0.0 0.00 0.00 14994 cr_string [1510] +----------------------------------------------- + 0.00 0.00 14111/14111 a_write [299] +[1511] 0.0 0.00 0.00 14111 shiptrail_write [1511] +----------------------------------------------- + 0.00 0.00 3115/13500 drifting_ships [490] + 0.00 0.00 3135/13500 sinkships [475] + 0.00 0.00 7250/13500 ship_ready [354] +[1512] 0.0 0.00 0.00 13500 enoughsailors [1512] +----------------------------------------------- + 0.00 0.00 9/11052 xml_spell [1727] + 0.00 0.00 16/11052 do_combatmagic [825] + 0.00 0.00 24/11052 add_spells [1668] + 0.00 0.00 326/11052 parse_spellbooks [1827] + 0.00 0.00 1174/11052 read_spellbook [1555] + 0.00 0.00 1312/11052 read_mage [1559] + 0.00 0.00 8191/11052 read_seenspell [1522] +[1513] 0.0 0.00 0.00 11052 find_spell [1513] + 0.00 0.00 11052/11052 sp_alias [1514] +----------------------------------------------- + 0.00 0.00 11052/11052 find_spell [1513] +[1514] 0.0 0.00 0.00 11052 sp_alias [1514] +----------------------------------------------- + 0.00 0.00 1/10475 item_done [1811] + 0.00 0.00 57/10475 terraform_region [932] + 0.00 0.00 10417/10475 free_luxuries [1516] +[1515] 0.0 0.00 0.00 10475 i_freeall [1515] + 0.00 0.00 18220/374425 i_free [1400] +----------------------------------------------- + 0.00 0.00 10417/10417 a_free [558] +[1516] 0.0 0.00 0.00 10417 free_luxuries [1516] + 0.00 0.00 10417/10475 i_freeall [1515] +----------------------------------------------- + 0.00 0.00 9147/9147 report_plaintext [4] +[1517] 0.0 0.00 0.00 9147 merge_messages [1517] +----------------------------------------------- + 0.00 0.00 9147/9147 report_plaintext [4] +[1518] 0.0 0.00 0.00 9147 split_messages [1518] +----------------------------------------------- + 0.00 0.00 8962/8962 battle_flee [352] +[1519] 0.0 0.00 0.00 8962 hpflee [1519] +----------------------------------------------- + 0.00 0.00 1909/8788 parse_messages [832] + 0.00 0.00 6879/8788 xml_readstrings [863] +[1520] 0.0 0.00 0.00 8788 xml_cleanup_string [1520] +----------------------------------------------- + 0.00 0.00 8622/8622 read_reference [726] +[1521] 0.0 0.00 0.00 8622 read_unit_reference [1521] +----------------------------------------------- + 0.00 0.00 8191/8191 a_read_i [390] +[1522] 0.0 0.00 0.00 8191 read_seenspell [1522] + 0.00 0.00 8191/11052 find_spell [1513] +----------------------------------------------- + 0.00 0.00 8187/8187 a_write [299] +[1523] 0.0 0.00 0.00 8187 write_seenspell [1523] +----------------------------------------------- + 0.00 0.00 7964/7964 report_crtypes [428] +[1524] 0.0 0.00 0.00 7964 nrt_section [1524] +----------------------------------------------- + 0.00 0.00 7915/7915 report_resources [210] +[1525] 0.0 0.00 0.00 7915 visible_default [1525] +----------------------------------------------- + 0.00 0.00 1762/7889 tolua_region_set_resource [1057] + 0.00 0.00 6127/7889 tolua_region_get_resource [976] +[1526] 0.0 0.00 0.00 7889 special_resources [1526] +----------------------------------------------- + 0.00 0.00 2704/7493 leveled_allocation [888] + 0.00 0.00 4789/7493 attrib_allocation [914] +[1527] 0.0 0.00 0.00 7493 required [1527] +----------------------------------------------- + 0.00 0.00 7336/7336 battle_report [503] +[1528] 0.0 0.00 0.00 7336 get_alive [1528] +----------------------------------------------- + 0.00 0.00 7220/7220 a_write [299] +[1529] 0.0 0.00 0.00 7220 a_writestring [1529] +----------------------------------------------- + 0.00 0.00 7153/7153 cr_render [196] +[1530] 0.0 0.00 0.00 7153 cr_ship [1530] +----------------------------------------------- + 0.00 0.00 7085/7085 a_read_i [390] +[1531] 0.0 0.00 0.00 7085 a_readprivate [1531] +----------------------------------------------- + 0.00 0.00 16/6576 xml_readarmor [1736] + 0.00 0.00 21/6576 parse_ships [1305] + 0.00 0.00 250/6576 parse_buildings [1131] + 0.00 0.00 268/6576 parse_ai [1662] + 0.00 0.00 303/6576 xml_readweapon [1266] + 0.00 0.00 318/6576 parse_resources [1086] + 0.00 0.00 942/6576 xml_readitem [1107] + 0.00 0.00 1660/6576 parse_spells [1120] + 0.00 0.00 2798/6576 parse_races [1104] +[1532] 0.0 0.00 0.00 6576 xml_bvalue [1532] +----------------------------------------------- + 0.00 0.00 4/5453 parse_resources [1086] + 0.00 0.00 7/5453 xml_readluxury [1745] + 0.00 0.00 8/5453 xml_readarmor [1736] + 0.00 0.00 11/5453 parse_calendar [1252] + 0.00 0.00 15/5453 xml_readpotion [1714] + 0.00 0.00 24/5453 add_spells [1668] + 0.00 0.00 63/5453 parse_ships [1305] + 0.00 0.00 108/5453 xml_readweapon [1266] + 0.00 0.00 134/5453 parse_ai [1662] + 0.00 0.00 162/5453 xml_readrequirements [1186] + 0.00 0.00 179/5453 parse_buildings [1131] + 0.00 0.00 326/5453 parse_spellbooks [1827] + 0.00 0.00 471/5453 xml_readitem [1107] + 0.00 0.00 504/5453 xml_readconstruction [1183] + 0.00 0.00 731/5453 parse_spells [1120] + 0.00 0.00 2706/5453 parse_races [1104] +[1533] 0.0 0.00 0.00 5453 xml_ivalue [1533] +----------------------------------------------- + 0.00 0.00 946/5330 centre [789] + 0.00 0.00 4384/5330 battle_punit [620] +[1534] 0.0 0.00 0.00 5330 freestrlist [1534] +----------------------------------------------- + 0.00 0.00 4066/4066 report_template [87] +[1535] 0.0 0.00 0.00 4066 buildingmaintenance [1535] +----------------------------------------------- + 0.00 0.00 4052/4052 curse_age [1538] +[1536] 0.0 0.00 0.00 4052 c_clearflag [1536] +----------------------------------------------- + 0.00 0.00 32/4052 make_curse [802] + 0.00 0.00 4020/4052 curse_read [770] +[1537] 0.0 0.00 0.00 4052 chash [1537] +----------------------------------------------- + 0.00 0.00 4052/4052 a_age [418] +[1538] 0.0 0.00 0.00 4052 curse_age [1538] + 0.00 0.00 4052/4052 c_clearflag [1536] + 0.00 0.00 1/1 flyingship_age [1803] +----------------------------------------------- + 0.00 0.00 4052/4052 a_new [1376] +[1539] 0.0 0.00 0.00 4052 curse_init [1539] +----------------------------------------------- + 0.00 0.00 2/3862 sp_igjarjuk [923] + 0.00 0.00 6/3862 tolua_unit_set_name [3148] + 0.00 0.00 27/3862 dragon_name [1095] + 0.00 0.00 34/3862 dracoid_name [1126] + 0.00 0.00 196/3862 make_name [970] + 0.00 0.00 666/3862 generic_name [962] + 0.00 0.00 2931/3862 name_unit [803] +[1540] 0.0 0.00 0.00 3862 unit_setname [1540] +----------------------------------------------- + 0.00 0.00 9/3717 magic [157] + 0.00 0.00 3708/3717 do_combatmagic [825] +[1541] 0.0 0.00 0.00 3717 free_castorders [1541] + 0.00 0.00 229/303 free_castorder [1609] +----------------------------------------------- + 0.00 0.00 3639/3639 attack [84] +[1542] 0.0 0.00 0.00 3639 setreload [1542] +----------------------------------------------- + 0.00 0.00 231/3203 update_spells [381] + 0.00 0.00 2972/3203 unit_get_spellbook [427] +[1543] 0.0 0.00 0.00 3203 faction_get_spellbook [1543] + 0.00 0.00 3165/3171 get_spellbook [1544] +----------------------------------------------- + 0.00 0.00 6/3171 parse_spellbooks [1827] + 0.00 0.00 3165/3171 faction_get_spellbook [1543] +[1544] 0.0 0.00 0.00 3171 get_spellbook [1544] + 0.00 0.00 6/380 create_spellbook [1606] +----------------------------------------------- + 0.00 0.00 3114/3114 name_cmd [835] +[1545] 0.0 0.00 0.00 3114 rename_cmd [1545] +----------------------------------------------- + 0.00 0.00 1/3113 trigger_giveitem [1891] + 0.00 0.00 1/3113 trigger_shock [1892] + 0.00 0.00 2/3113 trigger_changefaction [1783] + 0.00 0.00 3/3113 trigger_changerace [1297] + 0.00 0.00 5/3113 trigger_killunit [1752] + 0.00 0.00 5/3113 trigger_timeout [1753] + 0.00 0.00 3096/3113 read_triggers [798] +[1546] 0.0 0.00 0.00 3113 t_new [1546] + 0.00 0.00 18/18 timeout_init [1710] + 0.00 0.00 12/12 changefaction_init [1721] + 0.00 0.00 6/6 changerace_init [1746] + 0.00 0.00 2/2 giveitem_init [1774] +----------------------------------------------- + 0.00 0.00 122/3100 maxbuild [946] + 0.00 0.00 2978/3100 build [691] +[1547] 0.0 0.00 0.00 3100 required [1547] +----------------------------------------------- + 0.00 0.00 3096/3096 read_triggers [798] +[1548] 0.0 0.00 0.00 3096 tt_find [1548] +----------------------------------------------- + 0.00 0.00 319/2913 loot_items [810] + 0.00 0.00 2594/2913 aftermath [701] +[1549] 0.0 0.00 0.00 2913 dead_fighters [1549] +----------------------------------------------- + 0.00 0.00 2/2854 summon_allies [925] + 0.00 0.00 149/2854 print_stats [525] + 0.00 0.00 2703/2854 print_header [838] +[1550] 0.0 0.00 0.00 2854 is_attacker [1550] +----------------------------------------------- + 0.00 0.00 1/2742 oldfamiliars [1240] + 0.00 0.00 10/2742 spawn_dragons [411] + 0.00 0.00 17/2742 recruit_dracoids [837] + 0.00 0.00 20/2742 spawn_seaserpent [831] + 0.00 0.00 21/2742 spawn_undead [629] + 0.00 0.00 48/2742 terraform_region [932] + 0.00 0.00 319/2742 kill_troop [532] + 0.00 0.00 639/2742 spawn_braineaters [505] + 0.00 0.00 1667/2742 add_recruits [371] +[1551] 0.0 0.00 0.00 2742 get_equipment [1551] +----------------------------------------------- + 0.00 0.00 2650/2650 a_new [1376] +[1552] 0.0 0.00 0.00 2650 a_initeffect [1552] +----------------------------------------------- + 0.00 0.00 2468/2468 mt_new [1588] +[1553] 0.0 0.00 0.00 2468 find_argtype [1553] +----------------------------------------------- + 0.00 0.00 2468/2468 crt_register [1006] +[1554] 0.0 0.00 0.00 2468 tsf_find [1554] +----------------------------------------------- + 0.00 0.00 233/2324 readfaction [767] + 0.00 0.00 2091/2324 read_mage [1559] +[1555] 0.0 0.00 0.00 2324 read_spellbook [1555] + 0.00 0.00 1174/11052 find_spell [1513] + 0.00 0.00 1174/1524 spellbook_add [1572] + 0.00 0.00 367/380 create_spellbook [1606] +----------------------------------------------- + 0.00 0.00 232/2321 writefaction [762] + 0.00 0.00 2089/2321 write_mage [1560] +[1556] 0.0 0.00 0.00 2321 write_spellbook [1556] +----------------------------------------------- + 0.00 0.00 99/2112 eff_spelllevel [845] + 0.00 0.00 489/2112 u_hasspell [951] + 0.00 0.00 1524/2112 spellbook_add [1572] +[1557] 0.0 0.00 0.00 2112 spellbook_get [1557] +----------------------------------------------- + 0.00 0.00 2092/2092 a_new [1376] +[1558] 0.0 0.00 0.00 2092 init_mage [1558] +----------------------------------------------- + 0.00 0.00 2091/2091 a_read_i [390] +[1559] 0.0 0.00 0.00 2091 read_mage [1559] + 0.00 0.00 2091/2324 read_spellbook [1555] + 0.00 0.00 1312/11052 find_spell [1513] +----------------------------------------------- + 0.00 0.00 2089/2089 a_write [299] +[1560] 0.0 0.00 0.00 2089 write_mage [1560] + 0.00 0.00 2089/2321 write_spellbook [1556] +----------------------------------------------- + 0.00 0.00 2081/2081 a_new [1376] +[1561] 0.0 0.00 0.00 2081 a_init_reportspell [1561] +----------------------------------------------- + 0.00 0.00 644/2073 join_allies [693] + 0.00 0.00 1429/2073 start_battle [297] +[1562] 0.0 0.00 0.00 2073 set_enemy [1562] +----------------------------------------------- + 0.00 0.00 1909/1909 nrt_register [883] +[1563] 0.0 0.00 0.00 1909 section_find [1563] +----------------------------------------------- + 0.00 0.00 1716/1716 recruit [650] +[1564] 0.0 0.00 0.00 1716 recruit_cost [1564] +----------------------------------------------- + 0.00 0.00 3/1697 join_group [1083] + 0.00 0.00 1694/1697 read_groups [782] +[1565] 0.0 0.00 0.00 1697 new_group [1565] +----------------------------------------------- + 0.00 0.00 1670/1670 select_recruitment [1079] +[1566] 0.0 0.00 0.00 1670 any_recruiters [1566] +----------------------------------------------- + 0.00 0.00 1670/1670 select_recruitment [1079] +[1567] 0.0 0.00 0.00 1670 horse_recruiters [1567] +----------------------------------------------- + 0.00 0.00 1594/1594 expandrecruit [349] +[1568] 0.0 0.00 0.00 1594 free_recruitments [1568] + 0.00 0.00 1670/1936876 free_order [1356] +----------------------------------------------- + 0.00 0.00 15/1582 new_potiontype [1712] + 0.00 0.00 19/1582 reshow_other [823] + 0.00 0.00 337/1582 report_computer [9] + 0.00 0.00 337/1582 report_plaintext [4] + 0.00 0.00 348/1582 use_potion [801] + 0.00 0.00 526/1582 create_item [617] +[1569] 0.0 0.00 0.00 1582 resource2potion [1569] +----------------------------------------------- + 0.00 0.00 1564/1564 a_new [1376] +[1570] 0.0 0.00 0.00 1564 init_handler [1570] +----------------------------------------------- + 0.00 0.00 18/1529 ship_update_owner [573] + 0.00 0.00 1511/1529 ship_owner [438] +[1571] 0.0 0.00 0.00 1529 ship_owner_ex [1571] +----------------------------------------------- + 0.00 0.00 24/1524 equipment_addspell [1702] + 0.00 0.00 326/1524 parse_spellbooks [1827] + 0.00 0.00 1174/1524 read_spellbook [1555] +[1572] 0.0 0.00 0.00 1524 spellbook_add [1572] + 0.00 0.00 1524/2112 spellbook_get [1557] +----------------------------------------------- + 0.00 0.00 1522/1522 a_age [418] +[1573] 0.0 0.00 0.00 1522 age_unit [1573] +----------------------------------------------- + 0.00 0.00 1520/1520 join_allies [693] +[1574] 0.0 0.00 0.00 1520 set_friendly [1574] +----------------------------------------------- + 0.00 0.00 326/1466 resolve [757] + 0.00 0.00 1140/1466 read_reference [726] +[1575] 0.0 0.00 0.00 1466 resolve_region_id [1575] + 0.00 0.00 1466/46742 findregionbyid [1463] +----------------------------------------------- + 0.00 0.00 661/1429 join_battle [425] + 0.00 0.00 768/1429 make_fighter [424] +[1576] 0.0 0.00 0.00 1429 set_attacker [1576] +----------------------------------------------- + 0.00 0.00 114/1361 give_unit [952] + 0.00 0.00 588/1361 give_men [857] + 0.00 0.00 659/1361 can_give_men [940] +[1577] 0.0 0.00 0.00 1361 unit_has_cursed_item [1577] +----------------------------------------------- + 0.00 0.00 1301/1301 leveled_allocation [888] +[1578] 0.0 0.00 0.00 1301 rm_get [1578] +----------------------------------------------- + 0.00 0.00 1297/1297 make_fighter [424] +[1579] 0.0 0.00 0.00 1297 add_tactics [1579] +----------------------------------------------- + 0.00 0.00 1297/1297 battle_free [1629] +[1580] 0.0 0.00 0.00 1297 free_fighter [1580] + 0.00 0.00 340/374425 i_free [1400] + 0.00 0.00 340/257723 i_remove [1407] +----------------------------------------------- + 0.00 0.00 1295/1295 make_fighter [424] +[1581] 0.0 0.00 0.00 1295 find_side [1581] +----------------------------------------------- + 0.00 0.00 1140/1140 read_reference [726] +[1582] 0.0 0.00 0.00 1140 read_region_reference [1582] +----------------------------------------------- + 0.00 0.00 2/1119 wormhole_write [1785] + 0.00 0.00 1117/1119 write_targetregion [1584] +[1583] 0.0 0.00 0.00 1119 write_region_reference [1583] +----------------------------------------------- + 0.00 0.00 1117/1117 a_write [299] +[1584] 0.0 0.00 0.00 1117 write_targetregion [1584] + 0.00 0.00 1117/1119 write_region_reference [1583] +----------------------------------------------- + 0.00 0.00 1042/1042 monster_attacks [248] +[1585] 0.0 0.00 0.00 1042 in_safe_building [1585] + 0.00 0.00 318/26995 inside_building [1486] +----------------------------------------------- + 0.00 0.00 2/1041 disable_feature [771] + 0.00 0.00 6/1041 tolua_unit_setskill [1163] + 0.00 0.00 23/1041 xml_readweapon [1266] + 0.00 0.00 84/1041 xml_readconstruction [1183] + 0.00 0.00 106/1041 add_skills [1667] + 0.00 0.00 820/1041 parse_races [1104] +[1586] 0.0 0.00 0.00 1041 findskill [1586] +----------------------------------------------- + 0.00 0.00 957/957 mt_register [1007] +[1587] 0.0 0.00 0.00 957 mt_id [1587] +----------------------------------------------- + 0.00 0.00 957/957 parse_messages [832] +[1588] 0.0 0.00 0.00 957 mt_new [1588] + 0.00 0.00 2468/2468 find_argtype [1553] +----------------------------------------------- + 0.00 0.00 894/894 follow_unit [331] +[1589] 0.0 0.00 0.00 894 make_follow [1589] + 0.00 0.00 894/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 820/820 shipspeed [669] +[1590] 0.0 0.00 0.00 820 curse_geteffect_int [1590] + 0.00 0.00 820/432940 curse_geteffect [1395] +----------------------------------------------- + 0.00 0.00 785/785 i_canuse [569] +[1591] 0.0 0.00 0.00 785 lua_canuse_item [1591] +----------------------------------------------- + 0.00 0.00 763/763 a_new [1376] +[1592] 0.0 0.00 0.00 763 init_skillmod [1592] +----------------------------------------------- + 0.00 0.00 132/677 can_contact [1634] + 0.00 0.00 222/677 leave_cmd [721] + 0.00 0.00 323/677 enter_building [695] +[1593] 0.0 0.00 0.00 677 slipthru [1593] +----------------------------------------------- + 0.00 0.00 1/608 sp_holyground [1068] + 0.00 0.00 1/608 sp_summonshadowlords [1034] + 0.00 0.00 1/608 sp_generous [1040] + 0.00 0.00 1/608 sp_enterastral [1045] + 0.00 0.00 1/608 sp_flying_ship [1064] + 0.00 0.00 2/608 sp_summon_familiar [1025] + 0.00 0.00 2/608 sp_viewreality [784] + 0.00 0.00 3/608 sp_song_of_peace [939] + 0.00 0.00 3/608 sp_eternizewall [988] + 0.00 0.00 4/608 sp_goodwinds [974] + 0.00 0.00 6/608 sp_mallornhain [968] + 0.00 0.00 6/608 sp_summonundead [896] + 0.00 0.00 8/608 do_fumble [1062] + 0.00 0.00 9/608 sp_stormwinds [871] + 0.00 0.00 10/608 sp_hain [931] + 0.00 0.00 13/608 sp_blessedharvest [847] + 0.00 0.00 121/608 lua_callspell [1645] + 0.00 0.00 196/608 verify_targets [1027] + 0.00 0.00 220/608 magic [157] +[1594] 0.0 0.00 0.00 608 co_get_region [1594] +----------------------------------------------- + 0.00 0.00 574/574 do_battle [64] +[1595] 0.0 0.00 0.00 574 battle_update [1595] +----------------------------------------------- + 0.00 0.00 27/560 dragon_name [1095] + 0.00 0.00 533/560 treeman_neighbour [1201] +[1596] 0.0 0.00 0.00 560 oldterrain [1596] +----------------------------------------------- + 0.00 0.00 554/554 a_free [558] +[1597] 0.0 0.00 0.00 554 a_finalizeeffect [1597] +----------------------------------------------- + 0.00 0.00 552/552 battle_free [1629] +[1598] 0.0 0.00 0.00 552 free_side [1598] +----------------------------------------------- + 0.00 0.00 6/501 parse_resources [1086] + 0.00 0.00 14/501 parse_ships [1305] + 0.00 0.00 23/501 xml_readweapon [1266] + 0.00 0.00 24/501 xml_readarmor [1736] + 0.00 0.00 27/501 parse_buildings [1131] + 0.00 0.00 67/501 parse_ai [1662] + 0.00 0.00 340/501 parse_races [1104] +[1599] 0.0 0.00 0.00 501 xml_fvalue [1599] +----------------------------------------------- + 0.00 0.00 1/465 xml_readconstruction [1183] + 0.00 0.00 6/465 parse_resources [1086] + 0.00 0.00 6/465 add_callbacks [1666] + 0.00 0.00 178/465 parse_function [1637] + 0.00 0.00 274/465 parse_spells [1120] +[1600] 0.0 0.00 0.00 465 get_function [1600] +----------------------------------------------- + 0.00 0.00 464/464 prepare_report [8] +[1601] 0.0 0.00 0.00 464 lastregion [1601] +----------------------------------------------- + 0.00 0.00 47/451 msg_set_region [1685] + 0.00 0.00 80/451 msg_set_resource [1226] + 0.00 0.00 121/451 msg_set_unit [1646] + 0.00 0.00 203/451 msg_set_int [1633] +[1602] 0.0 0.00 0.00 451 mtype_get_param [1602] +----------------------------------------------- + 0.00 0.00 2/433 set_factionstealth [183] + 0.00 0.00 431/433 create_unit [296] +[1603] 0.0 0.00 0.00 433 make_otherfaction [1603] + 0.00 0.00 433/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 40/428 regions_in_range [675] + 0.00 0.00 388/428 internal_path_find [345] +[1604] 0.0 0.00 0.00 428 free_nodes [1604] + 0.00 0.00 152803/152803 free_node [1426] +----------------------------------------------- + 0.00 0.00 406/406 battle_effects [1125] +[1605] 0.0 0.00 0.00 406 PopulationDamage [1605] +----------------------------------------------- + 0.00 0.00 6/380 get_spellbook [1544] + 0.00 0.00 7/380 equipment_addspell [1702] + 0.00 0.00 367/380 read_spellbook [1555] +[1606] 0.0 0.00 0.00 380 create_spellbook [1606] +----------------------------------------------- + 0.00 0.00 343/343 research_cmd [886] +[1607] 0.0 0.00 0.00 343 rough_amount [1607] +----------------------------------------------- + 0.00 0.00 314/314 make_fighter [424] +[1608] 0.0 0.00 0.00 314 CavalrySkill [1608] +----------------------------------------------- + 0.00 0.00 74/303 cast_combatspell [623] + 0.00 0.00 229/303 free_castorders [1541] +[1609] 0.0 0.00 0.00 303 free_castorder [1609] + 0.00 0.00 220/1936876 free_order [1356] + 0.00 0.00 26/26 free_spellparameter [1700] +----------------------------------------------- + 0.00 0.00 286/286 checkpasswd [1268] +[1610] 0.0 0.00 0.00 286 password_verify [1610] +----------------------------------------------- + 272147 freetokens [1611] + 0.00 0.00 12/267 free_locales [1311] + 0.00 0.00 255/267 unit_getspell [758] +[1611] 0.0 0.00 0.00 267+272147 freetokens [1611] + 272147 freetokens [1611] +----------------------------------------------- + 0.00 0.00 250/250 tpregion [1085] +[1612] 0.0 0.00 0.00 250 real2tp [1612] +----------------------------------------------- + 0.00 0.00 248/248 skillmod [214] +[1613] 0.0 0.00 0.00 248 sm_smithy [1613] +----------------------------------------------- + 0.00 0.00 1/240 kernel_init [1814] + 0.00 0.00 1/240 register_race_description_function [1848] + 0.00 0.00 2/240 register_weapons [1857] + 0.00 0.00 2/240 register_arena [1832] + 0.00 0.00 2/240 register_item_useonother [1778] + 0.00 0.00 3/240 register_item_give [1767] + 0.00 0.00 5/240 register_spells [1251] + 0.00 0.00 5/240 register_buildings [1837] + 0.00 0.00 7/240 register_race_name_function [1740] + 0.00 0.00 9/240 register_resources [1852] + 0.00 0.00 12/240 register_tolua_helpers [1854] + 0.00 0.00 13/240 register_races [1849] + 0.00 0.00 27/240 register_item_use [1699] + 0.00 0.00 151/240 register_spelldata [1250] +[1614] 0.0 0.00 0.00 240 register_function [1614] +----------------------------------------------- + 0.00 0.00 234/234 set_leftship [1134] +[1615] 0.0 0.00 0.00 234 make_leftship [1615] + 0.00 0.00 234/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 233/233 read_password [1619] +[1616] 0.0 0.00 0.00 233 faction_setpassword [1616] +----------------------------------------------- + 0.00 0.00 233/233 read_game [62] +[1617] 0.0 0.00 0.00 233 fhash [1617] +----------------------------------------------- + 0.00 0.00 233/233 read_password [1619] +[1618] 0.0 0.00 0.00 233 password_encode [1618] +----------------------------------------------- + 0.00 0.00 233/233 readfaction [767] +[1619] 0.0 0.00 0.00 233 read_password [1619] + 0.00 0.00 233/233 password_encode [1618] + 0.00 0.00 233/233 faction_setpassword [1616] +----------------------------------------------- + 0.00 0.00 233/233 readfaction [767] +[1620] 0.0 0.00 0.00 233 set_email [1620] + 0.00 0.00 232/232 spc_email_isvalid [1621] +----------------------------------------------- + 0.00 0.00 232/232 set_email [1620] +[1621] 0.0 0.00 0.00 232 spc_email_isvalid [1621] +----------------------------------------------- + 0.00 0.00 232/232 get_addresses [20] +[1622] 0.0 0.00 0.00 232 transfer_seen [1622] +----------------------------------------------- + 0.00 0.00 232/232 writefaction [762] +[1623] 0.0 0.00 0.00 232 write_password [1623] +----------------------------------------------- + 0.00 0.00 1/231 writegame [82] + 0.00 0.00 230/231 report_computer [9] +[1624] 0.0 0.00 0.00 231 eressea_version [1624] +----------------------------------------------- + 0.00 0.00 230/230 report_computer [9] +[1625] 0.0 0.00 0.00 230 reset_translations [1625] +----------------------------------------------- + 0.00 0.00 9/229 do_combatmagic [825] + 0.00 0.00 220/229 magic [157] +[1626] 0.0 0.00 0.00 229 add_castorder [1626] +----------------------------------------------- + 0.00 0.00 214/214 copy_arg [521] +[1627] 0.0 0.00 0.00 214 var_copy_items [1627] +----------------------------------------------- + 0.00 0.00 209/209 free_arg [1371] +[1628] 0.0 0.00 0.00 209 var_free_resources [1628] +----------------------------------------------- + 0.00 0.00 206/206 free_battle [1630] +[1629] 0.0 0.00 0.00 206 battle_free [1629] + 0.00 0.00 1297/1297 free_fighter [1580] + 0.00 0.00 552/552 free_side [1598] +----------------------------------------------- + 0.00 0.00 206/206 do_battle [64] +[1630] 0.0 0.00 0.00 206 free_battle [1630] + 0.00 0.00 206/206 battle_free [1629] +----------------------------------------------- + 0.00 0.00 206/206 aftermath [701] +[1631] 0.0 0.00 0.00 206 reorder_fleeing [1631] +----------------------------------------------- + 0.00 0.00 206/206 copy_arg [521] +[1632] 0.0 0.00 0.00 206 var_copy_resources [1632] +----------------------------------------------- + 0.00 0.00 203/203 tolua_msg_set_int [2937] +[1633] 0.0 0.00 0.00 203 msg_set_int [1633] + 0.00 0.00 203/451 mtype_get_param [1602] +----------------------------------------------- + 0.00 0.00 12/192 spy_cmd [990] + 0.00 0.00 65/192 steal_cmd [766] + 0.00 0.00 115/192 contact_cmd [965] +[1634] 0.0 0.00 0.00 192 can_contact [1634] + 0.00 0.00 132/677 slipthru [1593] +----------------------------------------------- + 0.00 0.00 186/186 a_age [418] +[1635] 0.0 0.00 0.00 186 leftship_age [1635] +----------------------------------------------- + 0.00 0.00 185/185 it_get_or_create [1115] +[1636] 0.0 0.00 0.00 185 it_register [1636] +----------------------------------------------- + 0.00 0.00 3/178 parse_buildings [1131] + 0.00 0.00 3/178 xml_readweapon [1266] + 0.00 0.00 19/178 parse_resources [1086] + 0.00 0.00 29/178 parse_spells [1120] + 0.00 0.00 55/178 xml_readitem [1107] + 0.00 0.00 69/178 parse_races [1104] +[1637] 0.0 0.00 0.00 178 parse_function [1637] + 0.00 0.00 178/465 get_function [1600] +----------------------------------------------- + 0.00 0.00 166/166 create_spell [1639] +[1638] 0.0 0.00 0.00 166 add_spell [1638] +----------------------------------------------- + 0.00 0.00 166/166 parse_spells [1120] +[1639] 0.0 0.00 0.00 166 create_spell [1639] + 0.00 0.00 166/166 add_spell [1638] +----------------------------------------------- + 0.00 0.00 162/162 rt_get_or_create [1139] +[1640] 0.0 0.00 0.00 162 rt_register [1640] +----------------------------------------------- + 0.00 0.00 1/160 move_iceberg [1094] + 0.00 0.00 7/160 attack [84] + 0.00 0.00 12/160 aftermath [701] + 0.00 0.00 15/160 drifting_ships [490] + 0.00 0.00 29/160 sail [181] + 0.00 0.00 96/160 sinkships [475] +[1641] 0.0 0.00 0.00 160 damage_ship [1641] +----------------------------------------------- + 0.00 0.00 136/136 a_read_i [390] +[1642] 0.0 0.00 0.00 136 a_readstring [1642] +----------------------------------------------- + 0.00 0.00 133/133 caught_target [1003] +[1643] 0.0 0.00 0.00 133 present [1643] +----------------------------------------------- + 0.00 0.00 121/121 lua_callspell [1645] +[1644] 0.0 0.00 0.00 121 co_get_caster [1644] +----------------------------------------------- + 0.00 0.00 2/121 do_fumble [1062] + 0.00 0.00 119/121 magic [157] +[1645] 0.0 0.00 0.00 121 lua_callspell [1645] + 0.00 0.00 121/121 co_get_caster [1644] + 0.00 0.00 121/608 co_get_region [1594] +----------------------------------------------- + 0.00 0.00 121/121 tolua_msg_set_unit [2941] +[1646] 0.0 0.00 0.00 121 msg_set_unit [1646] + 0.00 0.00 121/451 mtype_get_param [1602] +----------------------------------------------- + 0.00 0.00 118/118 init_translations [1033] +[1647] 0.0 0.00 0.00 118 keyword_key [1647] + 0.00 0.00 118/2009097 keyword [1355] +----------------------------------------------- + 0.00 0.00 106/106 a_read_i [390] +[1648] 0.0 0.00 0.00 106 a_readkey [1648] + 0.00 0.00 106/58518 a_readint [1448] +----------------------------------------------- + 0.00 0.00 106/106 add_skills [1667] +[1649] 0.0 0.00 0.00 106 equipment_setskill [1649] +----------------------------------------------- + 0.00 0.00 99/99 magic [157] +[1650] 0.0 0.00 0.00 99 spl_costtyp [1650] +----------------------------------------------- + 0.00 0.00 9/97 kill_troop [532] + 0.00 0.00 88/97 gift_items [891] +[1651] 0.0 0.00 0.00 97 i_merge [1651] + 0.00 0.00 86/374425 i_free [1400] + 0.00 0.00 86/257723 i_remove [1407] +----------------------------------------------- + 0.00 0.00 97/97 piracy_cmd [660] +[1652] 0.0 0.00 0.00 97 mk_piracy [1652] + 0.00 0.00 97/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 97/97 a_free [558] +[1653] 0.0 0.00 0.00 97 piracy_done [1653] +----------------------------------------------- + 0.00 0.00 97/97 a_new [1376] +[1654] 0.0 0.00 0.00 97 piracy_init [1654] +----------------------------------------------- + 0.00 0.00 88/88 init_translations [1033] +[1655] 0.0 0.00 0.00 88 parameter_key [1655] +----------------------------------------------- + 0.00 0.00 21/74 sp_kampfzauber [957] + 0.00 0.00 53/74 sp_dragonodem [627] +[1656] 0.0 0.00 0.00 74 get_force [1656] +----------------------------------------------- + 0.00 0.00 21/74 sp_kampfzauber [957] + 0.00 0.00 53/74 sp_dragonodem [627] +[1657] 0.0 0.00 0.00 74 spell_damage [1657] +----------------------------------------------- + 0.00 0.00 12/73 add_subsets [1669] + 0.00 0.00 61/73 parse_equipment [1170] +[1658] 0.0 0.00 0.00 73 create_equipment [1658] +----------------------------------------------- + 0.00 0.00 72/72 xml_readitem [1107] +[1659] 0.0 0.00 0.00 72 default_score [1659] +----------------------------------------------- + 0.00 0.00 68/68 a_read_i [390] +[1660] 0.0 0.00 0.00 68 a_readchars [1660] +----------------------------------------------- + 0.00 0.00 68/68 rc_get_or_create [1105] +[1661] 0.0 0.00 0.00 68 rc_create [1661] +----------------------------------------------- + 0.00 0.00 67/67 parse_races [1104] +[1662] 0.0 0.00 0.00 67 parse_ai [1662] + 0.00 0.00 268/6576 xml_bvalue [1532] + 0.00 0.00 134/5453 xml_ivalue [1533] + 0.00 0.00 67/501 xml_fvalue [1599] +----------------------------------------------- + 0.00 0.00 66/66 a_write [299] +[1663] 0.0 0.00 0.00 66 a_writechars [1663] +----------------------------------------------- + 0.00 0.00 65/65 add_items [1169] +[1664] 0.0 0.00 0.00 65 equipment_setitem [1664] +----------------------------------------------- + 0.00 0.00 2/65 default_order [902] + 0.00 0.00 2/65 disable_feature [771] + 0.00 0.00 61/65 json_keyword [1127] +[1665] 0.0 0.00 0.00 65 findkeyword [1665] +----------------------------------------------- + 0.00 0.00 61/61 parse_equipment [1170] +[1666] 0.0 0.00 0.00 61 add_callbacks [1666] + 0.00 0.00 6/465 get_function [1600] + 0.00 0.00 6/6 equipment_setcallback [1747] +----------------------------------------------- + 0.00 0.00 61/61 parse_equipment [1170] +[1667] 0.0 0.00 0.00 61 add_skills [1667] + 0.00 0.00 106/1041 findskill [1586] + 0.00 0.00 106/106 equipment_setskill [1649] +----------------------------------------------- + 0.00 0.00 61/61 parse_equipment [1170] +[1668] 0.0 0.00 0.00 61 add_spells [1668] + 0.00 0.00 24/11052 find_spell [1513] + 0.00 0.00 24/5453 xml_ivalue [1533] + 0.00 0.00 24/24 equipment_addspell [1702] +----------------------------------------------- + 0.00 0.00 61/61 parse_equipment [1170] +[1669] 0.0 0.00 0.00 61 add_subsets [1669] + 0.00 0.00 12/73 create_equipment [1658] +----------------------------------------------- + 0.00 0.00 58/58 tolua_dict_get [1218] +[1670] 0.0 0.00 0.00 58 dict_get [1670] +----------------------------------------------- + 0.00 0.00 58/58 tolua_dict_get [1218] +[1671] 0.0 0.00 0.00 58 dict_name [1671] +----------------------------------------------- + 0.00 0.00 58/58 add_resource [1162] +[1672] 0.0 0.00 0.00 58 rmt_get [1672] +----------------------------------------------- + 0.00 0.00 57/57 terraform_region [932] +[1673] 0.0 0.00 0.00 57 free_land [1673] +----------------------------------------------- + 0.00 0.00 3/56 add_proc_postregion [1761] + 0.00 0.00 3/56 add_proc_unit [1762] + 0.00 0.00 8/56 add_proc_region [1733] + 0.00 0.00 13/56 add_proc_global [1716] + 0.00 0.00 29/56 add_proc_order [1692] +[1674] 0.0 0.00 0.00 56 add_proc [1674] +----------------------------------------------- + 0.00 0.00 56/56 a_new [1376] +[1675] 0.0 0.00 0.00 56 dict_init [1675] +----------------------------------------------- + 0.00 0.00 56/56 a_read_i [390] +[1676] 0.0 0.00 0.00 56 dict_read [1676] +----------------------------------------------- + 0.00 0.00 56/56 a_write [299] +[1677] 0.0 0.00 0.00 56 dict_write [1677] +----------------------------------------------- + 0.00 0.00 1/55 chaos_register [1797] + 0.00 0.00 1/55 wormholes_register [1895] + 0.00 0.00 1/55 register_borders [1835] + 0.00 0.00 1/55 register_arena [1832] + 0.00 0.00 1/55 register_artrewards [1833] + 0.00 0.00 2/55 register_tolua_helpers [1854] + 0.00 0.00 2/55 register_spells [1251] + 0.00 0.00 4/55 register_museum [1845] + 0.00 0.00 42/55 register_attributes [1834] +[1678] 0.0 0.00 0.00 55 at_register [1678] + 0.00 0.00 55/251874 __at_hashkey [3279] +----------------------------------------------- + 0.00 0.00 54/54 parse_resources [1086] +[1679] 0.0 0.00 0.00 54 it_set_appearance [1679] +----------------------------------------------- + 0.00 0.00 18/52 json_terrains [1190] + 0.00 0.00 34/52 parse_ships [1305] +[1680] 0.0 0.00 0.00 52 get_or_create_terrain [1680] + 0.00 0.00 52/178322 terrain_find_i [1421] +----------------------------------------------- + 0.00 0.00 51/51 report_summary [614] +[1681] 0.0 0.00 0.00 51 rcomp [1681] +----------------------------------------------- + 0.00 0.00 48/48 terraform_region [932] +[1682] 0.0 0.00 0.00 48 get_maxluxuries [1682] +----------------------------------------------- + 0.00 0.00 48/48 terraform_region [932] +[1683] 0.0 0.00 0.00 48 region_setname [1683] +----------------------------------------------- + 0.00 0.00 1/48 tolua_unit_add_order [1276] + 0.00 0.00 47/48 give_peasants [1060] +[1684] 0.0 0.00 0.00 48 unit_addorder [1684] +----------------------------------------------- + 0.00 0.00 47/47 tolua_msg_set_region [2939] +[1685] 0.0 0.00 0.00 47 msg_set_region [1685] + 0.00 0.00 47/451 mtype_get_param [1602] +----------------------------------------------- + 0.00 0.00 1/44 register_magicresistance [1844] + 0.00 0.00 1/44 register_flyingship [1840] + 0.00 0.00 2/44 register_spells [1251] + 0.00 0.00 3/44 register_shipcurse [1853] + 0.00 0.00 4/44 register_buildingcurse [1836] + 0.00 0.00 14/44 register_unitcurse [1856] + 0.00 0.00 19/44 register_regioncurse [1850] +[1686] 0.0 0.00 0.00 44 ct_register [1686] +----------------------------------------------- + 0.00 0.00 42/42 report_summary [614] +[1687] 0.0 0.00 0.00 42 pcomp [1687] +----------------------------------------------- + 0.00 0.00 33/33 set_param [1689] +[1688] 0.0 0.00 0.00 33 pack_keyval [1688] +----------------------------------------------- + 0.00 0.00 3/33 parse_param [1765] + 0.00 0.00 30/33 config_set [444] +[1689] 0.0 0.00 0.00 33 set_param [1689] + 0.00 0.00 33/33 pack_keyval [1688] +----------------------------------------------- + 0.00 0.00 7/32 translation_init [1890] + 0.00 0.00 25/32 register_reports [1851] +[1690] 0.0 0.00 0.00 32 add_function [1690] +----------------------------------------------- + 0.00 0.00 7/30 attrib_allocation [914] + 0.00 0.00 23/30 allocate_resource [752] +[1691] 0.0 0.00 0.00 30 limit_seeds [1691] +----------------------------------------------- + 0.00 0.00 29/29 init_processor [1310] +[1692] 0.0 0.00 0.00 29 add_proc_order [1692] + 0.00 0.00 29/11194781 keyword_disabled [1348] + 0.00 0.00 29/56 add_proc [1674] +----------------------------------------------- + 0.00 0.00 29/29 json_prefixes [1812] +[1693] 0.0 0.00 0.00 29 add_raceprefix [1693] +----------------------------------------------- + 0.00 0.00 29/29 json_terrain [1189] +[1694] 0.0 0.00 0.00 29 json_terrain_production [1694] +----------------------------------------------- + 0.00 0.00 28/28 destroy_curse [1697] +[1695] 0.0 0.00 0.00 28 cunhash [1695] +----------------------------------------------- + 0.00 0.00 28/28 a_free [558] +[1696] 0.0 0.00 0.00 28 curse_done [1696] + 0.00 0.00 28/28 destroy_curse [1697] +----------------------------------------------- + 0.00 0.00 28/28 curse_done [1696] +[1697] 0.0 0.00 0.00 28 destroy_curse [1697] + 0.00 0.00 28/28 cunhash [1695] +----------------------------------------------- + 0.00 0.00 27/27 bt_get_or_create [1114] +[1698] 0.0 0.00 0.00 27 bt_register [1698] +----------------------------------------------- + 0.00 0.00 1/27 register_tolua_helpers [1854] + 0.00 0.00 1/27 register_demonseye [1839] + 0.00 0.00 1/27 register_arena [1832] + 0.00 0.00 2/27 register_xerewards [1858] + 0.00 0.00 2/27 register_artrewards [1833] + 0.00 0.00 3/27 register_museum [1845] + 0.00 0.00 7/27 register_itemfunctions [1842] + 0.00 0.00 10/27 register_resources [1852] +[1699] 0.0 0.00 0.00 27 register_item_use [1699] + 0.00 0.00 27/240 register_function [1614] +----------------------------------------------- + 0.00 0.00 26/26 free_castorder [1609] +[1700] 0.0 0.00 0.00 26 free_spellparameter [1700] +----------------------------------------------- + 0.00 0.00 25/25 set_new_dragon_target [486] +[1701] 0.0 0.00 0.00 25 make_targetregion [1701] + 0.00 0.00 25/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 24/24 add_spells [1668] +[1702] 0.0 0.00 0.00 24 equipment_addspell [1702] + 0.00 0.00 24/1524 spellbook_add [1572] + 0.00 0.00 7/380 create_spellbook [1606] +----------------------------------------------- + 0.00 0.00 23/23 xml_readweapon [1266] +[1703] 0.0 0.00 0.00 23 new_weapontype [1703] + 0.00 0.00 23/2379316 resource2weapon [1353] +----------------------------------------------- + 0.00 0.00 22/22 verify_targets [1027] +[1704] 0.0 0.00 0.00 22 verify_ship [1704] + 0.00 0.00 22/28818 findship [1483] +----------------------------------------------- + 0.00 0.00 19/19 register_cr [1838] +[1705] 0.0 0.00 0.00 19 tsf_register [1705] +----------------------------------------------- + 0.00 0.00 18/18 handle_event [1363] +[1706] 0.0 0.00 0.00 18 handle_triggers [1706] + 0.00 0.00 18/18 timeout_handle [1709] + 0.00 0.00 1/1 caldera_handle [1794] +----------------------------------------------- + 0.00 0.00 18/18 json_terrain [1189] +[1707] 0.0 0.00 0.00 18 json_flags [1707] +----------------------------------------------- + 0.00 0.00 18/18 register_reports [1851] +[1708] 0.0 0.00 0.00 18 register_argtype [1708] +----------------------------------------------- + 0.00 0.00 18/18 handle_triggers [1706] +[1709] 0.0 0.00 0.00 18 timeout_handle [1709] +----------------------------------------------- + 0.00 0.00 18/18 t_new [1546] +[1710] 0.0 0.00 0.00 18 timeout_init [1710] +----------------------------------------------- + 18 write_triggers [954] +[1711] 0.0 0.00 0.00 18 timeout_write [1711] + 18 write_triggers [954] +----------------------------------------------- + 0.00 0.00 15/15 xml_readpotion [1714] +[1712] 0.0 0.00 0.00 15 new_potiontype [1712] + 0.00 0.00 15/1582 resource2potion [1569] + 0.00 0.00 15/15 pt_register [1713] +----------------------------------------------- + 0.00 0.00 15/15 new_potiontype [1712] +[1713] 0.0 0.00 0.00 15 pt_register [1713] +----------------------------------------------- + 0.00 0.00 15/15 xml_readitem [1107] +[1714] 0.0 0.00 0.00 15 xml_readpotion [1714] + 0.00 0.00 15/5453 xml_ivalue [1533] + 0.00 0.00 15/15 new_potiontype [1712] +----------------------------------------------- + 0.00 0.00 1/14 register_arena [1832] + 0.00 0.00 1/14 register_xmas [1859] + 0.00 0.00 12/14 register_triggers [1855] +[1715] 0.0 0.00 0.00 14 tt_register [1715] +----------------------------------------------- + 0.00 0.00 13/13 init_processor [1310] +[1716] 0.0 0.00 0.00 13 add_proc_global [1716] + 0.00 0.00 13/56 add_proc [1674] +----------------------------------------------- + 0.00 0.00 13/13 read_planes [1164] +[1717] 0.0 0.00 0.00 13 getplanebyid [1717] +----------------------------------------------- + 0.00 0.00 13/13 move_iceberg [1094] +[1718] 0.0 0.00 0.00 13 make_iceberg [1718] + 0.00 0.00 13/779868 a_new [1376] +----------------------------------------------- + 13 read_triggers [798] +[1719] 0.0 0.00 0.00 13 timeout_read [1719] + 13 read_triggers [798] +----------------------------------------------- + 0.00 0.00 2/12 remove_building [1153] + 0.00 0.00 10/12 renumber_cmd [780] +[1720] 0.0 0.00 0.00 12 bunhash [1720] +----------------------------------------------- + 0.00 0.00 12/12 t_new [1546] +[1721] 0.0 0.00 0.00 12 changefaction_init [1721] +----------------------------------------------- + 0.00 0.00 12/12 volcano_destruction [1022] +[1722] 0.0 0.00 0.00 12 make_reduceproduction [1722] + 0.00 0.00 12/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 12/12 changerace_write [1287] +[1723] 0.0 0.00 0.00 12 write_race_reference [1723] +----------------------------------------------- + 0.00 0.00 11/11 koor_distance [476] +[1724] 0.0 0.00 0.00 11 koor_distance_wrap_xy [1724] +----------------------------------------------- + 0.00 0.00 11/11 attrib_allocation [914] +[1725] 0.0 0.00 0.00 11 produce_seeds [1725] +----------------------------------------------- + 0.00 0.00 11/11 register_xmlreader [1860] +[1726] 0.0 0.00 0.00 11 xml_register_callback [1726] +----------------------------------------------- + 0.00 0.00 11/11 parse_races [1104] +[1727] 0.0 0.00 0.00 11 xml_spell [1727] + 0.00 0.00 9/11052 find_spell [1513] +----------------------------------------------- + 0.00 0.00 10/10 cast_cmd [760] +[1728] 0.0 0.00 0.00 10 rel_to_abs [1728] + 0.00 0.00 5/5 ursprung_x [1754] + 0.00 0.00 5/221723 plane_center_x [1411] + 0.00 0.00 5/5 ursprung_y [1755] + 0.00 0.00 5/221723 plane_center_y [1412] +----------------------------------------------- + 0.00 0.00 10/10 nrt_register [883] +[1729] 0.0 0.00 0.00 10 section_add [1729] +----------------------------------------------- + 0.00 0.00 1/9 load_inifile [1293] + 0.00 0.00 1/9 parse_inifile [1317] + 0.00 0.00 1/9 writepasswd [1074] + 0.00 0.00 2/9 writeturn [1253] + 0.00 0.00 2/9 report_summary [614] + 0.00 0.00 2/9 score [23] +[1730] 0.0 0.00 0.00 9 basepath [1730] +----------------------------------------------- + 0.00 0.00 9/9 a_new [1376] +[1731] 0.0 0.00 0.00 9 init_resourcelimit [1731] +----------------------------------------------- + 0.00 0.00 1/9 register_museum [1845] + 0.00 0.00 3/9 register_borders [1835] + 0.00 0.00 5/9 register_attributes [1834] +[1732] 0.0 0.00 0.00 9 register_bordertype [1732] +----------------------------------------------- + 0.00 0.00 8/8 init_processor [1310] +[1733] 0.0 0.00 0.00 8 add_proc_region [1733] + 0.00 0.00 8/56 add_proc [1674] +----------------------------------------------- + 0.00 0.00 8/8 xml_readarmor [1736] +[1734] 0.0 0.00 0.00 8 new_armortype [1734] +----------------------------------------------- + 0.00 0.00 8/8 tolua_unit_get_hp [3117] +[1735] 0.0 0.00 0.00 8 unit_gethp [1735] +----------------------------------------------- + 0.00 0.00 8/8 xml_readitem [1107] +[1736] 0.0 0.00 0.00 8 xml_readarmor [1736] + 0.00 0.00 24/501 xml_fvalue [1599] + 0.00 0.00 16/6576 xml_bvalue [1532] + 0.00 0.00 8/5453 xml_ivalue [1533] + 0.00 0.00 8/8 new_armortype [1734] +----------------------------------------------- + 0.00 0.00 7/7 has_ao_healing [1269] +[1737] 0.0 0.00 0.00 7 i_findc [1737] +----------------------------------------------- + 0.00 0.00 7/7 new_luxurytype [1739] +[1738] 0.0 0.00 0.00 7 lt_register [1738] +----------------------------------------------- + 0.00 0.00 7/7 xml_readluxury [1745] +[1739] 0.0 0.00 0.00 7 new_luxurytype [1739] + 0.00 0.00 7/21500 resource2luxury [1499] + 0.00 0.00 7/7 lt_register [1738] +----------------------------------------------- + 0.00 0.00 7/7 register_names [1846] +[1740] 0.0 0.00 0.00 7 register_race_name_function [1740] + 0.00 0.00 7/240 register_function [1614] +----------------------------------------------- + 0.00 0.00 7/7 parse_resources [1086] +[1741] 0.0 0.00 0.00 7 rmt_create [1741] +----------------------------------------------- + 0.00 0.00 7/7 equipment_done [1802] +[1742] 0.0 0.00 0.00 7 spellbook_clear [1742] +----------------------------------------------- + 0.00 0.00 7/7 parse_ships [1305] +[1743] 0.0 0.00 0.00 7 st_get_or_create [1743] + 0.00 0.00 7/19089 st_find_i [1501] +----------------------------------------------- + 0.00 0.00 1/7 renumber_cmd [780] + 0.00 0.00 6/7 remove_ship [1748] +[1744] 0.0 0.00 0.00 7 sunhash [1744] +----------------------------------------------- + 0.00 0.00 7/7 xml_readitem [1107] +[1745] 0.0 0.00 0.00 7 xml_readluxury [1745] + 0.00 0.00 7/5453 xml_ivalue [1533] + 0.00 0.00 7/7 new_luxurytype [1739] +----------------------------------------------- + 0.00 0.00 6/6 t_new [1546] +[1746] 0.0 0.00 0.00 6 changerace_init [1746] +----------------------------------------------- + 0.00 0.00 6/6 add_callbacks [1666] +[1747] 0.0 0.00 0.00 6 equipment_setcallback [1747] +----------------------------------------------- + 0.00 0.00 1/6 drifting_ships [490] + 0.00 0.00 5/6 sinkships [475] +[1748] 0.0 0.00 0.00 6 remove_ship [1748] + 0.00 0.00 6/1342832 handle_event [1363] + 0.00 0.00 6/7 sunhash [1744] +----------------------------------------------- + 0.00 0.00 2/5 register_gmcmd [1841] + 0.00 0.00 3/5 register_attributes [1834] +[1749] 0.0 0.00 0.00 5 at_deprecate [1749] + 0.00 0.00 5/251874 __at_hashkey [3279] +----------------------------------------------- + 0.00 0.00 5/5 process [7] +[1750] 0.0 0.00 0.00 5 free_group [1750] +----------------------------------------------- + 0.00 0.00 1/5 init_data [790] + 0.00 0.00 4/5 json_config [464] +[1751] 0.0 0.00 0.00 5 reset_locales [1751] +----------------------------------------------- + 0.00 0.00 1/5 create_newfamiliar [1288] + 0.00 0.00 4/5 sp_charmingsong [993] +[1752] 0.0 0.00 0.00 5 trigger_killunit [1752] + 0.00 0.00 5/3113 t_new [1546] +----------------------------------------------- + 0.00 0.00 1/5 use_bloodpotion [935] + 0.00 0.00 2/5 sp_charmingsong [993] + 0.00 0.00 2/5 do_fumble [1062] +[1753] 0.0 0.00 0.00 5 trigger_timeout [1753] + 0.00 0.00 5/3113 t_new [1546] +----------------------------------------------- + 0.00 0.00 5/5 rel_to_abs [1728] +[1754] 0.0 0.00 0.00 5 ursprung_x [1754] +----------------------------------------------- + 0.00 0.00 5/5 rel_to_abs [1728] +[1755] 0.0 0.00 0.00 5 ursprung_y [1755] +----------------------------------------------- + 0.00 0.00 4/4 parse_ids [852] +[1756] 0.0 0.00 0.00 4 intlist_add [1756] +----------------------------------------------- + 0.00 0.00 4/4 parse_ids [852] +[1757] 0.0 0.00 0.00 4 intlist_init [1757] +----------------------------------------------- + 0.00 0.00 4/4 config_get_locales [1161] +[1758] 0.0 0.00 0.00 4 nextlocale [1758] +----------------------------------------------- + 0.00 0.00 4/4 curse_read [770] +[1759] 0.0 0.00 0.00 4 read_skill [1759] +----------------------------------------------- + 0.00 0.00 2/4 chaosterrain [1213] + 0.00 0.00 2/4 init_terrains_translation [1129] +[1760] 0.0 0.00 0.00 4 terrains [1760] +----------------------------------------------- + 0.00 0.00 3/3 init_processor [1310] +[1761] 0.0 0.00 0.00 3 add_proc_postregion [1761] + 0.00 0.00 3/56 add_proc [1674] +----------------------------------------------- + 0.00 0.00 3/3 init_processor [1310] +[1762] 0.0 0.00 0.00 3 add_proc_unit [1762] + 0.00 0.00 3/56 add_proc [1674] +----------------------------------------------- + 0.00 0.00 3/3 give_control_cmd [287] +[1763] 0.0 0.00 0.00 3 give_control [1763] + 0.00 0.00 3/18963 ship_set_owner [1505] +----------------------------------------------- + 0.00 0.00 3/3 join_group [1083] +[1764] 0.0 0.00 0.00 3 init_group [1764] + 0.00 0.00 98/55547 ally_add [1452] +----------------------------------------------- + 0.00 0.00 3/3 parse_races [1104] +[1765] 0.0 0.00 0.00 3 parse_param [1765] + 0.00 0.00 3/33 set_param [1689] +----------------------------------------------- + 0.00 0.00 3/3 xml_readweapon [1266] +[1766] 0.0 0.00 0.00 3 racelist_insert [1766] +----------------------------------------------- + 0.00 0.00 1/3 register_tolua_helpers [1854] + 0.00 0.00 1/3 register_demonseye [1839] + 0.00 0.00 1/3 register_resources [1852] +[1767] 0.0 0.00 0.00 3 register_item_give [1767] + 0.00 0.00 3/240 register_function [1614] +----------------------------------------------- + 0.00 0.00 1/3 register_cr [1838] + 0.00 0.00 2/3 register_nr [1847] +[1768] 0.0 0.00 0.00 3 register_reporttype [1768] +----------------------------------------------- + 0.00 0.00 3/3 curse_write [930] +[1769] 0.0 0.00 0.00 3 write_skill [1769] +----------------------------------------------- + 0.00 0.00 2/2 move_blocked [283] +[1770] 0.0 0.00 0.00 2 b_blockquestportal [1770] +----------------------------------------------- + 0.00 0.00 2/2 see_border [1440] +[1771] 0.0 0.00 0.00 2 b_fvisible [1771] +----------------------------------------------- + 0.00 0.00 2/2 describe [35] +[1772] 0.0 0.00 0.00 2 b_opaque [1772] +----------------------------------------------- + 0.00 0.00 2/2 tolua_write_summary [38] +[1773] 0.0 0.00 0.00 2 free_summary [1773] +----------------------------------------------- + 0.00 0.00 2/2 t_new [1546] +[1774] 0.0 0.00 0.00 2 giveitem_init [1774] +----------------------------------------------- + 0.00 0.00 1/2 allocate_resource [752] + 0.00 0.00 1/2 attrib_allocation [914] +[1775] 0.0 0.00 0.00 2 limit_mallornseeds [1775] +----------------------------------------------- + 0.00 0.00 1/2 log_to_file [1819] + 0.00 0.00 1/2 log_open [1817] +[1776] 0.0 0.00 0.00 2 log_create [1776] +----------------------------------------------- + 0.00 0.00 1/2 init_smithy [1312] + 0.00 0.00 1/2 xml_readconstruction [1183] +[1777] 0.0 0.00 0.00 2 make_skillmod [1777] + 0.00 0.00 2/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 1/2 register_resources [1852] + 0.00 0.00 1/2 register_artrewards [1833] +[1778] 0.0 0.00 0.00 2 register_item_useonother [1778] + 0.00 0.00 2/240 register_function [1614] +----------------------------------------------- + 0.00 0.00 2/2 change_resource [240] +[1779] 0.0 0.00 0.00 2 res_changehp [1779] +----------------------------------------------- + 0.00 0.00 1/2 tolua_bind_open [1866] + 0.00 0.00 1/2 lua_init [1316] +[1780] 0.0 0.00 0.00 2 tolua_eressea_open [1780] +----------------------------------------------- + 0.00 0.00 2/2 luaopen_eressea [2406] +[1781] 0.0 0.00 0.00 2 tolua_reg_types_eressea [1781] +----------------------------------------------- + 0.00 0.00 2/2 lua_init [1316] +[1782] 0.0 0.00 0.00 2 tolua_unit_open [1782] +----------------------------------------------- + 0.00 0.00 2/2 sp_charmingsong [993] +[1783] 0.0 0.00 0.00 2 trigger_changefaction [1783] + 0.00 0.00 2/3113 t_new [1546] +----------------------------------------------- + 0.00 0.00 2/2 parse_args [1825] +[1784] 0.0 0.00 0.00 2 verbosity_to_flags [1784] +----------------------------------------------- + 0.00 0.00 2/2 a_write [299] +[1785] 0.0 0.00 0.00 2 wormhole_write [1785] + 0.00 0.00 2/1119 write_region_reference [1583] +----------------------------------------------- + 0.00 0.00 1/1 a_free [558] +[1786] 0.0 0.00 0.00 1 a_finalizestring [1786] +----------------------------------------------- + 0.00 0.00 1/1 a_write [299] +[1787] 0.0 0.00 0.00 1 a_writekeys [1787] +----------------------------------------------- + 0.00 0.00 1/1 spy_message [1038] +[1788] 0.0 0.00 0.00 1 add_seen_faction [1788] + 0.00 0.00 1/353788 add_seen_faction_i [1401] +----------------------------------------------- + 0.00 0.00 1/1 ageing [185] +[1789] 0.0 0.00 0.00 1 age_borders [1789] +----------------------------------------------- + 0.00 0.00 1/1 kernel_done [1813] +[1790] 0.0 0.00 0.00 1 attrib_done [1790] +----------------------------------------------- + 0.00 0.00 1/1 read_borders [706] +[1791] 0.0 0.00 0.00 1 b_read [1791] +----------------------------------------------- + 0.00 0.00 1/1 write_borders [1897] +[1792] 0.0 0.00 0.00 1 b_write [1792] +----------------------------------------------- + 0.00 0.00 1/1 main [541] +[1793] 0.0 0.00 0.00 1 bind_monsters [1793] +----------------------------------------------- + 0.00 0.00 1/1 handle_triggers [1706] +[1794] 0.0 0.00 0.00 1 caldera_handle [1794] +----------------------------------------------- + 0.00 0.00 1/1 write_triggers [954] +[1795] 0.0 0.00 0.00 1 caldera_write [1795] + 0.00 0.00 1/642406 write_building_reference [1383] +----------------------------------------------- + 0.00 0.00 1/1 game_done [542] +[1796] 0.0 0.00 0.00 1 calendar_cleanup [1796] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1797] 0.0 0.00 0.00 1 chaos_register [1797] + 0.00 0.00 1/55 at_register [1678] +----------------------------------------------- + 0.00 0.00 1/1 kernel_done [1813] +[1798] 0.0 0.00 0.00 1 crmessage_done [1798] +----------------------------------------------- + 0.00 0.00 1/1 kernel_done [1813] +[1799] 0.0 0.00 0.00 1 curses_done [1799] +----------------------------------------------- + 0.00 0.00 1/1 attack [84] +[1800] 0.0 0.00 0.00 1 dazzle [1800] +----------------------------------------------- + 0.00 0.00 1/1 disable_feature [771] +[1801] 0.0 0.00 0.00 1 enable_keyword [1801] +----------------------------------------------- + 0.00 0.00 1/1 kernel_done [1813] +[1802] 0.0 0.00 0.00 1 equipment_done [1802] + 0.00 0.00 7/7 spellbook_clear [1742] +----------------------------------------------- + 0.00 0.00 1/1 curse_age [1538] +[1803] 0.0 0.00 0.00 1 flyingship_age [1803] +----------------------------------------------- + 0.00 0.00 1/1 game_done [542] +[1804] 0.0 0.00 0.00 1 free_functions [1804] +----------------------------------------------- + 0.00 0.00 1/1 translation_done [1889] +[1805] 0.0 0.00 0.00 1 free_functions [1805] +----------------------------------------------- + 0.00 0.00 1/1 destroyfaction [392] +[1806] 0.0 0.00 0.00 1 funhash [1806] +----------------------------------------------- + 0.00 0.00 1/1 parse_args [1825] +[1807] 0.0 0.00 0.00 1 get_arg [1807] +----------------------------------------------- + 0.00 0.00 1/1 wormhole_age [1130] +[1808] 0.0 0.00 0.00 1 has_limited_skills [1808] +----------------------------------------------- + 0.00 0.00 1/1 read_game [62] +[1809] 0.0 0.00 0.00 1 init_genrand [1809] +----------------------------------------------- + 0.00 0.00 1/1 json_config [464] +[1810] 0.0 0.00 0.00 1 init_terrains [1810] + 0.00 0.00 14/178270 get_terrain [1423] +----------------------------------------------- + 0.00 0.00 1/1 kernel_done [1813] +[1811] 0.0 0.00 0.00 1 item_done [1811] + 0.00 0.00 1/10475 i_freeall [1515] +----------------------------------------------- + 0.00 0.00 1/1 json_config [464] +[1812] 0.0 0.00 0.00 1 json_prefixes [1812] + 0.00 0.00 29/29 add_raceprefix [1693] +----------------------------------------------- + 0.00 0.00 1/1 game_done [542] +[1813] 0.0 0.00 0.00 1 kernel_done [1813] + 0.00 0.00 1/1 xml_done [1898] + 0.00 0.00 1/1 equipment_done [1802] + 0.00 0.00 1/1 message_done [1822] + 0.00 0.00 1/1 item_done [1811] + 0.00 0.00 1/1 attrib_done [1790] + 0.00 0.00 1/1 crmessage_done [1798] + 0.00 0.00 1/1 curses_done [1799] + 0.00 0.00 1/1 reports_done [1861] + 0.00 0.00 1/1 translation_done [1889] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1814] 0.0 0.00 0.00 1 kernel_init [1814] + 0.00 0.00 1/1 translation_init [1890] + 0.00 0.00 1/1 mt_clear [1823] + 0.00 0.00 1/240 register_function [1614] +----------------------------------------------- + 0.00 0.00 1/1 main [541] +[1815] 0.0 0.00 0.00 1 locale_init [1815] +----------------------------------------------- + 0.00 0.00 1/1 main [541] +[1816] 0.0 0.00 0.00 1 log_close [1816] +----------------------------------------------- + 0.00 0.00 1/1 parse_args [1825] +[1817] 0.0 0.00 0.00 1 log_open [1817] + 0.00 0.00 1/1 log_rotate [1818] + 0.00 0.00 1/2 log_create [1776] +----------------------------------------------- + 0.00 0.00 1/1 log_open [1817] +[1818] 0.0 0.00 0.00 1 log_rotate [1818] +----------------------------------------------- + 0.00 0.00 1/1 parse_args [1825] +[1819] 0.0 0.00 0.00 1 log_to_file [1819] + 0.00 0.00 1/2 log_create [1776] +----------------------------------------------- + 0.00 0.00 1/1 main [541] +[1820] 0.0 0.00 0.00 1 lua_done [1820] +----------------------------------------------- + 0.00 0.00 1/1 init_smithy [1312] +[1821] 0.0 0.00 0.00 1 make_matmod [1821] + 0.00 0.00 1/779868 a_new [1376] +----------------------------------------------- + 0.00 0.00 1/1 kernel_done [1813] +[1822] 0.0 0.00 0.00 1 message_done [1822] +----------------------------------------------- + 0.00 0.00 1/1 kernel_init [1814] +[1823] 0.0 0.00 0.00 1 mt_clear [1823] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1824] 0.0 0.00 0.00 1 openlibs [1824] +----------------------------------------------- + 0.00 0.00 1/1 main [541] +[1825] 0.0 0.00 0.00 1 parse_args [1825] + 0.00 0.00 2/2 verbosity_to_flags [1784] + 0.00 0.00 1/1 get_arg [1807] + 0.00 0.00 1/1 log_open [1817] + 0.00 0.00 1/1 log_to_file [1819] +----------------------------------------------- + 0.00 0.00 1/1 read_xml [791] +[1826] 0.0 0.00 0.00 1 parse_rules [1826] +----------------------------------------------- + 0.00 0.00 1/1 read_xml [791] +[1827] 0.0 0.00 0.00 1 parse_spellbooks [1827] + 0.00 0.00 326/5453 xml_ivalue [1533] + 0.00 0.00 326/11052 find_spell [1513] + 0.00 0.00 326/1524 spellbook_add [1572] + 0.00 0.00 6/3171 get_spellbook [1544] +----------------------------------------------- + 0.00 0.00 1/1 plan_monsters [52] +[1828] 0.0 0.00 0.00 1 pathfinder_cleanup [1828] +----------------------------------------------- + 0.00 0.00 1/1 attrib_allocation [914] +[1829] 0.0 0.00 0.00 1 produce_mallornseeds [1829] +----------------------------------------------- + 0.00 0.00 1/1 read_game [62] +[1830] 0.0 0.00 0.00 1 read_alliances [1830] +----------------------------------------------- + 0.00 0.00 1/1 read_reference [726] +[1831] 0.0 0.00 0.00 1 read_building_reference [1831] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1832] 0.0 0.00 0.00 1 register_arena [1832] + 0.00 0.00 2/240 register_function [1614] + 0.00 0.00 1/55 at_register [1678] + 0.00 0.00 1/27 register_item_use [1699] + 0.00 0.00 1/14 tt_register [1715] +----------------------------------------------- + 0.00 0.00 1/1 register_itemtypes [1843] +[1833] 0.0 0.00 0.00 1 register_artrewards [1833] + 0.00 0.00 2/27 register_item_use [1699] + 0.00 0.00 1/55 at_register [1678] + 0.00 0.00 1/2 register_item_useonother [1778] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1834] 0.0 0.00 0.00 1 register_attributes [1834] + 0.00 0.00 42/55 at_register [1678] + 0.00 0.00 5/9 register_bordertype [1732] + 0.00 0.00 3/5 at_deprecate [1749] +----------------------------------------------- + 0.00 0.00 1/1 register_spells [1251] +[1835] 0.0 0.00 0.00 1 register_borders [1835] + 0.00 0.00 3/9 register_bordertype [1732] + 0.00 0.00 1/55 at_register [1678] +----------------------------------------------- + 0.00 0.00 1/1 register_spells [1251] +[1836] 0.0 0.00 0.00 1 register_buildingcurse [1836] + 0.00 0.00 4/44 ct_register [1686] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1837] 0.0 0.00 0.00 1 register_buildings [1837] + 0.00 0.00 5/240 register_function [1614] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1838] 0.0 0.00 0.00 1 register_cr [1838] + 0.00 0.00 19/19 tsf_register [1705] + 0.00 0.00 1/3 register_reporttype [1768] +----------------------------------------------- + 0.00 0.00 1/1 register_itemfunctions [1842] +[1839] 0.0 0.00 0.00 1 register_demonseye [1839] + 0.00 0.00 1/3 register_item_give [1767] + 0.00 0.00 1/27 register_item_use [1699] +----------------------------------------------- + 0.00 0.00 1/1 register_spells [1251] +[1840] 0.0 0.00 0.00 1 register_flyingship [1840] + 0.00 0.00 1/44 ct_register [1686] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1841] 0.0 0.00 0.00 1 register_gmcmd [1841] + 0.00 0.00 2/5 at_deprecate [1749] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1842] 0.0 0.00 0.00 1 register_itemfunctions [1842] + 0.00 0.00 7/27 register_item_use [1699] + 0.00 0.00 1/1 register_demonseye [1839] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1843] 0.0 0.00 0.00 1 register_itemtypes [1843] + 0.00 0.00 1/1 register_artrewards [1833] + 0.00 0.00 1/1 register_xerewards [1858] + 0.00 0.00 1/1 register_weapons [1857] +----------------------------------------------- + 0.00 0.00 1/1 register_spells [1251] +[1844] 0.0 0.00 0.00 1 register_magicresistance [1844] + 0.00 0.00 1/44 ct_register [1686] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1845] 0.0 0.00 0.00 1 register_museum [1845] + 0.00 0.00 4/55 at_register [1678] + 0.00 0.00 3/27 register_item_use [1699] + 0.00 0.00 1/9 register_bordertype [1732] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1846] 0.0 0.00 0.00 1 register_names [1846] + 0.00 0.00 7/7 register_race_name_function [1740] + 0.00 0.00 1/1 register_race_description_function [1848] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1847] 0.0 0.00 0.00 1 register_nr [1847] + 0.00 0.00 2/3 register_reporttype [1768] +----------------------------------------------- + 0.00 0.00 1/1 register_names [1846] +[1848] 0.0 0.00 0.00 1 register_race_description_function [1848] + 0.00 0.00 1/240 register_function [1614] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1849] 0.0 0.00 0.00 1 register_races [1849] + 0.00 0.00 13/240 register_function [1614] +----------------------------------------------- + 0.00 0.00 1/1 register_spells [1251] +[1850] 0.0 0.00 0.00 1 register_regioncurse [1850] + 0.00 0.00 19/44 ct_register [1686] +----------------------------------------------- + 0.00 0.00 1/1 lovar [644] +[1851] 0.0 0.00 0.00 1 register_reports [1851] + 0.00 0.00 25/32 add_function [1690] + 0.00 0.00 18/18 register_argtype [1708] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1852] 0.0 0.00 0.00 1 register_resources [1852] + 0.00 0.00 10/27 register_item_use [1699] + 0.00 0.00 9/240 register_function [1614] + 0.00 0.00 1/2 register_item_useonother [1778] + 0.00 0.00 1/3 register_item_give [1767] +----------------------------------------------- + 0.00 0.00 1/1 register_spells [1251] +[1853] 0.0 0.00 0.00 1 register_shipcurse [1853] + 0.00 0.00 3/44 ct_register [1686] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1854] 0.0 0.00 0.00 1 register_tolua_helpers [1854] + 0.00 0.00 12/240 register_function [1614] + 0.00 0.00 2/55 at_register [1678] + 0.00 0.00 1/27 register_item_use [1699] + 0.00 0.00 1/3 register_item_give [1767] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1855] 0.0 0.00 0.00 1 register_triggers [1855] + 0.00 0.00 12/14 tt_register [1715] +----------------------------------------------- + 0.00 0.00 1/1 register_spells [1251] +[1856] 0.0 0.00 0.00 1 register_unitcurse [1856] + 0.00 0.00 14/44 ct_register [1686] +----------------------------------------------- + 0.00 0.00 1/1 register_itemtypes [1843] +[1857] 0.0 0.00 0.00 1 register_weapons [1857] + 0.00 0.00 2/240 register_function [1614] +----------------------------------------------- + 0.00 0.00 1/1 register_itemtypes [1843] +[1858] 0.0 0.00 0.00 1 register_xerewards [1858] + 0.00 0.00 2/27 register_item_use [1699] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1859] 0.0 0.00 0.00 1 register_xmas [1859] + 0.00 0.00 1/14 tt_register [1715] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1860] 0.0 0.00 0.00 1 register_xmlreader [1860] + 0.00 0.00 11/11 xml_register_callback [1726] +----------------------------------------------- + 0.00 0.00 1/1 kernel_done [1813] +[1861] 0.0 0.00 0.00 1 reports_done [1861] +----------------------------------------------- + 0.00 0.00 1/1 read_reference [726] +[1862] 0.0 0.00 0.00 1 resolve_building [1862] + 0.00 0.00 1/48455 findbuilding [1462] +----------------------------------------------- + 0.00 0.00 1/1 main [541] +[1863] 0.0 0.00 0.00 1 setup_signal_handler [1863] +----------------------------------------------- + 0.00 0.00 1/1 wormholes_update [906] +[1864] 0.0 0.00 0.00 1 sort_wormhole_regions [1864] +----------------------------------------------- + 0.00 0.00 1/1 do_fumble [1062] +[1865] 0.0 0.00 0.00 1 t_add [1865] +----------------------------------------------- + 0.00 0.00 1/1 tolua_bindings_open [1318] +[1866] 0.0 0.00 0.00 1 tolua_bind_open [1866] + 0.00 0.00 1/1 tolua_process_open [1877] + 0.00 0.00 1/2 tolua_eressea_open [1780] + 0.00 0.00 1/1 tolua_settings_open [1885] + 0.00 0.00 1/1 tolua_game_open [1871] + 0.00 0.00 1/1 tolua_locale_open [1873] + 0.00 0.00 1/1 tolua_config_open [1868] + 0.00 0.00 1/1 tolua_log_open [1874] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1867] 0.0 0.00 0.00 1 tolua_building_open [1867] +----------------------------------------------- + 0.00 0.00 1/1 tolua_bind_open [1866] +[1868] 0.0 0.00 0.00 1 tolua_config_open [1868] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1869] 0.0 0.00 0.00 1 tolua_dict_open [1869] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1870] 0.0 0.00 0.00 1 tolua_faction_open [1870] +----------------------------------------------- + 0.00 0.00 1/1 tolua_bind_open [1866] +[1871] 0.0 0.00 0.00 1 tolua_game_open [1871] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1872] 0.0 0.00 0.00 1 tolua_gmtool_open [1872] +----------------------------------------------- + 0.00 0.00 1/1 tolua_bind_open [1866] +[1873] 0.0 0.00 0.00 1 tolua_locale_open [1873] +----------------------------------------------- + 0.00 0.00 1/1 tolua_bind_open [1866] +[1874] 0.0 0.00 0.00 1 tolua_log_open [1874] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1875] 0.0 0.00 0.00 1 tolua_message_open [1875] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1876] 0.0 0.00 0.00 1 tolua_order_open [1876] +----------------------------------------------- + 0.00 0.00 1/1 tolua_bind_open [1866] +[1877] 0.0 0.00 0.00 1 tolua_process_open [1877] +----------------------------------------------- + 0.00 0.00 1/1 luaopen_config [2405] +[1878] 0.0 0.00 0.00 1 tolua_reg_types_config [1878] +----------------------------------------------- + 0.00 0.00 1/1 luaopen_game [2407] +[1879] 0.0 0.00 0.00 1 tolua_reg_types_game [1879] +----------------------------------------------- + 0.00 0.00 1/1 luaopen_locale [2408] +[1880] 0.0 0.00 0.00 1 tolua_reg_types_locale [1880] +----------------------------------------------- + 0.00 0.00 1/1 luaopen_log [2409] +[1881] 0.0 0.00 0.00 1 tolua_reg_types_log [1881] +----------------------------------------------- + 0.00 0.00 1/1 luaopen_process [2410] +[1882] 0.0 0.00 0.00 1 tolua_reg_types_process [1882] +----------------------------------------------- + 0.00 0.00 1/1 luaopen_settings [2411] +[1883] 0.0 0.00 0.00 1 tolua_reg_types_settings [1883] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1884] 0.0 0.00 0.00 1 tolua_region_open [1884] +----------------------------------------------- + 0.00 0.00 1/1 tolua_bind_open [1866] +[1885] 0.0 0.00 0.00 1 tolua_settings_open [1885] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1886] 0.0 0.00 0.00 1 tolua_ship_open [1886] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1887] 0.0 0.00 0.00 1 tolua_sqlite_open [1887] +----------------------------------------------- + 0.00 0.00 1/1 lua_init [1316] +[1888] 0.0 0.00 0.00 1 tolua_storage_open [1888] +----------------------------------------------- + 0.00 0.00 1/1 kernel_done [1813] +[1889] 0.0 0.00 0.00 1 translation_done [1889] + 0.00 0.00 1/1 free_functions [1805] +----------------------------------------------- + 0.00 0.00 1/1 kernel_init [1814] +[1890] 0.0 0.00 0.00 1 translation_init [1890] + 0.00 0.00 7/32 add_function [1690] +----------------------------------------------- + 0.00 0.00 1/1 do_fumble [1062] +[1891] 0.0 0.00 0.00 1 trigger_giveitem [1891] + 0.00 0.00 1/3113 t_new [1546] +----------------------------------------------- + 0.00 0.00 1/1 create_newfamiliar [1288] +[1892] 0.0 0.00 0.00 1 trigger_shock [1892] + 0.00 0.00 1/3113 t_new [1546] +----------------------------------------------- + 0.00 0.00 1/1 promotion_cmd [917] +[1893] 0.0 0.00 0.00 1 valid_race [1893] +----------------------------------------------- + 0.00 0.00 1/1 writegame [82] +[1894] 0.0 0.00 0.00 1 version_no [1894] +----------------------------------------------- + 0.00 0.00 1/1 game_init [1249] +[1895] 0.0 0.00 0.00 1 wormholes_register [1895] + 0.00 0.00 1/55 at_register [1678] +----------------------------------------------- + 0.00 0.00 1/1 write_game [83] +[1896] 0.0 0.00 0.00 1 write_alliances [1896] +----------------------------------------------- + 0.00 0.00 1/1 write_game [83] +[1897] 0.0 0.00 0.00 1 write_borders [1897] + 0.00 0.00 22643/22643 b_validroad [1494] + 0.00 0.00 22643/22643 b_writeroad [1495] + 0.00 0.00 1/1 b_write [1792] +----------------------------------------------- + 0.00 0.00 1/1 kernel_done [1813] +[1898] 0.0 0.00 0.00 1 xml_done [1898] +----------------------------------------------- + 0.00 0.00 5/251874 at_deprecate [1749] + 0.00 0.00 55/251874 at_register [1678] + 0.00 0.00 251814/251874 a_read_orig [389] +[3279] 0.0 0.00 0.00 251874 __at_hashkey [3279] +----------------------------------------------- + 0.00 0.00 49331/49331 log_stdio [1459] +[3280] 0.0 0.00 0.00 49331 _log_write [3280] +----------------------------------------------- + + This table describes the call tree of the program, and was sorted by + the total amount of time spent in each function and its children. + + Each entry in this table consists of several lines. The line with the + index number at the left hand margin lists the current function. + The lines above it list the functions that called this function, + and the lines below it list the functions this one called. + This line lists: + index A unique number given to each element of the table. + Index numbers are sorted numerically. + The index number is printed next to every function name so + it is easier to look up where the function in the table. + + % time This is the percentage of the `total' time that was spent + in this function and its children. Note that due to + different viewpoints, functions excluded by options, etc, + these numbers will NOT add up to 100%. + + self This is the total amount of time spent in this function. + + children This is the total amount of time propagated into this + function by its children. + + called This is the number of times the function was called. + If the function called itself recursively, the number + only includes non-recursive calls, and is followed by + a `+' and the number of recursive calls. + + name The name of the current function. The index number is + printed after it. If the function is a member of a + cycle, the cycle number is printed between the + function's name and the index number. + + + For the function's parents, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the function into this parent. + + children This is the amount of time that was propagated from + the function's children into this parent. + + called This is the number of times this parent called the + function `/' the total number of times the function + was called. Recursive calls to the function are not + included in the number after the `/'. + + name This is the name of the parent. The parent's index + number is printed after it. If the parent is a + member of a cycle, the cycle number is printed between + the name and the index number. + + If the parents of the function cannot be determined, the word + `' is printed in the `name' field, and all the other + fields are blank. + + For the function's children, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the child into the function. + + children This is the amount of time that was propagated from the + child's children to the function. + + called This is the number of times the function called + this child `/' the total number of times the child + was called. Recursive calls by the child are not + listed in the number after the `/'. + + name This is the name of the child. The child's index + number is printed after it. If the child is a + member of a cycle, the cycle number is printed + between the name and the index number. + + If there are any cycles (circles) in the call graph, there is an + entry for the cycle-as-a-whole. This entry shows who called the + cycle (as parents) and the members of the cycle (as children.) + The `+' recursive calls entry shows the number of function calls that + were internal to the cycle, and the calls entry for each member shows, + for that member, how many times it was called from other members of + the cycle. + + +Index by function name + + [535] AllianceAuto [1673] free_land [1830] read_alliances (save.c) + [164] AllianceRestricted (ally.c) [1311] free_locales [388] read_attribs + [491] CavalryBonus (battle.c) [1516] free_luxuries (economy.c) [706] read_borders + [1608] CavalrySkill (battle.c) [1426] free_node (pathfinder.c) [1831] read_building_reference + [1180] CheckOverload (laws.c) [1604] free_nodes (pathfinder.c) [1455] read_faction_reference + [1004] ExpensiveMigrants [1356] free_order [893] read_familiar (magic.c) + [1136] FactionSpells [306] free_orders [62] read_game + [836] GiveRestriction (give.c) [575] free_params [1451] read_group (group.c) + [288] HelpMask [1568] free_recruitments [782] read_groups + [901] IsImmune [1436] free_regionlist [799] read_handler (event.c) + [536] LongHunger [1598] free_side (battle.c) [320] read_items + [1195] MagicPower (magic.c) [1700] free_spellparameter (magic.c) [1559] read_mage (magic.c) + [1185] MagicRegeneration (magic.c) [1773] free_summary [894] read_magician (magic.c) + [1264] NMRTimeout [1361] free_variables (translation.c) [586] read_movement (movement.c) + [900] NewbieImmunity [1534] freestrlist [739] read_newunitid (unit.c) + [1605] PopulationDamage (battle.c) [1611] freetokens [524] read_of + [1171] RemoveNMRNewbie (laws.c) [96] from_external_node (critbit.c) [1477] read_owner (save.c) + [1236] ResourceFactor (resources.c) [310] fs_read (filestream.c) [1619] read_password (save.c) + [806] ShipSpeedBonus (ship.c) [447] fs_readln (filestream.c) [1164] read_planes + [3279] __at_hashkey (attrib.c) [124] fs_write (filestream.c) [1278] read_race_reference + [3280] _log_write (log.c) [159] fs_writeln (filestream.c) [726] read_reference + [555] a_add [137] fstream_done [1582] read_region_reference + [418] a_age [973] fumble [1522] read_seenspell (magic.c) + [1597] a_finalizeeffect (alchemy.c) [1284] fumble_default (magic.c) [1759] read_skill (unitcurse.c) + [1786] a_finalizestring [1806] funhash [1555] read_spellbook + [65] a_find [191] fwritestr (creport.c) [870] read_targetregion (targetregion.c) + [558] a_free (attrib.c) [542] game_done [798] read_triggers + [1561] a_init_reportspell (magic.c) [1324] game_id [74] read_unit + [1552] a_initeffect (alchemy.c) [1249] game_init [1521] read_unit_reference + [566] a_insert (attrib.c) [1168] game_name [413] read_unitid + [1376] a_new [1222] gamedate2 (summary.c) [791] read_xml + [390] a_read_i (attrib.c) [944] gamedate_season (report.c) [767] readfaction + [389] a_read_orig [962] generic_name (names.c) [60] readgame + [1660] a_readchars [171] genrand_int31 [43] readorders + [1052] a_readeffect (alchemy.c) [150] genrand_int32 [209] readregion (save.c) + [1448] a_readint [395] genrand_real2 [1612] real2tp (teleport.c) + [1648] a_readkey (key.c) [20] get_addresses (reports.c) [650] recruit (economy.c) + [1531] a_readprivate [1528] get_alive (battle.c) [1564] recruit_cost (economy.c) + [1474] a_readshorts [1001] get_allocator (economy.c) [837] recruit_dracoids (monsters.c) + [1642] a_readstring [1807] get_arg (main.c) [1334] recruit_init (economy.c) + [366] a_remove [482] get_astralplane [1091] reduce_skill + [958] a_removeall [120] get_borders [404] reduce_weight (monsters.c) + [361] a_select [118] get_borders_i (connection.c) [346] regenerate_aura + [559] a_unlink (attrib.c) [717] get_chaoscount [942] regeneration (magic.c) + [1314] a_upgradekeys [1347] get_cmp_region_owner (laws.c) [1444] region_get_morale + [299] a_write [874] get_combatspell [1424] region_getinfo + [998] a_write_unit (magic.c) [880] get_combatspelllevel [1058] region_getresource + [1663] a_writechars [108] get_command [1476] region_set_morale + [1073] a_writeeffect (alchemy.c) [143] get_curse [1422] region_setinfo + [1447] a_writeint [496] get_direction [1683] region_setname + [1787] a_writekeys (key.c) [225] get_effect [1097] region_setresource + [1473] a_writeshorts [1551] get_equipment [987] regionname + [1529] a_writestring [796] get_familiar [675] regions_in_range + [804] absorbed_by_monster (monster.c) [722] get_familiar_mage [1832] register_arena + [527] academy_can_teach [254] get_followers (move.c) [1708] register_argtype + [1128] academy_teaching_bonus [88] get_food [1833] register_artrewards + [560] active_building [1656] get_force (combatspells.c) [1834] register_attributes + [1666] add_callbacks (xmlreader.c) [895] get_friends (unit.c) [1835] register_borders + [1626] add_castorder [1600] get_function [1732] register_bordertype + [1198] add_chaoscount [1466] get_gamedate [1836] register_buildingcurse + [1509] add_donation [581] get_homeplane [1837] register_buildings + [1690] add_function [274] get_keyword [1838] register_cr + [379] add_give (give.c) [934] get_level [1839] register_demonseye + [625] add_income (economy.c) [884] get_locale [1840] register_flyingship + [980] add_itemname_cb (item.c) [198] get_mage [1614] register_function + [1169] add_items (xmlreader.c) [1682] get_maxluxuries [1841] register_gmcmd + [434] add_message [1445] get_migrants (laws.c) [1767] register_item_give + [1674] add_proc (laws.c) [55] get_modifier [1699] register_item_use + [1716] add_proc_global [187] get_money [1778] register_item_useonother + [1692] add_proc_order [1087] get_money_for_dragon (monsters.c) [1842] register_itemfunctions + [1761] add_proc_postregion [293] get_monsters [1843] register_itemtypes + [1733] add_proc_region [750] get_movement [1844] register_magicresistance + [1762] add_proc_unit [480] get_neighbours [1845] register_museum + [1693] add_raceprefix [1275] get_or_create_locale [1846] register_names + [371] add_recruits [292] get_or_create_monsters [1847] register_nr + [1419] add_regionlist [1680] get_or_create_terrain [1848] register_race_description_function + [1162] add_resource [1362] get_otherfaction [1740] register_race_name_function + [977] add_resourcename_cb (item.c) [235] get_param [1849] register_races + [1372] add_seen (reports.c) [713] get_param_flt [1850] register_regioncurse + [1788] add_seen_faction [422] get_param_int [1851] register_reports + [1401] add_seen_faction_i (reports.c) [104] get_pooled [1768] register_reporttype + [386] add_seen_nb (reports.c) [263] get_prefix [1852] register_resources + [355] add_skill [12] get_race [1853] register_shipcurse + [1667] add_skills (xmlreader.c) [368] get_racename [1259] register_special_direction + [1638] add_spell [372] get_regions_distance (reports.c) [1250] register_spelldata (spells.c) + [1173] add_spellparameter (magic.c) [281] get_reservation [1251] register_spells + [1668] add_spells (xmlreader.c) [99] get_resource [1854] register_tolua_helpers + [1669] add_subsets (xmlreader.c) [194] get_resourcetype [1855] register_triggers + [1579] add_tactics (battle.c) [189] get_row (battle.c) [1856] register_unitcurse + [1145] add_translation [423] get_skill [1857] register_weapons + [673] add_travelthru_addresses (reports.c) [862] get_spchange (magic.c) [1858] register_xerewards + [1260] add_trigger [1544] get_spellbook [1859] register_xmas + [607] add_variable (translation.c) [872] get_spellpoints [1860] register_xmlreader + [913] addally (save.c) [1178] get_tactics (battle.c) [1728] rel_to_abs + [217] addlist [1423] get_terrain [528] reldirection + [1069] addmessage [1304] get_translation [1364] release_data (order.c) + [1261] addparam_building (magic.c) [437] get_translations [1061] relpath (config.c) + [1212] addparam_ship (magic.c) [1431] get_transporters (move.c) [1153] remove_building + [1214] addparam_unit (magic.c) [154] get_unitrow (battle.c) [576] remove_empty_factions + [769] addstrlist [71] getbuf [146] remove_empty_units + [811] addtoken [72] getbuf_utf8 (filereader.c) [134] remove_empty_units_in_region + [234] adjust_coordinates [937] getfaction [571] remove_exclusive (laws.c) + [701] aftermath (battle.c) [652] getguard [391] remove_idle_players (laws.c) + [1789] age_borders [483] getid [587] remove_plane + [712] age_building (laws.c) [699] getint [1748] remove_ship + [1098] age_dragon [54] getkeyword [1456] remove_skill + [1123] age_firedragon [681] getparam [499] remove_unit + [1024] age_ghoul [596] getplane [1290] removelist + [1308] age_illusion [1717] getplanebyid [1545] rename_cmd (laws.c) + [959] age_piracy [595] getplanebyname [58] render_messages (creport.c) + [1017] age_reduceproduction (reduceproduction.c) [1337] getplaneid [780] renumber_cmd + [659] age_region (laws.c) [1385] getreload [1156] renumber_factions + [1008] age_skeleton [1018] getship [1159] renumber_unit + [1021] age_stonecircle (laws.c) [212] getshipweight [1631] reorder_fleeing (battle.c) + [720] age_traveldir (move.c) [387] getskill (study.c) [400] reorder_units + [1196] age_undead [710] getstrtoken [526] replace_order + [336] age_unit (laws.c) [195] gettoken [860] report_action + [1573] age_unit (magic.c) [778] getuint [397] report_building + [1019] age_zombie [205] getunit [9] report_computer (creport.c) + [185] ageing (laws.c) [1029] ghoul_name (names.c) [428] report_crtypes (creport.c) + [529] all_money (monsters.c) [891] gift_items [725] report_donations + [1330] allied_skilllimit (faction.c) [102] give_cmd [861] report_effect (spells.c) + [162] alliedfaction [1763] give_control [1187] report_failed_spell (battle.c) + [34] alliedgroup [287] give_control_cmd [1285] report_failure (spells.c) + [31] alliedunit [1108] give_horses (item.c) [106] report_item + [419] allies (report.c) [126] give_item [103] report_items + [752] allocate_resource (economy.c) [857] give_men [4] report_plaintext + [564] allowed_dragon [484] give_money (item.c) [1402] report_resource (reports.c) + [1425] allowed_fly [1060] give_peasants (monsters.c) [210] report_resources + [1452] ally_add [858] give_quota [1301] report_spell (spells.c) + [877] ally_cmd [952] give_unit [318] report_status + [456] ally_mode (ally.c) [1774] giveitem_init (giveitem.c) [614] report_summary + [1160] allysf (battle.c) [1262] giveitem_read (giveitem.c) [87] report_template (report.c) + [1122] allysfm (battle.c) [1309] giveitem_write (giveitem.c) [724] report_transfer (donations.c) + [929] already_seen (magic.c) [405] godcurse (randenc.c) [881] reportcasualties (battle.c) + [1566] any_recruiters (economy.c) [265] golem_factor (item.c) [1063] reportpath + [1434] arg_set (messages.c) [910] good_region (wormhole.c) [2] reports + [151] armedmen [985] group_cmd [1861] reports_done + [819] armor_bonus (battle.c) [698] groupid (reports.c) [1527] required (economy.c) + [1498] army_index (battle.c) [300] growing_herbs (laws.c) [1547] required (build.c) + [329] astralregions [624] growing_trees (laws.c) [1020] reroute (move.c) + [1749] at_deprecate [865] guard [972] res_changeaura (item.c) + [563] at_find (attrib.c) [690] guard_flags [1779] res_changehp (item.c) + [1678] at_register [711] guard_off_cmd [101] res_changeitem (item.c) + [440] atoi36 [656] guard_on_cmd [1200] res_changepeasants (item.c) + [1416] atoip [229] guards (report.c) [912] res_changepermaura (item.c) + [90] att_modification (unit.c) [1363] handle_event [886] research_cmd (economy.c) + [84] attack (battle.c) [1706] handle_triggers [324] reserve_cmd + [785] attack_firesword (weapons.c) [1269] has_ao_healing (combatspells.c) [213] reserve_i (laws.c) + [1409] attacks_per_round (battle.c) [1378] has_horses [325] reserve_self + [914] attrib_allocation (economy.c) [1808] has_limited_skills [356] reset_game (bindings.c) + [1790] attrib_done [193] has_skill [1751] reset_locales + [179] autoalliance (ally.c) [442] hash_uid (region.c) [1625] reset_translations (creport.c) + [777] average_score_of_age [37] hashstring [822] reshow (laws.c) + [1471] b_blocknone [1224] heal (item.c) [818] reshow_cmd + [1770] b_blockquestportal [619] heal_factor (laws.c) [823] reshow_other (laws.c) + [1417] b_finvisible [1158] heal_fighters (combatspells.c) [757] resolve + [1771] b_fvisible [678] help_feed (upkeep.c) [1862] resolve_building + [1279] b_namequestportal (museum.c) [663] help_money (upkeep.c) [820] resolve_faction + [642] b_nameroad (connection.c) [1177] helping [846] resolve_familiar (magic.c) + [1772] b_opaque [493] herbsearch [856] resolve_mage (magic.c) + [1791] b_read [131] hits [1575] resolve_region_id + [1497] b_readroad (connection.c) [604] horse_fleeing_bonus (battle.c) [703] resolve_unit + [1418] b_rvisibleroad (connection.c) [1567] horse_recruiters (economy.c) [546] resource2item + [1420] b_transparent [330] horses (laws.c) [1499] resource2luxury + [1487] b_uinvisible [206] hp_status [1569] resource2potion + [1494] b_validroad (connection.c) [1519] hpflee (battle.c) [1353] resource2weapon + [1792] b_write [808] hunger (upkeep.c) [233] resourcename + [1495] b_writeroad (connection.c) [1223] hunger_damage (upkeep.c) [353] restack_units + [363] balloc [1055] hunted_dir (move.c) [271] rfindhash (region.c) + [1730] basepath [582] i10toi36 [737] rhash + [79] battle_attacks (battle.c) [1442] i_add [1351] rherbs + [1125] battle_effects (battle.c) [569] i_canuse (battle.c) [1369] rhorses + [352] battle_flee (battle.c) [115] i_change [694] ridingcapacity (move.c) + [1629] battle_free (battle.c) [127] i_find [1578] rm_get + [620] battle_punit (battle.c) [1737] i_findc [890] rmfighter + [503] battle_report (battle.c) [1400] i_free [452] rmoney + [1595] battle_update (battle.c) [1515] i_freeall [1741] rmt_create + [1096] begin_potion (alchemy.c) [130] i_get [1490] rmt_find + [547] besieged [1651] i_merge [1672] rmt_get + [631] bewegung_blockiert_von (move.c) [1375] i_new [533] rmtroop (battle.c) + [1461] bfindhash (building.c) [1407] i_remove [200] rname + [1349] bfree [285] icebergs (randenc.c) [396] rng_injectable_double + [1464] bhash [294] immigration [606] roadto (move.c) + [119] bin_r_int_pak (binarystore.c) [1585] in_safe_building [165] room_for_race_in_region (monsters.c) + [216] bin_r_str_buf (binarystore.c) [885] income [1329] roqf_factor + [445] bin_w_brk (binarystore.c) [454] inhabitable [284] rotting_herbs (randenc.c) + [218] bin_w_int_pak (binarystore.c) [1453] init_cb (report.c) [1607] rough_amount (economy.c) + [446] bin_w_str (binarystore.c) [790] init_data (bindings.c) [618] rp_battles (report.c) + [1793] bind_monsters [1143] init_directions [36] rp_messages (report.c) + [641] border_name [1809] init_genrand [435] rpeasants + [741] breed_cmd (economy.c) [1764] init_group (group.c) [1433] rpline (report.c) + [742] breedhorses (economy.c) [1570] init_handler (event.c) [359] rps_nowrap (report.c) + [1148] breedtrees (economy.c) [1307] init_itemtypes [1221] rrandneighbour (volcano.c) + [1360] brelease [1179] init_keyword [508] rroad + [1415] bt_changed [1099] init_keywords [1438] rsetherbs + [343] bt_effsize [1396] init_learning (study.c) [537] rsetherbtype + [237] bt_find [948] init_locale [1408] rsethorses + [236] bt_find_i (building.c) [947] init_locales [553] rsetmoney + [1114] bt_get_or_create [1558] init_mage (magic.c) [545] rsetpeasants + [1698] bt_register [1319] init_mallornseed [1152] rsetroad + [201] buforder (reports.c) [1235] init_oldpotions (item.c) [1410] rsettrees + [17] bufunit [1157] init_options_translation [597] rt_find + [691] build [613] init_order [1139] rt_get_or_create + [696] build_building [1100] init_parameters [1640] rt_register (item.c) + [950] build_road [1310] init_processor [302] rtrees + [839] build_ship (build.c) [399] init_reports [1332] rule_alliance_limit + [1428] building_finished [1731] init_resourcelimit (item.c) [855] rule_auto_taxation (economy.c) + [1488] building_is_active [1228] init_resources [738] rule_autowork (economy.c) + [232] building_owner [1272] init_rules (battle.c) [1327] rule_blessed_harvest + [253] building_owner_ex (building.c) [1320] init_seed [1331] rule_faction_limit + [708] building_protection (building.c) [1592] init_skillmod (skills.c) [1175] rule_force_leave + [1504] building_set_owner [1101] init_skills [1328] rule_give + [1010] building_update_owner [1312] init_smithy (building.c) [829] rule_random_progress (skills.c) + [1500] buildingcapacity [1810] init_terrains [1323] rule_region_owners + [367] buildingeffsize [1129] init_terrains_translation [1325] rule_stealth_anon + [1535] buildingmaintenance (report.c) [544] init_tokens_str [530] rule_stealth_other + [621] buildingname [1033] init_translations [1204] rule_transfermen (give.c) + [414] buildingtype [384] init_transportation (move.c) [1247] runhash + [1443] buildingtype_exists [1486] inside_building [181] sail (move.c) + [1720] bunhash [345] internal_path_find (pathfinder.c) [969] scale_number + [707] buy (economy.c) [1756] intlist_add [768] scareaway (monster.c) + [1536] c_clearflag [1757] intlist_init [380] scared_by_monster (monster.c) + [1070] caddmessage (messages.c) [139] invisible [23] score + [645] calculate_armor [1368] is_allied [244] scramble (economy.c) + [603] calculate_emigration (laws.c) [479] is_astral [1116] scramble_fighters (combatspells.c) + [1794] caldera_handle (arena.c) [1550] is_attacker [1729] section_add + [1270] caldera_read (arena.c) [554] is_building_type [1563] section_find + [1795] caldera_write (arena.c) [570] is_exclusive [1440] see_border + [1796] calendar_cleanup [1092] is_familiar [1117] seefaction + [1338] can_charm (spells.c) [1088] is_freezing (move.c) [1491] seematrix (battle.c) + [1634] can_contact [211] is_guard [1132] select_ally + [1335] can_give (give.c) [377] is_guarded [700] select_armor (battle.c) + [940] can_give_men (give.c) [186] is_guardian_r (move.c) [172] select_enemy + [600] can_give_to [626] is_guardian_u (move.c) [1322] select_familiar (spells.c) + [908] can_guard (economy.c) [1370] is_long [680] select_magicarmor + [1112] can_leave [262] is_mage [160] select_opponent (battle.c) + [736] can_move (move.c) [1047] is_migrant [1079] select_recruitment (economy.c) + [679] can_start_guarding [1392] is_mourning [761] select_spellbook (magic.c) + [640] can_survive [1231] is_moving_ship (magic.c) [1367] select_weapon (battle.c) + [854] can_takeoff [687] is_persistent [909] select_wormhole_regions (wormhole.c) + [833] cancast [552] is_repeated [498] sell (economy.c) + [1031] canfly [1358] is_riding (battle.c) [1202] send_cmd + [465] canride (move.c) [668] isparam [1576] set_attacker (battle.c) + [469] cansail (move.c) [453] it_alias (item.c) [875] set_coast (move.c) + [22] cansee [385] it_find [1146] set_combatspell + [170] cansee_durchgezogen [1115] it_get_or_create [1265] set_curseingmagician (curse.c) + [684] cansee_unit [1636] it_register (item.c) [1620] set_email + [682] canswim [1679] it_set_appearance [1562] set_enemy (battle.c) + [633] canwalk (move.c) [561] item2resource [183] set_factionstealth + [502] cap_route (move.c) [1811] item_done [992] set_familiar (magic.c) + [760] cast_cmd (magic.c) [149] item_invis (unit.c) [1574] set_friendly (battle.c) + [623] cast_combatspell (battle.c) [338] itoa10 [1048] set_group + [512] castle_name (building.c) [116] itoa36 [1134] set_leftship + [513] castle_name_i (building.c) [107] itoab [774] set_level + [1003] caught_target (move.c) [439] jenkins_hash [1326] set_money + [598] cb_add_address (reports.c) [693] join_allies (battle.c) [486] set_new_dragon_target (monsters.c) + [94] cb_add_seen (reports.c) [425] join_battle (battle.c) [1387] set_number + [204] cb_cr_travelthru_ship (creport.c) [1083] join_group [1365] set_order + [466] cb_cr_travelthru_unit (creport.c) [1016] join_path [1689] set_param + [308] cb_find_prefix [464] json_config [1015] set_racename + [95] cb_find_prefix_i (critbit.c) [772] json_disable_features (jsonconf.c) [1430] set_resvalue + [13] cb_find_top_i (critbit.c) [583] json_export [933] set_spellpoints + [335] cb_get_kv [1707] json_flags (jsonconf.c) [588] set_string + [577] cb_insert [1283] json_include (jsonconf.c) [815] setguard + [653] cb_new_kv [1127] json_keyword (jsonconf.c) [1542] setreload (battle.c) + [169] cb_write_travelthru (report.c) [1124] json_keywords (jsonconf.c) [1390] setstatus + [789] centre (report.c) [1812] json_prefixes (jsonconf.c) [182] setstealth_cmd + [495] chance [467] json_settings (jsonconf.c) [1863] setup_signal_handler (main.c) + [982] change_effect [1189] json_terrain (jsonconf.c) [1484] sfindhash (ship.c) + [911] change_maxspellpoints [1694] json_terrain_production (jsonconf.c) [1502] shash + [337] change_money [1190] json_terrains (jsonconf.c) [1482] ship_damage_percent + [1441] change_reservation [1813] kernel_done [438] ship_owner + [240] change_resource [1814] kernel_init [1571] ship_owner_ex (ship.c) + [971] change_spellpoints [719] key_get [354] ship_ready (move.c) + [1721] changefaction_init (changefaction.c) [1355] keyword [1505] ship_set_owner + [1166] changefaction_read (changefaction.c) [1348] keyword_disabled [573] ship_update_owner + [1258] changefaction_write (changefaction.c) [1647] keyword_key (keyword.c) [567] shipcapacity + [1746] changerace_init (changerace.c) [532] kill_troop [1072] shipcurse_flyingship (flyingship.c) + [1215] changerace_read (changerace.c) [817] killunit_read (killunit.c) [290] shipname + [1287] changerace_write (changerace.c) [978] killunit_write (killunit.c) [669] shipspeed + [848] chaos (chaos.c) [956] knowsspell [1468] shiptrail_age (move.c) + [1797] chaos_register [476] koor_distance [1492] shiptrail_finalize (move.c) + [514] chaos_update [1394] koor_distance_orig (region.c) [1469] shiptrail_init (move.c) + [1077] chaosfactor (monsters.c) [1724] koor_distance_wrap_xy (region.c) [1475] shiptrail_read (move.c) + [1213] chaosterrain (chaos.c) [562] koor_reldirection (move.c) [1511] shiptrail_write (move.c) + [1537] chash [651] largestbuilding [892] shock_read (shock.c) + [1244] check_dupe (log.c) [1601] lastregion (reports.c) [1050] shock_write (shock.c) + [1432] check_errno (report.c) [471] learn_skill [1248] show_alliances_cr (creport.c) + [1138] check_give [432] leave [429] show_allies (report.c) + [786] check_leuchtturm [1009] leave_building [661] show_allies_cr (creport.c) + [1141] check_messages_exist (reports.c) [721] leave_cmd [889] show_new_spells + [184] check_overpopulated (monsters.c) [540] leave_ship [745] sideabkz (battle.c) + [793] check_param [704] leave_trail (move.c) [867] sidename (battle.c) + [657] check_ship_allowed [500] leftship [475] sinkships + [1234] check_steal [1635] leftship_age (unit.c) [510] sk_set + [1268] checkpasswd [1388] level_days [1035] skeleton_name (names.c) + [402] checkunitnumber [888] leveled_allocation (economy.c) [365] skill_enabled + [565] choplist (lists.c) [1071] levitate_ship [1205] skill_key (skill.c) + [686] cinfo_building [286] lifestyle [1172] skill_limit + [824] cinfo_magicresistance (magicresistance.c) [728] lighthouse_range [264] skill_mod + [996] cinfo_magicrunes (buildingcurse.c) [1775] limit_mallornseeds (seed.c) [1032] skill_summoned (spells.c) + [812] cinfo_ship [943] limit_resource (helpers.c) [509] skill_weeks + [997] cinfo_shipnodrift (shipcurse.c) [1691] limit_seeds (seed.c) [166] skilldiff + [751] cinfo_simple [879] limited_give (give.c) [214] skillmod + [1192] cinfo_skillmod (unitcurse.c) [635] list_address (report.c) [122] skillname + [1118] cinfo_slave (unitcurse.c) [190] listlen [1593] slipthru (laws.c) + [1110] cinfo_speed (unitcurse.c) [73] live (laws.c) [548] slprintf + [1242] claim_cmd [1293] load_inifile (main.c) [520] sm_familiar (magic.c) + [309] class_index_event [266] locale_getstring [1613] sm_smithy (building.c) + [531] clear_npc_orders (save.c) [1354] locale_index [1864] sort_wormhole_regions + [1271] clonedied_read (clonedied.c) [1815] locale_init [1514] sp_alias (spell.c) + [1321] clonedied_write (clonedied.c) [568] locale_name [847] sp_blessedharvest (spells.c) + [718] cmistake [918] locale_setstring [1209] sp_bloodsacrifice (spells.c) + [578] cmp_curse (curse.c) [27] locale_string [993] sp_charmingsong (spells.c) + [305] cmp_faction [1816] log_close [627] sp_dragonodem + [203] cmp_transfer [1776] log_create [1045] sp_enterastral + [670] cmp_wage [1245] log_debug [988] sp_eternizewall (spells.c) + [1644] co_get_caster [1340] log_error [1064] sp_flying_ship + [1594] co_get_region [1339] log_info [1040] sp_generous (spells.c) + [898] combatspell_cmd [1817] log_open [974] sp_goodwinds (spells.c) + [1352] config_changed [251] log_orders (reports.c) [931] sp_hain (spells.c) + [224] config_get [1458] log_prefix (log.c) [989] sp_healing + [714] config_get_flt [1818] log_rotate [1068] sp_holyground (spells.c) + [348] config_get_int [1459] log_stdio (log.c) [923] sp_igjarjuk + [462] config_parse [1819] log_to_file [957] sp_kampfzauber + [460] config_read [1342] log_warning [968] sp_mallornhain (spells.c) + [444] config_set [1243] log_write (log.c) [1336] sp_seduce (spells.c) + [794] config_token [873] loot_cmd [939] sp_song_of_peace (spells.c) + [965] contact_cmd [810] loot_items (battle.c) [871] sp_stormwinds (spells.c) + [654] contest (battle.c) [1013] loot_quota (battle.c) [1025] sp_summon_familiar (spells.c) + [655] contest_classic (battle.c) [644] lovar [1034] sp_summonshadowlords (spells.c) + [813] continue_ship [809] lparagraph [896] sp_summonundead (spells.c) + [521] copy_arg (message.c) [1738] lt_register (item.c) [784] sp_viewreality + [441] copy_order [1645] lua_callspell (helpers.c) [827] sparagraph + [357] count_all [1591] lua_canuse_item (helpers.c) [505] spawn_braineaters + [1220] count_allies [1820] lua_done [411] spawn_dragons + [231] count_cb (reports.c) [1191] lua_getresource (helpers.c) [831] spawn_seaserpent + [611] count_enemies [1316] lua_init [629] spawn_undead + [636] count_enemies_i (battle.c) [157] magic [1621] spc_email_isvalid (goodies.c) + [219] count_faction [897] magic_lowskill [1526] special_resources (bind_region.c) + [730] count_maxmigrants [727] magic_resistance [1657] spell_damage (combatspells.c) + [731] count_migrants [844] mail_cmd [841] spell_info + [1089] count_particles (names.c) [1106] mailfaction (laws.c) [646] spell_name + [666] count_side (battle.c) [921] mailunit (laws.c) [1572] spellbook_add + [868] count_skill [478] maintain (economy.c) [1742] spellbook_clear + [518] count_travelthru [339] maintain_buildings [1557] spellbook_get + [487] count_units [481] maintenance_cost [995] spellcost + [572] countheroes [1282] make_battle [1000] spellpower + [903] countspells [383] make_cmd [1650] spl_costtyp (magic.c) + [135] cr_borders (creport.c) [802] make_curse (curse.c) [743] split_allocations + [1481] cr_building (creport.c) [584] make_external_node (critbit.c) [1518] split_messages + [1493] cr_faction (creport.c) [1219] make_familiar (spells.c) [828] split_paragraph + [602] cr_find_address (creport.c) [424] make_fighter [53] spskill + [1406] cr_int [1589] make_follow [632] spunit + [489] cr_order (creport.c) [1298] make_heroes (battle.c) [990] spy_cmd + [239] cr_output_building (creport.c) [1718] make_iceberg [1038] spy_message + [69] cr_output_curses (creport.c) [1615] make_leftship (unit.c) [1503] st_find + [144] cr_output_curses_compat (creport.c) [1303] make_locales [1501] st_find_i (ship.c) + [57] cr_output_messages (creport.c) [1821] make_matmod [1743] st_get_or_create + [10] cr_output_region (creport.c) [522] make_movement_order (monsters.c) [297] start_battle (battle.c) + [378] cr_output_resource (creport.c) [970] make_name (names.c) [70] statistics (report.c) + [238] cr_output_resources (creport.c) [1603] make_otherfaction [904] status_cmd + [152] cr_output_ship (creport.c) [1722] make_reduceproduction [550] statusrow + [639] cr_output_spells (creport.c) [289] make_route (move.c) [766] steal_cmd (economy.c) + [298] cr_output_travelthru (creport.c) [876] make_side [188] stealth_modifier + [19] cr_output_unit [1777] make_skillmod [167] stream_order (creport.c) + [18] cr_output_unit_compat (creport.c) [21] make_summary [158] stream_printf + [949] cr_race (creport.c) [1701] make_targetregion [1374] strlcat + [662] cr_region (creport.c) [1188] make_undead_unit [45] strlcpy + [1414] cr_region_header (creport.c) [1150] make_wormhole (wormhole.c) [67] strlcpy_w + [840] cr_regions (creport.c) [1151] make_wormholes [105] study_cmd + [196] cr_render [1267] make_zombie [433] study_cost + [756] cr_reportspell (creport.c) [1084] makename (region.c) [747] study_days (study.c) + [488] cr_resource (creport.c) [759] manufacture (economy.c) [1398] study_speedup (study.c) + [960] cr_resources (creport.c) [610] mark_travelthru (move.c) [925] summon_allies (combatspells.c) + [1530] cr_ship (creport.c) [748] markets_module [1744] sunhash + [672] cr_skill (creport.c) [975] matmod (build.c) [1036] syntax_error + [1026] cr_spell (creport.c) [915] max_magicians [1865] t_add + [1510] cr_string [1037] max_skill (economy.c) [1546] t_new + [1403] cr_unit (creport.c) [755] max_spellpoints [1154] target_resists_magic + [579] create_backup [1109] max_transfers (give.c) [697] tax_cmd + [1066] create_castorder [946] maxbuild [272] teach_cmd + [1137] create_castorder_combat (battle.c) [492] maxheroes [426] teach_unit (study.c) + [800] create_curse [473] maxworkingpeasants [410] term_eval (dice.c) + [252] create_data (order.c) [1046] mayboard (laws.c) [242] terminate + [1294] create_directories [936] mayenter (laws.c) [1165] terraform_default (resources.c) + [1658] create_equipment [1082] melt_iceberg (randenc.c) [932] terraform_region + [538] create_icebergs [1517] merge_messages [986] terraform_resources + [617] create_item (economy.c) [834] message_all [1421] terrain_find_i (terrain.c) + [1315] create_mage [1822] message_done [226] terrain_name + [1288] create_newfamiliar [716] message_faction (battle.c) [1760] terrains + [341] create_order [1405] messagehash (creport.c) [1709] timeout_handle (timeout.c) + [175] create_order_i (order.c) [1478] migrate (laws.c) [1710] timeout_init (timeout.c) + [821] create_potion (economy.c) [1652] mk_piracy (piracy.c) [1719] timeout_read (timeout.c) + [1014] create_ship [1366] mkdata (order.c) [1711] timeout_write (timeout.c) + [1639] create_spell [261] mkname [1866] tolua_bind_open + [1606] create_spellbook [316] mkname_buf [1318] tolua_bindings_open + [296] create_unit [1429] mknode [1867] tolua_building_open + [317] createunitid (unit.c) [1203] mm_smithy (building.c) [589] tolua_buildinglist_next + [344] crew_skill [1239] mod_elves_only (item.c) [1868] tolua_config_open + [1798] crmessage_done [764] monster_attack (monsters.c) [1869] tolua_dict_open + [321] crt_find (crmessage.c) [248] monster_attacks [1780] tolua_eressea_open + [1006] crt_register [407] monster_is_waiting [1870] tolua_faction_open + [110] crtag (creport.c) [230] monster_kills_peasants [1871] tolua_game_open + [592] ct_changed [269] monster_learn (monsters.c) [1872] tolua_gmtool_open + [1142] ct_checknames [129] monster_move (monsters.c) [1873] tolua_locale_open + [114] ct_find [215] monthly_healing [1874] tolua_log_open + [1686] ct_register [1479] morale_update [1875] tolua_message_open + [580] ct_remove [283] move_blocked [1876] tolua_order_open + [1695] cunhash (curse.c) [66] move_cmd [1877] tolua_process_open + [543] curse_active [342] move_hunters (move.c) [1878] tolua_reg_types_config (config.pkg.c) + [1538] curse_age [1094] move_iceberg (randenc.c) [1781] tolua_reg_types_eressea (eressea.pkg.c) + [1489] curse_cansee [534] move_icebergs (randenc.c) [1879] tolua_reg_types_game (game.pkg.c) + [1696] curse_done [326] move_pirates (move.c) [1880] tolua_reg_types_locale (locale.pkg.c) + [1395] curse_geteffect [374] move_ship [1881] tolua_reg_types_log (log.pkg.c) + [1590] curse_geteffect_int [421] move_unit [1882] tolua_reg_types_process (process.pkg.c) + [1539] curse_init [47] movement [1883] tolua_reg_types_settings (settings.pkg.c) + [1140] curse_name [1193] movement_error (move.c) [1884] tolua_region_open + [770] curse_read [155] movement_speed (move.c) [590] tolua_regionlist_next + [930] curse_write [350] movewhere [1885] tolua_settings_open + [1799] curses_done [1399] msg_addref [1886] tolua_ship_open + [375] cycle_route (move.c) [228] msg_create [1887] tolua_sqlite_open + [1641] damage_ship [1080] msg_create_message (bind_message.c) [1888] tolua_storage_open + [1044] damage_unit (volcano.c) [664] msg_curse [1274] tolua_toid + [1289] datapath [744] msg_error [591] tolua_tousertype + [1800] dazzle [647] msg_feedback [449] tolua_unit_get_faction (bind_unit.c) + [1549] dead_fighters (battle.c) [1384] msg_free [1782] tolua_unit_open + [674] deathcount [1005] msg_materials_required [313] tolua_unitlist_next + [843] deathcounts [132] msg_message [1085] tpregion (teleport.c) + [56] decode_pointer (critbit.c) [1373] msg_release [207] trailinto + [851] default_name [1042] msg_send_faction (bind_message.c) [1039] transfer_curse + [902] default_order [1210] msg_send_region (bind_message.c) [1622] transfer_seen + [1659] default_score [1633] msg_set_int (bind_message.c) [899] transfermen + [1144] default_spoil (item.c) [1685] msg_set_region (bind_message.c) [75] translate (creport.c) + [173] default_wage (config.c) [1226] msg_set_resource (bind_message.c) [28] translate + [249] defaultorders [1646] msg_set_unit (bind_message.c) [1889] translation_done + [966] deliverMail [1286] msg_to_ship_inmates (move.c) [1890] translation_init + [50] demographics [1823] mt_clear [430] translist + [826] demon_skillchange [227] mt_find [358] transliterate + [246] demon_skillchanges (randenc.c) [1587] mt_id (message.c) [1011] transport (move.c) + [35] describe (report.c) [1588] mt_new [81] travel (move.c) + [267] describe_race (names.c) [1007] mt_register [92] travel_i (move.c) + [1113] destroy_cmd [1602] mtype_get_param [147] travel_route (move.c) + [1697] destroy_curse [835] name_cmd [609] travelthru_add + [1230] destroy_road (build.c) [803] name_unit [180] travelthru_cansee + [392] destroyfaction [788] natural_armor [41] travelthru_map + [307] dfindhash [1273] nb_armor (volcano.c) [1201] treeman_neighbour (monsters.c) + [787] dice [1734] new_armortype [1783] trigger_changefaction + [409] dice_rand [705] new_border [1297] trigger_changerace + [1670] dict_get [1059] new_building [1891] trigger_giveitem + [1675] dict_init (dict.c) [1565] new_group [1752] trigger_killunit + [1671] dict_name [1739] new_luxurytype [1892] trigger_shock + [1676] dict_read (dict.c) [1427] new_node (pathfinder.c) [1753] trigger_timeout + [1677] dict_write (dict.c) [1712] new_potiontype [677] trollbelts (battle.c) + [1508] dir_invert [275] new_region [1225] try_rename (laws.c) + [771] disable_feature (jsonconf.c) [1229] new_ship [1554] tsf_find (crmessage.c) + [999] disband_men [282] new_units [1705] tsf_register + [859] display_cmd [1703] new_weapontype [1548] tt_find + [1054] display_item (laws.c) [1263] newcontainerid [1715] tt_register + [1090] display_potion (laws.c) [594] newline [347] u_description + [963] display_race (laws.c) [1359] newterrain [919] u_geteffstealth + [241] dissolve_units (randenc.c) [319] newunitid [951] u_hasspell + [599] distance [601] next_region (move.c) [257] u_irace + [80] do_attack [1758] nextlocale [89] u_race + [64] do_battle [1333] nmr_death (laws.c) [1460] u_set_building + [63] do_battles [878] nmr_warnings [1485] u_set_ship + [825] do_combatmagic [376] normalvariate [1199] u_seteffstealth + [702] do_combatspell (battle.c) [141] nr_building (report.c) [1111] u_setfaction + [250] do_contact (laws.c) [48] nr_curses (report.c) [1389] u_setrace + [128] do_enter [401] nr_curses_i (report.c) [692] ualias + [648] do_extra_spell (battle.c) [25] nr_render [927] ucontact + [1062] do_fumble (magic.c) [113] nr_section [109] ufindhash + [941] do_potion (alchemy.c) [111] nr_ship (report.c) [1133] ugetpotionuse + [351] do_recruiting (economy.c) [507] nr_spell [667] uhash + [515] do_siege [732] nr_spell_syntax [314] unicode_ucs4_to_utf8 + [612] do_work (economy.c) [11] nr_unit (report.c) [1216] unicode_utf8_strcasecmp + [1397] done_learning (study.c) [1232] nrand (monsters.c) [177] unicode_utf8_to_ucs4 + [1126] dracoid_name (names.c) [98] nrt_find [1684] unit_addorder + [516] dragon_affinity_value (monsters.c) [883] nrt_register [709] unit_can_study + [1095] dragon_name (names.c) [1524] nrt_section [427] unit_get_spellbook + [850] drain_exp [443] nrt_string [1735] unit_gethp + [1053] drift_target [723] ntimespprob [332] unit_getname + [490] drifting_ships (move.c) [14] old_race [758] unit_getspell + [394] drown [1381] oldcursename [1577] unit_has_cursed_item (give.c) + [468] eaten_by_monster (monster.c) [1240] oldfamiliars (races.c) [136] unit_max_hp + [243] eatwhite [1596] oldterrain [1540] unit_setname + [255] eatwhitespace_c (parser.c) [470] omniscient [1391] unit_skill + [78] economics [1824] openlibs (bindings.c) [142] unitname + [334] eff_skill [176] opstack_pop [46] unitorders (save.c) + [845] eff_spelllevel [202] opstack_push [1167] unset_combatspell + [163] eff_stealth [370] orc_growth (randenc.c) [415] update_guards + [683] eff_weight (move.c) [615] out_faction (summary.c) [551] update_interval + [100] effskill [1002] overload (move.c) [605] update_lighthouse + [504] effskill_study [1295] overload_start (move.c) [270] update_long_order + [1801] enable_keyword [676] owner_buildingtyp [1155] update_nmrs + [814] end_potion (alchemy.c) [1393] owner_change [1237] update_resource (resources.c) + [1512] enoughsailors [311] pack_int (binarystore.c) [1457] update_resources + [145] enter_1 (laws.c) [1688] pack_keyval [381] update_spells (laws.c) + [295] enter_2 (laws.c) [26] paragraph (report.c) [497] uprivate + [695] enter_building [1655] parameter_key (config.c) [1472] ur_add + [733] enter_ship [333] parse (translation.c) [436] urace + [665] entertain_cmd [1662] parse_ai (xmlreader.c) [1754] ursprung_x (plane.c) + [643] entertainmoney [1825] parse_args (main.c) [1755] ursprung_y (plane.c) + [1437] entrance_allowed (move.c) [1131] parse_buildings (xmlreader.c) [935] use_bloodpotion (item.c) + [1121] equip_items [1252] parse_calendar (xmlreader.c) [763] use_cmd + [775] equip_unit [1292] parse_config (main.c) [1149] use_default (resources.c) + [776] equip_unit_mask [1170] parse_equipment (xmlreader.c) [1119] use_healingpotion (item.c) + [1702] equipment_addspell [1637] parse_function (xmlreader.c) [765] use_item (laws.c) + [1802] equipment_done [852] parse_ids [39] use_pooled + [1747] equipment_setcallback [1317] parse_inifile (bindings.c) [801] use_potion + [1664] equipment_setitem [649] parse_int (translation.c) [1233] use_skillpotion + [1649] equipment_setskill [832] parse_messages (xmlreader.c) [1147] usetcontact + [59] eressea_read_game [117] parse_order [1078] usetpotionuse + [1346] eressea_run [1765] parse_param (xmlreader.c) [1041] usetprivate + [1624] eressea_version [1104] parse_races (xmlreader.c) [593] usiege + [76] eressea_write_game [1086] parse_resources (xmlreader.c) [1049] uunhash + [556] escape_string [1826] parse_rules (xmlreader.c) [1893] valid_race + [1182] eval_add (translation.c) [1305] parse_ships (xmlreader.c) [1051] validate_pirate (piracy.c) + [494] eval_building (reports.c) [1827] parse_spellbooks (xmlreader.c) [1627] var_copy_items (reports.c) + [608] eval_direction (reports.c) [1120] parse_spells (xmlreader.c) [734] var_copy_order (reports.c) + [398] eval_eq (translation.c) [86] parse_string (translation.c) [1439] var_copy_regions (move.c) + [685] eval_faction (reports.c) [864] parse_strings (xmlreader.c) [1632] var_copy_resources (reports.c) + [393] eval_if (translation.c) [42] parse_symbol (translation.c) [1454] var_copy_string (reports.c) + [268] eval_int (translation.c) [125] parse_token [1628] var_free_resources (reports.c) + [729] eval_int36 (reports.c) [220] parse_token_depr [1470] var_free_string (reports.c) + [517] eval_isnull (translation.c) [849] parser_end [1784] verbosity_to_flags (main.c) + [922] eval_localize (reports.c) [1506] parser_popstate [1255] verify_building (magic.c) + [539] eval_lt (translation.c) [1507] parser_pushstate [1704] verify_ship (magic.c) + [472] eval_order (reports.c) [1618] password_encode [1027] verify_targets (magic.c) + [882] eval_race (reports.c) [1610] password_verify [1028] verify_unit (magic.c) + [245] eval_region (reports.c) [431] path_exists [1894] version_no + [328] eval_resource (reports.c) [523] path_find [1525] visible_default (resources.c) + [907] eval_resources (reports.c) [1828] pathfinder_cleanup [68] visible_faction + [740] eval_ship (reports.c) [805] pay_spell [1022] volcano_destruction (volcano.c) + [671] eval_skill (reports.c) [1687] pcomp (summary.c) [1023] volcano_outbreak + [961] eval_spell (reports.c) [928] peasant_growth_factor (laws.c) [981] volcano_update + [634] eval_trail (reports.c) [984] peasant_luck_effect [174] wage + [369] eval_trailto (reports.c) [1277] peasant_luck_factor (laws.c) [403] walkingcapacity + [223] eval_unit (reports.c) [658] peasants (laws.c) [450] wang_hash + [1076] eval_unit_dative (reports.c) [795] personcapacity [168] weapon_effskill (battle.c) + [1102] eval_weight (reports.c) [660] piracy_cmd [221] weapon_skill (battle.c) + [49] expandbuying (economy.c) [1653] piracy_done (piracy.c) [1435] weapon_weight (battle.c) + [637] expandentertainment (economy.c) [1654] piracy_init (piracy.c) [459] weight + [816] expandloot (economy.c) [781] plagues [1130] wormhole_age (wormhole.c) + [197] expandorders (economy.c) [715] plain_name (terrain.c) [1238] wormhole_read (wormhole.c) + [349] expandrecruit (economy.c) [273] plan_dragon (monsters.c) [1785] wormhole_write (wormhole.c) + [93] expandselling (economy.c) [52] plan_monsters [1895] wormholes_register + [807] expandstealing (economy.c) [1411] plane_center_x [906] wormholes_update + [278] expandtax [1412] plane_center_y [1896] write_alliances + [277] expandwork (economy.c) [1379] plane_height [301] write_attribs + [455] f_get_alliance [1380] plane_width [1897] write_borders + [161] f_regionid [1184] plant (economy.c) [1383] write_building_reference + [477] f_regionid_s (reports.c) [1206] planttrees (economy.c) [622] write_buildingname + [451] faction_alive [1350] pnormalize [1382] write_faction_reference + [1543] faction_get_spellbook [1176] potion_luck (alchemy.c) [83] write_game + [382] faction_getmages (laws.c) [945] potion_water_of_life (alchemy.c) [1449] write_group (group.c) + [1357] faction_getorigin [1377] preferred_weapon (battle.c) [920] write_groups + [979] faction_setorigin [340] prepare_lighthouse (reports.c) [955] write_handler (event.c) + [1616] faction_setpassword [8] prepare_report [511] write_items + [247] factionname [1643] present (move.c) [1560] write_mage (magic.c) + [983] factionorders (save.c) [85] prices (report.c) [1467] write_of + [842] farcasting (magic.c) [616] print_fighters (battle.c) [121] write_order + [688] fbattlerecord (battle.c) [838] print_header (battle.c) [1480] write_owner (save.c) + [315] ffindhash (faction.c) [938] print_items (creport.c) [1623] write_password (save.c) + [1617] fhash [525] print_stats (battle.c) [1207] write_planes + [1012] fighters [7] process [1723] write_race_reference + [1553] find_argtype [6] processorders [1583] write_region_reference + [1496] find_bordertype [29] produce [280] write_regionname + [549] find_function (translation.c) [1829] produce_mallornseeds (seed.c) [3] write_reports + [1450] find_group (group.c) [994] produce_resource (helpers.c) [1135] write_score + [1217] find_groupbyname (group.c) [1725] produce_seeds (seed.c) [853] write_script (reports.c) + [967] find_piracy_target [322] produceexp [1523] write_seenspell (magic.c) + [1581] find_side [406] produceexp_days (study.c) [1386] write_ship_reference + [1513] find_spell [323] produceexp_ex [291] write_shipname + [304] find_variable (translation.c) [417] production [1769] write_skill (unitcurse.c) + [1462] findbuilding [917] promotion_cmd [303] write_spaces + [866] findbuildingtype [1713] pt_register (item.c) [964] write_spell_modifier (report.c) + [259] findfaction [112] ql_advance [1556] write_spellbook + [735] finditemtype [312] ql_find [1584] write_targetregion (targetregion.c) + [1665] findkeyword [362] ql_foreachx [689] write_translations (creport.c) + [753] findnewunit [138] ql_get [327] write_travelthru + [1241] findoption [448] ql_push [954] write_triggers + [458] findparam [156] ql_set_insert_ex [97] write_unit + [926] findparam_ex [258] qli_init [557] write_unit_reference + [457] findplane [192] qli_more [148] write_unitname + [1030] findrace [585] qli_next [762] writefaction + [420] findregion [276] quit [82] writegame + [1463] findregionbyid [779] r_addmessage [208] writeorder (save.c) + [1181] findresourcetype [783] r_astral_to_standard [1074] writepasswd + [1483] findship [474] r_connect [519] writeregion + [869] findshiptype [1404] r_demand [1253] writeturn (summary.c) + [1586] findskill [360] r_getmessages [178] wrptr + [501] findtoken [1446] r_insectstalled [1532] xml_bvalue + [123] findunit [199] r_isforest [1520] xml_cleanup_string (xmlreader.c) + [279] findunitg [1413] r_setdemand [1898] xml_done + [991] findunitr [1067] r_standard_to_astral [1599] xml_fvalue + [33] finish_reports [905] race_namegen [1533] xml_ivalue + [485] firstregion (reports.c) [1766] racelist_insert [1736] xml_readarmor (xmlreader.c) + [638] flee (battle.c) [133] racename [1183] xml_readconstruction + [408] fleechance [222] raceprefix [1107] xml_readitem (xmlreader.c) + [1465] flying_ship [1065] random_growl [1745] xml_readluxury (xmlreader.c) + [1803] flyingship_age (flyingship.c) [754] random_move_chance (monsters.c) [1714] xml_readpotion (xmlreader.c) + [749] follow_ship [153] random_neighbour (monsters.c) [1186] xml_readrequirements (xmlreader.c) + [331] follow_unit [1174] random_unit (chaos.c) [863] xml_readstrings (xmlreader.c) + [1280] forbiddenid [91] randomevents [887] xml_readtext (xmlreader.c) + [1093] forget_cmd (economy.c) [256] rc_changed [1266] xml_readweapon (xmlreader.c) + [1371] free_arg (message.c) [1661] rc_create [1726] xml_register_callback + [1630] free_battle [15] rc_find [1727] xml_spell (xmlreader.c) + [1609] free_castorder [16] rc_find_i (race.c) [1056] zombie_name (names.c) + [1541] free_castorders [1105] rc_get_or_create [32] + [574] free_config [364] rc_name [463] + [1580] free_fighter (battle.c) [260] rc_name_s [953] + [1804] free_functions [140] rc_skillmod [797] + [1805] free_functions (translation.c) [830] rc_specialdamage (battle.c) [30] + [1750] free_group [1681] rcomp (summary.c) diff --git a/process/cron/preview.cron b/process/cron/preview.cron index b18038843..985ddf40b 100755 --- a/process/cron/preview.cron +++ b/process/cron/preview.cron @@ -7,7 +7,6 @@ if [ -e ${ERESSEA}/build/.preview ]; then fi SRC=${ERESSEA}/git ${SRC}/s/preview build ${branch} || exit $? -${SRC}/s/preview version for game in 2 3 4 ; do ${SRC}/s/preview -g ${game} run && \ ${SRC}/s/preview -g ${game} send diff --git a/process/orders-accept b/process/orders-accept index e90c3d48f..151f0b196 100755 --- a/process/orders-accept +++ b/process/orders-accept @@ -30,15 +30,15 @@ rejecthtml = True games = [ { - "from" : "Eressea Server ", + "from" : "Eressea Server ", "prefix" : "Eressea" }, { - "from" : "Eressea Server ", + "from" : "Eressea Server ", "prefix": "E3" }, { - "from" : "Eressea Server ", + "from" : "Eressea Server ", "prefix": "E4" }, ] diff --git a/process/orders-process b/process/orders-process index a4d932648..753385e2e 100755 --- a/process/orders-process +++ b/process/orders-process @@ -65,7 +65,7 @@ messages = { # base directory for all your games: rootdir = "/home/eressea/eressea" -frommail = "Eressea Server " +frommail = "Eressea Server " orderbase = "orders.dir" sendmail = True maxlines = 25 diff --git a/res/core/common/buildings.xml b/res/core/common/buildings.xml index 423e90deb..cf183086b 100644 --- a/res/core/common/buildings.xml +++ b/res/core/common/buildings.xml @@ -23,7 +23,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -85,7 +85,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -107,7 +107,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -148,7 +148,7 @@ - + @@ -158,7 +158,7 @@ - + diff --git a/res/core/common/items.xml b/res/core/common/items.xml index 6afd220ff..c903a6b78 100644 --- a/res/core/common/items.xml +++ b/res/core/common/items.xml @@ -100,14 +100,14 @@ - + - + @@ -135,12 +135,6 @@ - - - - - - diff --git a/res/core/de/strings.xml b/res/core/de/strings.xml index c9a2ae616..b23d44ffb 100644 --- a/res/core/de/strings.xml +++ b/res/core/de/strings.xml @@ -34,7 +34,7 @@ Singdrachen sind von der Größe eines ausgewachsenden Tigers. Ihre Färbung reicht von schillerndem Rot, über dunkles Grün bis hin zu tiefem Schwarz. Alle bekannten Drachen dieser Art weisen eine hohe Intelligenz und ein hohes Maß an magischen Fähigkeiten auf. Wie Ihre großen Verwandten verfügen sie über einen Feuerodem. Sie lieben den Gesang und das üppige Mahl. Von Zeit zu Zeit gehen sie eine engen magisches Bund zu einem Magier ein. Wenn dies geschieht, so steht dem Magier ein äußerst loyaler und lohnender Vertrauter zur Seite. - + Song Dragons are roughly the size of a fully grown tiger. Their coloring ranges from bright red, through a dark green shade to a deep black. All known dragons of this species display a high level of intelligence and highly developed magical skills. Like their larger cousins, Song Dragons posess a firegland. They love singing and a good meal. From time to time one of these magnificent creatures will bond with a mage. When this happens, the mage is assured of a most loyal and useful familiar at his side. @@ -235,11 +235,6 @@ einzige Vorteil ihrer geringen Größe ist, dass sie sich leichter verstecken kann. - - Dieses magische Szepter, ein Geschenk Igjarjuks, sorgt für große - Verwirrung und Gedächtnisverlust. Syntax: BENUTZE "Szepter der - Tränen" - Setzt eine Einheit dieses Segel auf einem Schiff, so erhöht sich dessen Reichweite permanent um 1 Region. @@ -1118,14 +1113,6 @@ Trollhörner troll horns - - Feder des Phönix - feather of the phoenix - - - Federn des Phönix - feathers of the phoenix - @@ -1622,14 +1609,6 @@ Akkreditionen des Xontormia-Expreß - - Szepter der Tränen - wand of tears - - - Szepter der Tränen - wands of tears - Schneeball snowball @@ -2464,23 +2443,6 @@ skeleton - - Zentaur - centaur - - - Zentauren - centaurs - - - Zentauren - centaurs - - - Zentauren - centaur - - Schattenritter shadow knight @@ -3195,23 +3157,6 @@ young dragon - - Phönix - phoenix - - - Phönixe - phoenixes - - - Phönixen - phoenixes - - - Phönix - phoenix - - Illusion illusion diff --git a/res/core/fr/strings.xml b/res/core/fr/strings.xml index 8acc1d89f..d1801b338 100644 --- a/res/core/fr/strings.xml +++ b/res/core/fr/strings.xml @@ -1894,12 +1894,6 @@ aigle - - centaures - - - centaure - squelettes diff --git a/res/core/messages.xml b/res/core/messages.xml index 4669ab8b1..260f76c70 100644 --- a/res/core/messages.xml +++ b/res/core/messages.xml @@ -1,5 +1,13 @@ + + + + + + "$unit($unit): '$command' - Dieser Befehl ist unbekannt." + "$unit($unit): '$command' - Parse error, unknown command." + Die Region ist verwüstet, der Boden karg. The region is ravaged, the ground infertile. @@ -1245,14 +1253,6 @@ "$unit($unit) dies from poison damage taken in $region($region)." - - - - - "$unit($unit) schwenkt sein Szepter und sorgt für Verwirrung und Chaos in der Region." - "$unit($unit) waves their scepter and causes chaos and confusion in the region." - - @@ -1565,20 +1565,6 @@ "$unit($mage) konnte $int($amount) $if($eq($amount,1),"Bauer","Bauern") anwerben." "$unit($mage) managed to recruit $int($amount) $if($eq($amount,1),"peasant","peasants")." - - - - - "Ein bohrender Schmerz durchzuckt $unit($unit), Verwirrung macht sich breit." - "Pain pulses through $unit($unit), confusion spreads." - - - - - - ""AAAAAAAGHHHHHH!" - Ein Schrei durchzieht die Region, $unit($unit) windet sich vor Schmerz." - ""AAAAAAAGHHHHHH!" - $unit($unit) screams and squirms with pain." - @@ -1590,14 +1576,6 @@ "$unit($unit) in $region($region): '$order($command)' - A higher power prevents $unit($unit) from giving the object away. 'IT IS YOURS MY CHILD. ONLY YOURS.'." - - - - - "$unit($unit) sendet ein Stoßgebet an den Herrn der Schreie." - "$unit($unit) sends a prayer to the Lord of Screams." - - @@ -7512,7 +7490,7 @@ - "$unit($mage) weight $building($building)." + "$unit($mage) weiht $building($building)." "$unit($mage) blesses $building($building)." @@ -8090,27 +8068,6 @@ "The plank of $ship($ship) are inscribed with strange runes. ($int36($id))" - - - - - - - "$unit($unit) in $region($region): '$order($command)' - Die Kompassnadel springt wild hin und her und es lässt sich keine Richtung erkennen." - "$unit($unit) in $region($region): '$order($command)' - The needle jumps wildly and there is no specific direction recognizable." - - - - - - - - - - "$unit($unit) in $region($region): '$order($command)' - Die Kompassnadel zeigt nach $direction($dir)." - "$unit($unit) in $region($region): '$order($command)' - The needle points $direction($dir)." - - diff --git a/res/core/resources/iron.xml b/res/core/resources/iron.xml index 7bc4cb428..3f8897abc 100644 --- a/res/core/resources/iron.xml +++ b/res/core/resources/iron.xml @@ -7,6 +7,5 @@ - diff --git a/res/core/resources/laen.xml b/res/core/resources/laen.xml index 571026a0a..12062bf07 100644 --- a/res/core/resources/laen.xml +++ b/res/core/resources/laen.xml @@ -5,6 +5,5 @@ - diff --git a/res/core/resources/log.xml b/res/core/resources/log.xml index 012fe9a20..e3a33ef8b 100644 --- a/res/core/resources/log.xml +++ b/res/core/resources/log.xml @@ -6,7 +6,6 @@ - diff --git a/res/e3a/buildings.xml b/res/e3a/buildings.xml index 8ca30d27d..c1edbcc0b 100644 --- a/res/e3a/buildings.xml +++ b/res/e3a/buildings.xml @@ -19,7 +19,7 @@ - + diff --git a/res/e3a/races.xml b/res/e3a/races.xml index aeafc4218..2b0f68b9d 100644 --- a/res/e3a/races.xml +++ b/res/e3a/races.xml @@ -619,7 +619,7 @@ - + @@ -890,7 +890,7 @@ - + @@ -898,7 +898,7 @@ - + @@ -909,7 +909,7 @@ - + diff --git a/res/eressea/equipment.xml b/res/eressea/equipment.xml index d78705a06..bf7e38376 100644 --- a/res/eressea/equipment.xml +++ b/res/eressea/equipment.xml @@ -68,10 +68,6 @@ - - - - @@ -273,11 +269,6 @@ - - - - - diff --git a/res/eressea/races.xml b/res/eressea/races.xml index e91d2f6f6..7c3a5ab0c 100644 --- a/res/eressea/races.xml +++ b/res/eressea/races.xml @@ -27,7 +27,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -118,7 +118,7 @@ - + @@ -148,7 +148,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -244,7 +244,7 @@ - + @@ -275,7 +275,7 @@ - + @@ -308,7 +308,7 @@ - + @@ -339,7 +339,7 @@ - + @@ -370,7 +370,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -431,7 +431,7 @@ - + @@ -463,7 +463,7 @@ - + @@ -495,7 +495,7 @@ - + @@ -525,7 +525,7 @@ - + @@ -558,7 +558,7 @@ - + @@ -589,25 +589,25 @@ - + - + + regaura="1.000000" weight="100" capacity="540" speed="1.000000" hp="20" damage="0d0" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="10" scarepeasants="yes" fly="yes" walk="yes" teach="no" invinciblenonmagic="yes"> - + - + @@ -671,66 +671,66 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -742,7 +742,7 @@ - + @@ -755,7 +755,7 @@ - + @@ -769,13 +769,13 @@ - + - + @@ -978,7 +978,7 @@ - + @@ -1011,11 +1011,11 @@ - + - + @@ -1023,7 +1023,7 @@ - + @@ -1037,7 +1037,7 @@ - + @@ -1055,7 +1055,7 @@ - + @@ -1073,7 +1073,7 @@ - + @@ -1089,7 +1089,7 @@ - + @@ -1104,7 +1104,7 @@ - + @@ -1119,7 +1119,7 @@ - + @@ -1134,40 +1134,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + @@ -1209,36 +1181,6 @@ - @@ -1328,7 +1270,7 @@ - + @@ -1342,13 +1284,13 @@ - + - + @@ -1357,7 +1299,7 @@ - + diff --git a/res/eressea/strings.xml b/res/eressea/strings.xml index b7db0eb4b..61a35ebe5 100644 --- a/res/eressea/strings.xml +++ b/res/eressea/strings.xml @@ -268,13 +268,7 @@ Muscheln seashells - - - Die ersten beiden Züge mußt du abgeben, sonst wird deine - Partei sofort wieder gelöscht, um Karteileichen zu vermeiden. - If you fail to send in orders for one of the first two turns, your faction will be erased from the game to reduce the number of inactive players in Eressea. - - + Mit der ersten Auswertung bekommst du einen Computerreport, den du mit vielen Tools wie z.B. Magellan benutzen kannst. Wenn du ihn weiterhin bekommen willst, gib einer deiner Einheiten den Befehl OPTION diff --git a/res/races/demon.xml b/res/races/demon.xml index 9f97d4d8f..a350fef4a 100644 --- a/res/races/demon.xml +++ b/res/races/demon.xml @@ -1,5 +1,10 @@ - + diff --git a/res/races/dragon.xml b/res/races/dragon.xml index 7a6dee3a7..e4a1a7fec 100644 --- a/res/races/dragon.xml +++ b/res/races/dragon.xml @@ -1,6 +1,9 @@ - +"6" damage="2d30" unarmedattack="0" unarmeddefense="0" +attackmodifier="7" defensemodifier="7" scarepeasants="yes" fly="yes" +income="1000" walk="yes" teach="no" getitem="yes" resistbash="yes" +dragon="yes"> + diff --git a/res/races/goblin-2.xml b/res/races/goblin-2.xml index e91781aa6..9a9c265be 100644 --- a/res/races/goblin-2.xml +++ b/res/races/goblin-2.xml @@ -1,5 +1,9 @@ - + diff --git a/res/races/goblin-3.xml b/res/races/goblin-3.xml index a59ee6f77..e85b0c645 100644 --- a/res/races/goblin-3.xml +++ b/res/races/goblin-3.xml @@ -1,5 +1,9 @@ - + diff --git a/res/races/goblin.xml b/res/races/goblin.xml index af097396c..177c82ffe 100644 --- a/res/races/goblin.xml +++ b/res/races/goblin.xml @@ -1,5 +1,10 @@ - + diff --git a/res/races/troll.xml b/res/races/troll.xml index f151126fb..a2341851b 100644 --- a/res/races/troll.xml +++ b/res/races/troll.xml @@ -1,5 +1,10 @@ - + diff --git a/res/races/wyrm.xml b/res/races/wyrm.xml index 8569f4c19..b9f95d9ef 100644 --- a/res/races/wyrm.xml +++ b/res/races/wyrm.xml @@ -1,5 +1,9 @@ - - + + diff --git a/res/races/youngdragon.xml b/res/races/youngdragon.xml index 541f68142..71bc4214b 100644 --- a/res/races/youngdragon.xml +++ b/res/races/youngdragon.xml @@ -1,5 +1,9 @@ - - + + diff --git a/res/races/zombie.xml b/res/races/zombie.xml index faecf021d..8c23aea83 100644 --- a/res/races/zombie.xml +++ b/res/races/zombie.xml @@ -3,7 +3,7 @@ recruitcost="-1" maintenance="0" weight="1000" capacity="440" speed="1.000000" hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="no" walk="yes" shapeshift="no" giveperson="no" giveunit="no" - getitem="no" recruitethereal="no" equipment="yes" scarepeasants="yes" + getitem="no" equipment="yes" scarepeasants="yes" cansteal="no" unarmedguard="yes" absorbpeasants="yes" noheal="yes" undead="yes" resistpierce="yes"> diff --git a/s/build b/s/build index 1d580a349..b59804626 100755 --- a/s/build +++ b/s/build @@ -35,12 +35,9 @@ fi git submodule update -if [ -z `which tolua` ]; then -echo "build tolua" -cd $ROOT/tolua ; make -fi - echo "build eressea" cd $ROOT/$BUILD +VERSION=$(git describe --match 'v*.*.*' --tags | sed 's/^v//') +cmake -DERESSEA_VERSION="$VERSION" .. make $MAKEOPTS && make test cd $OLDPWD diff --git a/s/cmake-init b/s/cmake-init index 35378d6a5..ea94afb7c 100755 --- a/s/cmake-init +++ b/s/cmake-init @@ -9,17 +9,18 @@ while [ ! -d $ROOT/.git ]; do done [ -z $BUILD ] && BUILD=Debug -MACHINE=`uname -m` [ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang" [ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc" [ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc" [ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc" + +MACHINE=`$CC -dumpmachine` +[ -z $MACHINE ] && MACHINE=`uname -m` BIN_DIR="$ROOT/build-$MACHINE-$CC-$BUILD" mkdir -p $BIN_DIR rm -f $BUILD ln -sf $BIN_DIR $BUILD -MACHINE=$(gcc -dumpmachine) rm -f CMakeCache.txt # use anything installed in /opt or /usr @@ -41,10 +42,23 @@ ARGS=" -DCMAKE_MODULE_PATH=$ROOT/cmake/Modules \ -DCMAKE_PREFIX_PATH=$PREFIX_PATH \ -DCMAKE_INSTALL_PREFIX=$HOME/eressea/server" +git submodule update --init + path="$(which tolua)" if [ "$HAVE_TOLUA" = "0" ] || [ -z $path ] ; then echo "tolua is not installed, building from source" - cd $ROOT/tolua ; make + cd $ROOT + if [ ! -d tolua ]; then + LUA_VERSION="5.2" + if [ -d /usr/include/lua5.1 ] || [ -d /usr/local/include/lua5.1 ]; then + LUA_VERSION="5.1" + fi + echo "fetching tolua ${LUA_VERSION} from github..." + git clone https://github.com/ennorehling/tolua-${LUA_VERSION}.git tolua + fi + echo "building tolua..." + cd tolua + make ARGS="$ARGS -DPC_TOLUA_DIR=$ROOT/tolua" else echo "tolua is $path" diff --git a/s/coverity b/s/coverity index 0ade4a113..3d218adb7 100755 --- a/s/coverity +++ b/s/coverity @@ -1,9 +1,7 @@ #!/bin/bash -set -e -VERSION="$1" +#set -e +VERSION=$(git describe --tags --match 'v*.*.*') echo "submitting version $VERSION" -shift -DESC="$*" cd Debug make clean ../../coverity/bin/cov-build --dir cov-int make eressea @@ -12,5 +10,5 @@ curl --form token=IISXKH3A1ngZGfFmBz_aSA \ --form email=enno.rehling@gmail.com \ --form file=@eressea.tgz \ --form version="$VERSION" \ - --form description="$DESC" \ + --form description="Eressea coverity check" \ https://scan.coverity.com/builds?project=eressea%2Fserver diff --git a/s/preview b/s/preview index 79411aea6..1e5d0db48 100755 --- a/s/preview +++ b/s/preview @@ -22,6 +22,7 @@ exit $2 # otherwise function build() { assert_dir $SOURCE cd $SOURCE +rm -rf crypto tolua git fetch || abort "failed to update source. do you have local changes?" [ -z $1 ] || git checkout $1 git pull @@ -44,13 +45,6 @@ function assert_dir() { [ -d $1 ] || abort "missing directory: $1" } -function version() { -assert_dir $SOURCE -cd $SOURCE -build=$(grep BUILD src/buildno.h | awk '{ print $3 }') -echo "eressea build $build" -} - function setup() { assert_dir $SOURCE assert_dir $LIVE @@ -137,9 +131,6 @@ shift $((OPTIND-1)) while [ ! -z $1 ]; do case "$1" in -"version") - version - ;; "build") shift build $* diff --git a/s/release b/s/release index a5e4acf94..89b2bd9e9 100755 --- a/s/release +++ b/s/release @@ -3,19 +3,8 @@ import os import sys -template="""#define VERSION_MAJOR %s -#define VERSION_MINOR %s -#define VERSION_BUILD %s -""" - def new_version(ver): - sp = ver.split(".") - sp = (sp[0], sp[1], sp[2]) - file = open("src/buildno.h", "w") - file.write(template % sp) - file.close() - os.system("git add src/buildno.h") - os.system("git commit -m 'release version %s'" % ver) os.system("git tag -f v%s" % ver) + os.system("git push --tags") new_version(sys.argv[1]) diff --git a/s/runtests b/s/runtests index d0b3432e8..e0e20b5c7 100755 --- a/s/runtests +++ b/s/runtests @@ -16,10 +16,10 @@ fi $ROOT/$BUILD/eressea/test_eressea cd $ROOT [ -e eressea.ini ] || ln -sf conf/eressea.ini -$ROOT/$BUILD/eressea/eressea -v0 scripts/run-tests.lua -$ROOT/$BUILD/eressea/eressea -v0 scripts/run-tests-e2.lua -$ROOT/$BUILD/eressea/eressea -v0 scripts/run-tests-e3.lua -$ROOT/$BUILD/eressea/eressea -v0 scripts/run-tests-e4.lua -rm -rf data reports orders.txt score score.alliances +$ROOT/$BUILD/eressea/eressea -v1 scripts/run-tests.lua +$ROOT/$BUILD/eressea/eressea -v1 scripts/run-tests-e2.lua +$ROOT/$BUILD/eressea/eressea -v1 scripts/run-tests-e3.lua +$ROOT/$BUILD/eressea/eressea -v1 scripts/run-tests-e4.lua +rm -rf data reports orders.txt score score.alliances datum turn cd $OLDWPD diff --git a/s/travis-build b/s/travis-build index 414a70f80..9293ac12d 100755 --- a/s/travis-build +++ b/s/travis-build @@ -10,6 +10,12 @@ $BUILD/iniparser/inifile eressea.ini add lua:paths lunit:scripts fi } +integration_tests() { +cd tests +./write-reports.sh +./run-turn.sh +} + set -e [ -z $BUILD ] && BUILD=Debug ; export BUILD s/cmake-init @@ -17,6 +23,5 @@ s/build cd $ROOT inifile s/runtests -cd tests -./write-reports.sh -./run-turn.sh + +integration_tests diff --git a/scripts/eressea/autoseed.lua b/scripts/eressea/autoseed.lua index 2441c7079..562c39361 100644 --- a/scripts/eressea/autoseed.lua +++ b/scripts/eressea/autoseed.lua @@ -43,13 +43,17 @@ local function read_players() -- return {{ email = "noreply@mailinator.com", race = "dwarf", lang = "de" }} local players = {} local input = io.open("newfactions", "r") - while input do + if input then local str = input:read("*line") - if str==nil then break end - local email, race, lang = str:match("([^ ]*) ([^ ]*) ([^ ]*)") - if email and string.char(string.byte(email, 1))~='#' then - table.insert(players, { race = race, lang = lang, email = email }) + while str do + if str==nil then break end + local email, race, lang = str:match("([^ ]*) ([^ ]*) ([^ ]*)") + if email and string.char(string.byte(email, 1))~='#' then + table.insert(players, { race = race, lang = lang, email = email }) + end + str = input:read("*line") end + input:close() end return players end diff --git a/scripts/eressea/cursed.lua b/scripts/eressea/cursed.lua index 91c143ed1..4a3e83b85 100644 --- a/scripts/eressea/cursed.lua +++ b/scripts/eressea/cursed.lua @@ -23,6 +23,7 @@ function cursed.init() if f then print("found cursed.txt") curse(f) + f:close() end end diff --git a/scripts/eressea/ponnuki.lua b/scripts/eressea/ponnuki.lua index f220aa380..994a16ff0 100644 --- a/scripts/eressea/ponnuki.lua +++ b/scripts/eressea/ponnuki.lua @@ -25,11 +25,10 @@ function ponnuki.init() local home = get_region(-67, -5) local f = get_faction(666) if home and f then - u = add_unit(f, home) + u = unit.create(f, home, 1, "illusion") u.id = atoi36("ponn") u.name = "Ponnuki" u.info = "Go, Ponnuki, Go!" - u.race = "illusion" u:set_racename("Ritter von Go") else eressea.log.error("Ponnuki cannot find Magrathea") diff --git a/scripts/eressea/xmasitems.lua b/scripts/eressea/xmasitems.lua index b31691d72..a05e023b8 100644 --- a/scripts/eressea/xmasitems.lua +++ b/scripts/eressea/xmasitems.lua @@ -62,9 +62,7 @@ end function use_snowman(u, amount) if amount>0 and u.region.terrain == "glacier" then - local man = unit.create(u.faction, u.region) - man.race = "snowman" - man.number = amount + local man = unit.create(u.faction, u.region, amount, "snowman") return amount end return -4 diff --git a/scripts/tests/bindings.lua b/scripts/tests/bindings.lua index 189d34769..9aab6fd57 100644 --- a/scripts/tests/bindings.lua +++ b/scripts/tests/bindings.lua @@ -34,7 +34,6 @@ function test_process() assert_equal("function", _G.type(eressea.process.siege)) assert_equal("function", _G.type(eressea.process.leave)) assert_equal("function", _G.type(eressea.process.promote)) - assert_equal("function", _G.type(eressea.process.renumber)) assert_equal("function", _G.type(eressea.process.restack)) assert_equal("function", _G.type(eressea.process.set_spells)) assert_equal("function", _G.type(eressea.process.set_help)) diff --git a/scripts/tests/common.lua b/scripts/tests/common.lua index 446a7cf6d..670060816 100644 --- a/scripts/tests/common.lua +++ b/scripts/tests/common.lua @@ -380,6 +380,21 @@ function test_events() assert(fail==0) end +function test_renumber_ship() + local r = region.create(0, 0, "plain") + local f = faction.create("noreply4@eressea.de", "human", "de") + local u = unit.create(f, r) + local s = ship.create(r, config.ships[1]) + u.ship = s + u:add_order("NUMMER SCHIFF 1") + process_orders() + assert_equal(1, s.id) + u:clear_orders() + u:add_order("NUMMER SCHIFF 2") + process_orders() + assert_equal(2, s.id) +end + function test_recruit2() local r = region.create(0, 0, "plain") local f = faction.create("noreply4@eressea.de", "human", "de") @@ -673,8 +688,6 @@ function test_laen2() local laen = r:get_resource("laen") process_orders() - init_reports() --- write_report(u1.faction) assert_equal(laen - 2, r:get_resource("laen")) assert_equal(2, u1:get_item("laen")) end @@ -965,120 +978,6 @@ function test_bug_1795_demons() assert_equal(peasants, r:get_resource("peasant")) end -module("tests.report", package.seeall, lunit.testcase) - -function setup() - eressea.free_game() - eressea.settings.set("nmr.timeout", "0") - eressea.settings.set("rules.food.flags", "4") -end - -local function find_in_report(f, pattern, extension) - extension = extension or "nr" - local filename = config.reportpath .. "/" .. get_turn() .. "-" .. itoa36(f.id) .. "." .. extension - local report = io.open(filename, 'r'); - assert_not_nil(report) - t = report:read("*all") - report:close() - - local start, _ = string.find(t, pattern) - return start~=nil -end - -local function remove_report(faction) - local filetrunk = config.reportpath .. "/" .. get_turn() .. "-" .. itoa36(faction.id) - os.remove(filetrunk .. ".nr") - os.remove(filetrunk .. ".cr") - os.remove(filetrunk .. ".txt") -end - -function test_coordinates_no_plane() - local r = region.create(0, 0, "mountain") - local f = faction.create("noplane@eressea.de", "human", "de") - local u = unit.create(f, r, 1) - init_reports() - write_report(f) - assert_true(find_in_report(f, r.name .. " %(0,0%), Berg")) - remove_report(f) -end - -function test_show_shadowmaster_attacks() - local r = region.create(0, 0, "plain") - local f = faction.create("noreply@eressea.de", "human", "de") - local u = unit.create(f, r, 1) - u.race = "shadowmaster" - u:clear_orders() - u:add_order("ZEIGE Schattenmeister") - process_orders() - init_reports() - write_report(f) - assert_false(find_in_report(f, ", ,")) - remove_report(f) -end - -function test_coordinates_named_plane() - local p = plane.create(0, -3, -3, 7, 7, "Hell") - local r = region.create(0, 0, "mountain") - local f = faction.create("noreply@eressea.de", "human", "de") - local u = unit.create(f, r, 1) - init_reports() - write_report(f) - assert_true(find_in_report(f, r.name .. " %(0,0,Hell%), Berg")) - remove_report(f) -end - -function test_coordinates_unnamed_plane() - local p = plane.create(0, -3, -3, 7, 7) - local r = region.create(0, 0, "mountain") - local f = faction.create("noreply@eressea.de", "human", "de") - local u = unit.create(f, r, 1) - init_reports() - write_report(f) - assert_true(find_in_report(f, r.name .. " %(0,0%), Berg")) - remove_report(f) -end - -function test_coordinates_noname_plane() - local p = plane.create(0, -3, -3, 7, 7, "") - local r = region.create(0, 0, "mountain") - local f = faction.create("noreply@eressea.de", "human", "de") - local u = unit.create(f, r, 1) - init_reports() - write_report(f) - assert_true(find_in_report(f, r.name .. " %(0,0%), Berg")) - remove_report(f) -end - -function test_lighthouse() - eressea.free_game() - local r = region.create(0, 0, "mountain") - local f = faction.create("noreply@eressea.de", "human", "de") - region.create(1, 0, "mountain") - region.create(2, 0, "ocean") - region.create(0, 1, "firewall") - region.create(3, 0, "mountain") - region.create(4, 0, "plain") - local u = unit.create(f, r, 1) - local b = building.create(r, "lighthouse") - b.size = 100 - b.working = true - u.building = b - u:set_skill("perception", 9) - u:add_item("money", 1000) - assert_not_nil(b) - - init_reports() - write_report(f) - assert_true(find_in_report(f, " %(1,0%) %(vom Turm erblickt%)")) - assert_true(find_in_report(f, " %(2,0%) %(vom Turm erblickt%)")) - assert_true(find_in_report(f, " %(3,0%) %(vom Turm erblickt%)")) - - assert_false(find_in_report(f, " %(0,0%) %(vom Turm erblickt%)")) - assert_false(find_in_report(f, " %(0,1%) %(vom Turm erblickt%)")) - assert_false(find_in_report(f, " %(4,0%) %(vom Turm erblickt%)")) - remove_report(f) -end - module("tests.parser", package.seeall, lunit.testcase) function setup() @@ -1139,3 +1038,16 @@ function test_prefix() u1.faction.locale = "en" assert_not_nil(u1:show():find("archelf")) end + +function test_recruit() + local r = region.create(0, 0, "plain") + local f = faction.create("noreply@eressea.de", "human", "de") + local u = unit.create(f, r, 1) + + u:add_item("money", 1000) + set_order(u, "REKRUTIERE 5") + process_orders() + for u in f.units do + assert_equal(6, u.number) + end +end diff --git a/scripts/tests/config.lua b/scripts/tests/config.lua index d21ecda1e..e47b7f925 100644 --- a/scripts/tests/config.lua +++ b/scripts/tests/config.lua @@ -9,19 +9,15 @@ end function test_read_race() local f eressea.free_game() - f = faction.create("orc@example.com", "orc", "en") - assert_equal(nil, f) assert_not_nil(eressea.config) eressea.config.parse('{ "races": { "orc" : {}}}') f = faction.create("orc@example.com", "orc", "en") assert_not_nil(f) end -function test_read_ship() +function disable_test_read_ship() local s eressea.free_game() - s = ship.create(nil, "boat") - assert_equal(nil, s) assert_not_nil(eressea.config) conf = [[{ "ships": { diff --git a/scripts/tests/e2/e2features.lua b/scripts/tests/e2/e2features.lua index efed50ea1..c4a53da76 100644 --- a/scripts/tests/e2/e2features.lua +++ b/scripts/tests/e2/e2features.lua @@ -215,7 +215,8 @@ function test_snowman() process_orders() for u2 in r.units do if u2.id~=u.id then - assert_equal(u2.race, "snowman") + assert_equal("snowman", u2.race) + assert_equal(1000, u2.hp) u = nil break end diff --git a/scripts/tests/e2/guard.lua b/scripts/tests/e2/guard.lua index f5be800c2..8e62a364d 100644 --- a/scripts/tests/e2/guard.lua +++ b/scripts/tests/e2/guard.lua @@ -13,24 +13,24 @@ function test_guard_unarmed() local r1 = region.create(0, 0, "plain") local f1 = faction.create("hodor@eressea.de", "human", "de") local u1 = unit.create(f1, r1, 1) - assert_equal(nil, u1.guard) + assert_equal(false, u1.guard) u1:clear_orders() u1:add_order("BEWACHE") process_orders() - assert_equal(nil, u1.guard) + assert_equal(false, u1.guard) end function test_guard_armed() local r1 = region.create(0, 0, "plain") local f1 = faction.create("hodor@eressea.de", "human", "de") local u1 = unit.create(f1, r1, 1) - assert_equal(nil, u1.guard) + assert_equal(false, u1.guard) u1:add_item("sword", 1) u1:set_skill("melee", 2) u1:clear_orders() u1:add_order("BEWACHE") process_orders() - assert_equal(249, u1.guard) + assert_equal(true, u1.guard) end function test_guard_allows_move_after_combat() -- bug 1493 @@ -47,7 +47,7 @@ function test_guard_allows_move_after_combat() -- bug 1493 u1:clear_orders() u1:add_order("BEWACHE") process_orders() - assert_equal(249, u1.guard) + assert_equal(true, u1.guard) u1:clear_orders() u1:add_order("NACH O") u1:add_order("ATTACKIERE " .. itoa36(u2.id)) @@ -67,7 +67,7 @@ function test_no_guard_no_move_after_combat() -- bug 1493 u1:add_order("BEWACHE") u1:add_item("sword", 10) u1:set_skill("melee", 2) - assert_equal(nil, u1.guard) + assert_equal(false, u1.guard) u1:clear_orders() u1:add_order("NACH O") u1:add_order("ATTACKIERE " .. itoa36(u2.id)) diff --git a/scripts/tests/e2/init.lua b/scripts/tests/e2/init.lua index cd6cf640a..afaac7209 100644 --- a/scripts/tests/e2/init.lua +++ b/scripts/tests/e2/init.lua @@ -1,3 +1,5 @@ +require 'tests.economy' + require 'tests.e2.undead' require 'tests.e2.shiplanding' require 'tests.e2.e2features' @@ -8,6 +10,7 @@ require 'tests.e2.spells' require 'tests.e2.stealth' require 'tests.orders' require 'tests.common' +require 'tests.report' require 'tests.storage' require 'tests.magicbag' require 'tests.process' diff --git a/scripts/tests/e2/movement.lua b/scripts/tests/e2/movement.lua index 706ed9ad2..390af2c48 100644 --- a/scripts/tests/e2/movement.lua +++ b/scripts/tests/e2/movement.lua @@ -4,6 +4,7 @@ module("tests.e2.movement", package.seeall, lunit.testcase) function setup() eressea.free_game() + eressea.settings.set("rules.food.flags", "4") eressea.settings.set("nmr.timeout", "0") eressea.settings.set("NewbieImmunity", "0") end @@ -29,7 +30,9 @@ end process_orders() --- write_reports() + if r2~=u1.region then + write_reports() + end assert_equal(r2, u1.region) -- should pass, but fails!!! end diff --git a/scripts/tests/e3/init.lua b/scripts/tests/e3/init.lua index 2e4096712..4655fdcef 100644 --- a/scripts/tests/e3/init.lua +++ b/scripts/tests/e3/init.lua @@ -6,5 +6,6 @@ require 'tests.e3.parser' require 'tests.e3.morale' require 'tests.orders' require 'tests.common' +-- require 'tests.report' require 'tests.magicbag' require 'tests.process' diff --git a/scripts/tests/economy.lua b/scripts/tests/economy.lua new file mode 100644 index 000000000..b628dd47b --- /dev/null +++ b/scripts/tests/economy.lua @@ -0,0 +1,146 @@ +require "lunit" + +module("tests.economy", package.seeall, lunit.testcase) + +function setup() + eressea.free_game() + eressea.settings.set("NewbieImmunity", "0") + eressea.settings.set("study.produceexp", "0") + eressea.settings.set("nmr.timeout", "0") + eressea.settings.set("rules.food.flags", "4") -- FOOD_IS_FREE + eressea.settings.set("rules.encounters", "0") +end + +function test_no_guards() + local r = region.create(0, 0, "plain") + r:set_resource("tree", 100) + local u = unit.create(faction.create("human"), r) + u:set_skill("forestry", 1) + u:add_order("MACHE HOLZ") + process_orders() + assert_equal(1, u:get_item("log")) + process_orders() + assert_equal(2, u:get_item("log")) +end + +function test_elf_guards_trees() + local r = region.create(0, 0, "plain") + r:set_resource("tree", 100) + local u = unit.create(faction.create("human"), r) + u:set_skill("forestry", 1) + local guard = unit.create(faction.create("elf"), r, 1, "elf") + guard:add_order("BEWACHEN") -- fails, because unarmed + u:add_order("MACHE HOLZ") + process_orders() + assert_equal(1, u:get_item("log")) + guard:add_item("sword", 1) + guard:set_skill("melee", 1) + guard:add_order("BEWACHEN") -- success + process_orders() + -- GUARD starts after MAKE: + assert_equal(2, u:get_item("log")) + process_orders() + -- GUARD was active this turn: + assert_equal(2, u:get_item("log")) +end + +function test_catapults_dont_guard() + local r = region.create(0, 0, "plain") + r:set_resource("tree", 100) + local u = unit.create(faction.create("human"), r) + u:set_skill("forestry", 1) + local guard = unit.create(faction.create("elf"), r, 1, "elf") + guard:add_order("BEWACHEN") + u:add_order("MACHE HOLZ") + process_orders() + assert_equal(1, u:get_item("log")) + guard:add_item("catapult", 1) + guard:set_skill("catapult", 1) + guard:add_order("BEWACHEN") + process_orders() + -- GUARD starts after MAKE: + assert_equal(2, u:get_item("log")) + process_orders() + -- GUARD was active this turn, but catapults do not count: + assert_equal(3, u:get_item("log")) +end + +function test_ent_guards_trees() + local r = region.create(0, 0, "plain") + r:set_resource("tree", 100) + local u = unit.create(faction.create("human"), r) + u:set_skill("forestry", 1) + local guard = unit.create(get_monsters(), r, 1, "ent") + guard:add_order("BEWACHEN") + u:add_order("MACHE HOLZ") + process_orders() + assert_equal(1, u:get_item("log")) + process_orders() + assert_equal(1, u:get_item("log")) +end + +function test_guard_stops_recruit() + local r = region.create(0, 0, "plain") + r:set_resource("peasant", 100) + local u = unit.create(faction.create("human"), r) + local guard = unit.create(get_monsters(), r, 1) + guard:add_order("BEWACHEN") + + u:add_item("money", 1000) + assert_equal(1, u.number) + u:add_order("REKRUTIERE 1") + process_orders() + assert_equal(2, u.number) + u:add_order("REKRUTIERE 1") + process_orders() + assert_equal(2, u.number) +end + +function test_guard_protects_iron() + local r = region.create(0, 0, "plain") + r:set_resource("iron", 100) + local level = r:get_resourcelevel("iron") + local u = unit.create(faction.create("human"), r) + u:set_skill("mining", level) + local guard = unit.create(get_monsters(), r, 1) + guard:add_order("BEWACHEN") + + u:add_order("MACHE EISEN") + process_orders() + assert_equal(level, u:get_item("iron")) + process_orders() + assert_equal(level, u:get_item("iron")) +end + +function test_ironkeeper_guards_iron() + local r = region.create(0, 0, "plain") + r:set_resource("iron", 100) + local level = r:get_resourcelevel("iron") + local u = unit.create(faction.create("human"), r) + u:set_skill("mining", level) + local guard = unit.create(faction.create("mountainguard"), r, 1, "mountainguard") + guard:add_order("BEWACHEN") + u:add_order("MACHE EISEN") + process_orders() + assert_equal(level, u:get_item("iron")) + process_orders() + assert_equal(level, u:get_item("iron")) +end + +function test_ent_guards_trees() + local r = region.create(0, 0, "plain") + r:set_resource("tree", 100) + local u = unit.create(faction.create("human"), r) + u:set_skill("mining", 1) + local guard = unit.create(get_monsters(), r, 1, "ent") + u:set_skill("forestry", 1) + guard:clear_orders() + u:clear_orders() + + guard:add_order("BEWACHEN") + u:add_order("MACHE HOLZ") + process_orders() + assert_equal(1, u:get_item("log")) + process_orders() + assert_equal(1, u:get_item("log")) +end diff --git a/scripts/tests/faction.lua b/scripts/tests/faction.lua index f0cd9335c..38fdc4eb7 100644 --- a/scripts/tests/faction.lua +++ b/scripts/tests/faction.lua @@ -17,7 +17,7 @@ function setup() end function test_faction_flags() - assert_equal(0, f.flags) + assert_equal(2, f.flags) -- FFL_ISNEW f.flags = 42 assert_equal(42, f.flags) end diff --git a/scripts/tests/orders.lua b/scripts/tests/orders.lua index a0b03f825..dde9508e9 100644 --- a/scripts/tests/orders.lua +++ b/scripts/tests/orders.lua @@ -165,7 +165,7 @@ end function test_process_renumber() u:add_order("NUMMER EINHEIT 'ii'") - eressea.process.renumber() + process_orders() assert_equal(666, u.id) end diff --git a/scripts/tests/report.lua b/scripts/tests/report.lua new file mode 100644 index 000000000..2a037c770 --- /dev/null +++ b/scripts/tests/report.lua @@ -0,0 +1,122 @@ +require "lunit" + +module("tests.report", package.seeall, lunit.testcase) + +function setup() + eressea.free_game() + eressea.settings.set("nmr.timeout", "0") + eressea.settings.set("rules.food.flags", "4") +end + +local function find_in_report(f, pattern, extension) + extension = extension or "nr" + local filename = config.reportpath .. "/" .. get_turn() .. "-" .. itoa36(f.id) .. "." .. extension + local report = io.open(filename, 'r'); + assert_not_nil(report) + t = report:read("*all") + report:close() + + local start, _ = string.find(t, pattern) + return start~=nil +end + +local function remove_report(faction) + local filetrunk = config.reportpath .. "/" .. get_turn() .. "-" .. itoa36(faction.id) + os.remove(filetrunk .. ".nr") + os.remove(filetrunk .. ".cr") + os.remove(filetrunk .. ".txt") +end + +function setup() + eressea.free_game() + eressea.settings.set("nmr.timeout", "0") + eressea.settings.set("rules.food.flags", "4") +end + +function test_coordinates_unnamed_plane() + local p = plane.create(0, -3, -3, 7, 7) + local r = region.create(0, 0, "mountain") + local f = faction.create("unnamed@eressea.de", "human", "de") + local u = unit.create(f, r, 1) + init_reports() + write_report(f) + assert_true(find_in_report(f, r.name .. " %(0,0%), Berg")) + remove_report(f) +end + +function test_coordinates_no_plane() + local r = region.create(0, 0, "mountain") + local f = faction.create("noplane@eressea.de", "human", "de") + local u = unit.create(f, r, 1) + init_reports() + write_report(f) + assert_true(find_in_report(f, r.name .. " %(0,0%), Berg")) + remove_report(f) +end + +function test_show_shadowmaster_attacks() + local r = region.create(0, 0, "plain") + local f = faction.create("noreply@eressea.de", "human", "de") + local u = unit.create(f, r, 1) + u.race = "shadowmaster" + u:clear_orders() + u:add_order("ZEIGE Schattenmeister") + process_orders() + init_reports() + write_report(f) + assert_false(find_in_report(f, ", ,")) + remove_report(f) +end + +function test_coordinates_named_plane() + local p = plane.create(0, -3, -3, 7, 7, "Hell") + local r = region.create(0, 0, "mountain") + local f = faction.create("noreply@eressea.de", "human", "de") + local u = unit.create(f, r, 1) + init_reports() + write_report(f) + assert_true(find_in_report(f, r.name .. " %(0,0,Hell%), Berg")) + remove_report(f) +end + +function test_coordinates_noname_plane() + local p = plane.create(0, -3, -3, 7, 7, "") + local r = region.create(0, 0, "mountain") + local f = faction.create("noreply@eressea.de", "human", "de") + local u = unit.create(f, r, 1) + init_reports() + write_report(f) + assert_true(find_in_report(f, r.name .. " %(0,0%), Berg")) + remove_report(f) +end + +function test_lighthouse() + eressea.free_game() + local r = region.create(0, 0, "mountain") + local f = faction.create("noreply@eressea.de", "human", "de") + region.create(1, 0, "mountain") + region.create(2, 0, "ocean") + region.create(0, 1, "firewall") + region.create(3, 0, "mountain") + region.create(4, 0, "plain") + local u = unit.create(f, r, 1) + local b = building.create(r, "lighthouse") + b.size = 100 + b.working = true + u.building = b + u:set_skill("perception", 9) + u:add_item("money", 1000) + assert_not_nil(b) + + init_reports() + write_report(f) + assert_true(find_in_report(f, " %(1,0%) %(vom Turm erblickt%)")) + assert_true(find_in_report(f, " %(2,0%) %(vom Turm erblickt%)")) + assert_true(find_in_report(f, " %(3,0%) %(vom Turm erblickt%)")) + + assert_false(find_in_report(f, " %(0,0%) %(vom Turm erblickt%)")) + assert_false(find_in_report(f, " %(0,1%) %(vom Turm erblickt%)")) + assert_false(find_in_report(f, " %(4,0%) %(vom Turm erblickt%)")) + remove_report(f) +end + diff --git a/scripts/tests/xmas.lua b/scripts/tests/xmas.lua index e1cd4753b..7ac4ce731 100644 --- a/scripts/tests/xmas.lua +++ b/scripts/tests/xmas.lua @@ -6,6 +6,8 @@ function setup() eressea.free_game() eressea.settings.set("nmr.timeout", "0") eressea.settings.set("rules.grow.formula", "0") + eressea.settings.set("rules.peasants.growth.factor", "0") + eressea.settings.set("volcano.active.percent", "0") end function test_snowglobe_fail() @@ -51,7 +53,7 @@ function test_snowglobe() for k, v in pairs(xform) do r2.terrain = k process_orders() - -- TODO: re-enable! assert_equal(v, r2.terrain) + assert_equal(v, r2.terrain) if k~=v then have=have - 1 else diff --git a/scripts/tools/build-e3.lua b/scripts/tools/build-e3.lua index 8ea2693b8..b33927877 100644 --- a/scripts/tools/build-e3.lua +++ b/scripts/tools/build-e3.lua @@ -124,30 +124,33 @@ end function seed() local input = io.open(config.basepath .. "/parteien.txt") - for f in factions() do - if f.race=="vampunicorn" then - local str = input:read("*line") - if str==nil then break end - local race, lang, email = str:match("([^ ]*) ([^ ]*) ([^ ]*)") - f.race = race:lower() - f.options = f.options + 4096 - f.email = email - f.locale = lang - for u in f.units do - u.race = race:lower() - u.hp = u.hp_max - local b = building.create(u.region, "castle") - if lang=="de" then - u.name = "Entdecker" - b.name = "Heimat" - else - u.name = "Explorer" - b.name = "Home" + if input then + for f in factions() do + if f.race=="vampunicorn" then + local str = input:read("*line") + if str==nil then break end + local race, lang, email = str:match("([^ ]*) ([^ ]*) ([^ ]*)") + f.race = race:lower() + f.options = f.options + 4096 + f.email = email + f.locale = lang + for u in f.units do + u.race = race:lower() + u.hp = u.hp_max + local b = building.create(u.region, "castle") + if lang=="de" then + u.name = "Entdecker" + b.name = "Heimat" + else + u.name = "Explorer" + b.name = "Home" + end + b.size = 10 + u.building = b + end end - b.size = 10 - u.building = b end - end + input:close() end for r in regions() do r:set_resource("sapling", r:get_resource("tree")/4) diff --git a/scripts/tools/build-e4.lua b/scripts/tools/build-e4.lua index d873ab00b..b4ac57f8c 100644 --- a/scripts/tools/build-e4.lua +++ b/scripts/tools/build-e4.lua @@ -27,27 +27,29 @@ else end local f=assert(io.open("factions", "r")) -line=f:read("*line") -players = {} -emails = {} -patrons = {} -nplayers = 0 -while line~=nil do - fields = {} - line:gsub("([^\t]*)\t*", function(c) table.insert(fields, c) end) +if f then line=f:read("*line") - email = fields[1] - if fields[2]=='yes' then - table.insert(patrons, email) - else - table.insert(emails, email) + players = {} + emails = {} + patrons = {} + nplayers = 0 + while line~=nil do + fields = {} + line:gsub("([^\t]*)\t*", function(c) table.insert(fields, c) end) + line=f:read("*line") + email = fields[1] + if fields[2]=='yes' then + table.insert(patrons, email) + else + table.insert(emails, email) + end + if fields[3]=='German' then lang='de' else lang='en' end + race=string.gsub(fields[4], "/.*", ''):lower() + players[email] = { ['lang'] = lang, ['race'] = race } + nplayers = nplayers + 1 end - if fields[3]=='German' then lang='de' else lang='en' end - race=string.gsub(fields[4], "/.*", ''):lower() - players[email] = { ['lang'] = lang, ['race'] = race } - nplayers = nplayers + 1 + f:close() end - for k, r in ipairs(homes) do print(k, r) end diff --git a/scripts/tools/build.lua b/scripts/tools/build.lua index d873ab00b..b4ac57f8c 100644 --- a/scripts/tools/build.lua +++ b/scripts/tools/build.lua @@ -27,27 +27,29 @@ else end local f=assert(io.open("factions", "r")) -line=f:read("*line") -players = {} -emails = {} -patrons = {} -nplayers = 0 -while line~=nil do - fields = {} - line:gsub("([^\t]*)\t*", function(c) table.insert(fields, c) end) +if f then line=f:read("*line") - email = fields[1] - if fields[2]=='yes' then - table.insert(patrons, email) - else - table.insert(emails, email) + players = {} + emails = {} + patrons = {} + nplayers = 0 + while line~=nil do + fields = {} + line:gsub("([^\t]*)\t*", function(c) table.insert(fields, c) end) + line=f:read("*line") + email = fields[1] + if fields[2]=='yes' then + table.insert(patrons, email) + else + table.insert(emails, email) + end + if fields[3]=='German' then lang='de' else lang='en' end + race=string.gsub(fields[4], "/.*", ''):lower() + players[email] = { ['lang'] = lang, ['race'] = race } + nplayers = nplayers + 1 end - if fields[3]=='German' then lang='de' else lang='en' end - race=string.gsub(fields[4], "/.*", ''):lower() - players[email] = { ['lang'] = lang, ['race'] = race } - nplayers = nplayers + 1 + f:close() end - for k, r in ipairs(homes) do print(k, r) end diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fb03ebbe7..8a4445b55 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,11 +1,10 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8) project (server C) include_directories (${CMAKE_CURRENT_SOURCE_DIR}) include_directories (${CRITBIT_INCLUDE_DIR}) include_directories (${CJSON_INCLUDE_DIR}) include_directories (${STORAGE_INCLUDE_DIR}) -include_directories (${CRYPTO_INCLUDE_DIR}) include_directories (${QUICKLIST_INCLUDE_DIR}) include_directories (${CUTEST_INCLUDE_DIR}) include_directories (${LUA_INCLUDE_DIR}) @@ -13,11 +12,19 @@ include_directories (${TOLUA_INCLUDE_DIR}) include_directories (${BSON_INCLUDE_DIR}) include_directories (${INIPARSER_INCLUDE_DIR}) -IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion -Wno-sign-conversion") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wsign-compare -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long") +IF(DEFINED ERESSEA_VERSION) +set_source_files_properties(kernel/version.c PROPERTIES +COMPILE_DEFINITIONS ERESSEA_VERSION="${ERESSEA_VERSION}") +ENDIF() + +IF (CMAKE_COMPILER_IS_GNUCC) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unused-but-set-variable") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DHAVE__BOOL") +ENDIF() +IF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") +# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion -Wno-sign-conversion") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wsign-compare -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") + add_definitions(-DHAVE__BOOL) ELSEIF(MSVC) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /WX /MP") set(CMAKE_EXE_LINKER_FLAGS_DEBUG @@ -77,6 +84,7 @@ TOLUA_BINDING(settings.pkg kenel/config.h) ENDIF() set (ERESSEA_SRC + vortex.c calendar.c move.c piracy.c @@ -85,7 +93,6 @@ set (ERESSEA_SRC alchemy.c academy.c upkeep.c - vortex.c names.c lighthouse.c reports.c @@ -93,15 +100,13 @@ set (ERESSEA_SRC guard.c prefix.c donations.c - seen.c eressea.c - callback.c direction.c keyword.c skill.c json.c creport.c - jsreport.c + report.c economy.c give.c items.c @@ -111,8 +116,9 @@ set (ERESSEA_SRC morale.c monster.c randenc.c + renumber.c + volcano.c chaos.c - report.c spy.c study.c summary.c @@ -167,8 +173,10 @@ set (SERVER_SRC ${SERVER_SRC} ) endif(CURSES_FOUND) +add_library(version STATIC ${VERSION_SRC}) add_library(game ${ERESSEA_SRC}) add_executable(eressea ${SERVER_SRC}) +target_link_libraries(game version) target_link_libraries(eressea game ${TOLUA_LIBRARIES} @@ -176,37 +184,42 @@ target_link_libraries(eressea ${QUICKLIST_LIBRARIES} ${STORAGE_LIBRARIES} ${CRITBIT_LIBRARIES} - ${CRYPTO_LIBRARIES} ${CJSON_LIBRARIES} ${INIPARSER_LIBRARIES} ) set(TESTS_SRC monsters.test.c + names.test.c donations.test.c wormhole.test.c alchemy.test.c + guard.test.c test_eressea.c tests.c battle.test.c vortex.test.c tests.test.c + volcano.test.c reports.test.c - seen.test.c + creport.test.c + report.test.c + summary.test.c travelthru.test.c - callback.test.c direction.test.c economy.test.c json.test.c keyword.test.c give.test.c laws.test.c + lighthouse.test.c magic.test.c market.test.c monsters.test.c move.test.c piracy.test.c prefix.test.c + renumber.test.c skill.test.c spells.test.c spy.test.c @@ -229,7 +242,6 @@ target_link_libraries(test_eressea ${QUICKLIST_LIBRARIES} ${STORAGE_LIBRARIES} ${CRITBIT_LIBRARIES} - ${CRYPTO_LIBRARIES} ${CJSON_LIBRARIES} ${INIPARSER_LIBRARIES} ) @@ -246,18 +258,18 @@ install(TARGETS eressea DESTINATION "bin") if (SQLITE3_FOUND) target_link_libraries(eressea ${SQLITE3_LIBRARIES}) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_SQLITE") +add_definitions(-DUSE_SQLITE) endif(SQLITE3_FOUND) if (CURSES_FOUND) include_directories (${CURSES_INCLUDE_DIR}) target_link_libraries(eressea ${CURSES_LIBRARIES}) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_CURSES") +add_definitions(-DUSE_CURSES) endif(CURSES_FOUND) if (LIBXML2_FOUND) include_directories (${LIBXML2_INCLUDE_DIR}) target_link_libraries(eressea ${LIBXML2_LIBRARIES}) target_link_libraries(test_eressea ${LIBXML2_LIBRARIES}) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_LIBXML2") +add_definitions(-DUSE_LIBXML2) endif (LIBXML2_FOUND) diff --git a/src/alchemy.c b/src/alchemy.c index 5e369a3e1..9bc180700 100644 --- a/src/alchemy.c +++ b/src/alchemy.c @@ -19,7 +19,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include "alchemy.h" -#include "move.h" +#include "guard.h" #include "skill.h" #include "study.h" @@ -61,7 +61,7 @@ void herbsearch(unit * u, int max) return; } - if (is_guarded(r, u, GUARD_PRODUCE)) { + if (is_guarded(r, u)) { cmistake(u, u->thisorder, 70, MSG_EVENT); return; } @@ -123,9 +123,14 @@ static void end_potion(unit * u, const potion_type * ptype, int amount) } static int potion_water_of_life(unit * u, region *r, int amount) { + static int config; + static int tree_type, tree_count; int wood = 0; - int tree_type = config_get_int("rules.magic.wol_type", 1); - int tree_count = config_get_int("rules.magic.wol_effect", 10); + + if (config_changed(&config)) { + tree_type = config_get_int("rules.magic.wol_type", 1); + tree_count = config_get_int("rules.magic.wol_effect", 10); + } /* mallorn is required to make mallorn forests, wood for regular ones */ if (fval(r, RF_MALLORN)) { wood = use_pooled(u, rt_find("mallorn"), @@ -165,7 +170,8 @@ static int potion_luck(unit *u, region *r, attrib_type *atype, int amount) { } static int potion_truth(unit *u) { - fset(u, UFL_DISBELIEVES); + // TODO: this potion does nothing! + // fset(u, UFL_DISBELIEVES); return 1; } @@ -175,7 +181,7 @@ static int potion_power(unit *u, int amount) { if (u->number % 10 > 0) ++use; amount = use; } - /* Verfünffacht die HP von max. 10 Personen in der Einheit */ + /* Verf�nffacht die HP von max. 10 Personen in der Einheit */ u->hp += _min(u->number, 10 * amount) * unit_max_hp(u) * 4; return amount; } @@ -235,8 +241,7 @@ static void init_potiondelay(attrib * a) a->data.v = malloc(sizeof(potiondelay)); } -static void free_potiondelay(attrib * a) -{ +static void free_potiondelay(attrib * a) { free(a->data.v); } @@ -290,7 +295,7 @@ static void a_initeffect(attrib * a) a->data.v = calloc(sizeof(effect_data), 1); } -static void a_finalizeeffect(attrib * a) +static void a_finalizeeffect(attrib * a) //-V524 { free(a->data.v); } diff --git a/src/alchemy.test.c b/src/alchemy.test.c index 7e2e5b399..c281a1c98 100644 --- a/src/alchemy.test.c +++ b/src/alchemy.test.c @@ -25,12 +25,12 @@ static void test_herbsearch(CuTest * tc) region *r; const item_type *itype; - test_cleanup(); + test_setup(); r = test_create_region(0, 0, 0); rc = rc_get_or_create("dragon"); rc->flags |= RCF_UNARMEDGUARD; u2 = test_create_unit(test_create_faction(rc), r); - guard(u2, GUARD_PRODUCE); + setguard(u2, true); f = test_create_faction(0); u = test_create_unit(f, r); @@ -41,14 +41,14 @@ static void test_herbsearch(CuTest * tc) test_clear_messages(f); set_level(u, SK_HERBALISM, 1); - CuAssertPtrEquals(tc, u2, is_guarded(r, u, GUARD_PRODUCE)); + CuAssertPtrEquals(tc, u2, is_guarded(r, u)); herbsearch(u, INT_MAX); CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "error70")); CuAssertPtrEquals(tc, 0, test_find_messagetype(f->msgs, "error59")); test_clear_messages(f); - guard(u2, GUARD_NONE); - CuAssertPtrEquals(tc, 0, is_guarded(r, u, GUARD_PRODUCE)); + setguard(u2, false); + CuAssertPtrEquals(tc, 0, is_guarded(r, u)); CuAssertPtrEquals(tc, 0, (void *)rherbtype(r)); herbsearch(u, INT_MAX); CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "error108")); diff --git a/src/attributes/CMakeLists.txt b/src/attributes/CMakeLists.txt index 1419f9e9a..d0aa252ee 100644 --- a/src/attributes/CMakeLists.txt +++ b/src/attributes/CMakeLists.txt @@ -16,7 +16,6 @@ matmod.c moved.c movement.c dict.c -orcification.c otherfaction.c overrideroads.c racename.c diff --git a/src/attributes/attributes.c b/src/attributes/attributes.c index 770ba7524..8e9b22139 100644 --- a/src/attributes/attributes.c +++ b/src/attributes/attributes.c @@ -22,7 +22,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "laws.h" #include "move.h" -#include "guard.h" /* attributes includes */ #include "follow.h" @@ -34,7 +33,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "moved.h" #include "movement.h" #include "dict.h" -#include "orcification.h" #include "otherfaction.h" #include "overrideroads.h" #include "racename.h" @@ -50,7 +48,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include #include @@ -61,6 +58,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include +attrib_type at_scare = { // monster scares peasants + "scare", NULL, NULL, NULL, a_writeint, a_readint +}; + attrib_type at_unitdissolve = { "unitdissolve", NULL, NULL, NULL, a_writechars, a_readchars }; @@ -77,6 +78,7 @@ static int read_ext(attrib * a, void *owner, gamedata *data) void register_attributes(void) { /* Alle speicherbaren Attribute müssen hier registriert werden */ + at_register(&at_scare); at_register(&at_shiptrail); at_register(&at_familiar); at_register(&at_familiarmage); @@ -100,7 +102,6 @@ void register_attributes(void) at_register(&at_private); at_register(&at_icastle); - at_register(&at_guard); at_register(&at_group); at_register(&at_building_generic_type); @@ -117,8 +118,10 @@ void register_attributes(void) at_register(&at_germs); at_deprecate("xontormiaexpress", a_readint); /* required for old datafiles */ + at_deprecate("orcification", a_readint); /* required for old datafiles */ at_deprecate("lua", read_ext); /* required for old datafiles */ at_deprecate("gm", a_readint); + at_deprecate("guard", a_readint); /* used to contain guard-flags (v3.10.0-259-g8597e8b) */ at_register(&at_stealth); at_register(&at_dict); at_register(&at_unitdissolve); @@ -129,7 +132,6 @@ void register_attributes(void) at_register(&at_keys); at_register(&at_follow); at_register(&at_targetregion); - at_register(&at_orcification); at_register(&at_hate); at_register(&at_reduceproduction); at_register(&at_otherfaction); diff --git a/src/attributes/attributes.h b/src/attributes/attributes.h index b8974867e..91184ad98 100644 --- a/src/attributes/attributes.h +++ b/src/attributes/attributes.h @@ -22,6 +22,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. extern "C" { #endif + struct attrib_type; + extern struct attrib_type at_scare; extern void register_attributes(void); #ifdef __cplusplus diff --git a/src/attributes/dict.c b/src/attributes/dict.c index fa65d1f3d..2bba9ea7b 100644 --- a/src/attributes/dict.c +++ b/src/attributes/dict.c @@ -24,10 +24,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include #include -#include /* util includes */ #include diff --git a/src/attributes/fleechance.c b/src/attributes/fleechance.c index 232037972..afba2d301 100644 --- a/src/attributes/fleechance.c +++ b/src/attributes/fleechance.c @@ -21,6 +21,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include +#include + attrib_type at_fleechance = { "fleechance", NULL, diff --git a/src/attributes/hate.c b/src/attributes/hate.c index 3d9a2fb0a..98a36a029 100644 --- a/src/attributes/hate.c +++ b/src/attributes/hate.c @@ -21,7 +21,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "hate.h" #include -#include #include #include diff --git a/src/attributes/iceberg.c b/src/attributes/iceberg.c index 661a2ec80..e36e6303a 100644 --- a/src/attributes/iceberg.c +++ b/src/attributes/iceberg.c @@ -20,7 +20,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "iceberg.h" -#include #include attrib_type at_iceberg = { diff --git a/src/attributes/key.c b/src/attributes/key.c index 39c7dab66..0b252e0c0 100644 --- a/src/attributes/key.c +++ b/src/attributes/key.c @@ -20,7 +20,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "key.h" -#include #include #include #include diff --git a/src/attributes/key.test.c b/src/attributes/key.test.c index 46343d19f..2b7632917 100644 --- a/src/attributes/key.test.c +++ b/src/attributes/key.test.c @@ -3,6 +3,7 @@ #include #include +#include static void test_get_set_keys(CuTest *tc) { attrib *a = 0; diff --git a/src/attributes/matmod.c b/src/attributes/matmod.c index f885de99b..0cf1955d8 100644 --- a/src/attributes/matmod.c +++ b/src/attributes/matmod.c @@ -20,6 +20,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "matmod.h" #include +#include attrib_type at_matmod = { "matmod", diff --git a/src/attributes/movement.c b/src/attributes/movement.c index 0ad08030e..874da5eb3 100644 --- a/src/attributes/movement.c +++ b/src/attributes/movement.c @@ -20,7 +20,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "movement.h" -#include #include #include diff --git a/src/attributes/orcification.c b/src/attributes/orcification.c deleted file mode 100644 index dfb8f32f4..000000000 --- a/src/attributes/orcification.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright (c) 1998-2015, Enno Rehling -Katja Zedel - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -**/ - -#include -#include -#include "orcification.h" - -#include -#include - -/* - * simple attributes that do not yet have their own file - */ - -attrib_type at_orcification = { - "orcification", NULL, NULL, NULL, a_writeint, a_readint, NULL, ATF_UNIQUE -}; - -attrib *make_orcification(int orcification) -{ - attrib *a = a_new(&at_orcification); - a->data.i = orcification; - return a; -} diff --git a/src/attributes/orcification.h b/src/attributes/orcification.h deleted file mode 100644 index 3f1e2d418..000000000 --- a/src/attributes/orcification.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright (c) 1998-2015, Enno Rehling -Katja Zedel - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -**/ - -#ifdef __cplusplus -extern "C" { -#endif - extern struct attrib_type at_orcification; - - extern struct attrib *make_orcification(int orcification); - -#ifdef __cplusplus -} -#endif diff --git a/src/attributes/otherfaction.test.c b/src/attributes/otherfaction.test.c index 8e3d09b0a..a28d9f470 100644 --- a/src/attributes/otherfaction.test.c +++ b/src/attributes/otherfaction.test.c @@ -16,7 +16,7 @@ #include static void test_rules(CuTest *tc) { - test_cleanup(); + test_setup(); config_set("stealth.faction.other", NULL); CuAssertIntEquals(tc, true, rule_stealth_other()); config_set("stealth.faction.other", "0"); @@ -37,7 +37,7 @@ static void test_otherfaction(CuTest *tc) { unit *u; faction *f; - test_cleanup(); + test_setup(); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); f = test_create_faction(0); config_set("stealth.faction.other", "1"); diff --git a/src/attributes/overrideroads.c b/src/attributes/overrideroads.c index 72d2260bc..ef466de2d 100644 --- a/src/attributes/overrideroads.c +++ b/src/attributes/overrideroads.c @@ -20,9 +20,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "overrideroads.h" -#include #include attrib_type at_overrideroads = { - "roads_override", NULL, NULL, NULL, &a_writestring, &a_readstring + "roads_override", NULL, NULL, NULL, a_writestring, a_readstring }; diff --git a/src/attributes/racename.c b/src/attributes/racename.c index f60340b0c..b408cbf6a 100644 --- a/src/attributes/racename.c +++ b/src/attributes/racename.c @@ -20,7 +20,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "racename.h" -#include #include /* libc includes */ diff --git a/src/attributes/raceprefix.c b/src/attributes/raceprefix.c index 308c75292..15f0036c1 100644 --- a/src/attributes/raceprefix.c +++ b/src/attributes/raceprefix.c @@ -19,7 +19,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include "raceprefix.h" -#include #include diff --git a/src/attributes/reduceproduction.c b/src/attributes/reduceproduction.c index 3f31938d3..01041380a 100644 --- a/src/attributes/reduceproduction.c +++ b/src/attributes/reduceproduction.c @@ -19,7 +19,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include "reduceproduction.h" -#include #include #include #include diff --git a/src/attributes/stealth.c b/src/attributes/stealth.c index b7336efc7..db2ec5304 100644 --- a/src/attributes/stealth.c +++ b/src/attributes/stealth.c @@ -1,7 +1,6 @@ #include #include #include -#include #include #include diff --git a/src/attributes/targetregion.c b/src/attributes/targetregion.c index b293b458c..f61214dfc 100644 --- a/src/attributes/targetregion.c +++ b/src/attributes/targetregion.c @@ -21,8 +21,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#include -#include #include #include diff --git a/src/battle.c b/src/battle.c index 9d6448be4..7aa3e4cfa 100644 --- a/src/battle.c +++ b/src/battle.c @@ -21,11 +21,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "battle.h" #include "alchemy.h" #include "chaos.h" -#include "move.h" +#include "guard.h" #include "laws.h" -#include "seen.h" -#include "skill.h" #include "monster.h" +#include "move.h" +#include "skill.h" #include #include @@ -56,10 +56,12 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include /* util includes */ +#include #include #include #include #include +#include #include #include #include @@ -67,7 +69,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include /* libc includes */ -#include #include #include #include @@ -75,19 +76,16 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -static FILE *bdebug; - #define TACTICS_BONUS 1 /* when undefined, we have a tactics round. else this is the bonus tactics give */ #define TACTICS_MODIFIER 1 /* modifier for generals in the front/rear */ #define CATAPULT_INITIAL_RELOAD 4 /* erster schuss in runde 1 + rng_int() % INITIAL */ #define CATAPULT_STRUCTURAL_DAMAGE -#define BASE_CHANCE 70 /* 70% Basis-Überlebenschance */ -#define TDIFF_CHANGE 5 /* 5% höher pro Stufe */ +#define BASE_CHANCE 70 /* 70% Basis-�berlebenschance */ +#define TDIFF_CHANGE 5 /* 5% h�her pro Stufe */ #define DAMAGE_QUOTIENT 2 /* damage += skilldiff/DAMAGE_QUOTIENT */ -#undef DEBUG_FAST /* should be disabled when b->fast and b->rowcache works */ #define DEBUG_SELECT /* should be disabled if select_enemy works */ typedef enum combatmagic { @@ -96,7 +94,10 @@ typedef enum combatmagic { } combatmagic_t; /* globals */ +bool battledebug = false; + static int obs_count = 0; +static FILE *bdebug; #define MINSPELLRANGE 1 #define MAXSPELLRANGE 7 @@ -140,6 +141,7 @@ static int rule_goblin_bonus; static int rule_tactics_formula; static int rule_nat_armor; static int rule_cavalry_mode; +static int rule_vampire; static const curse_type *peace_ct, *slave_ct, *calm_ct; @@ -158,6 +160,7 @@ static void init_rules(void) rule_anon_battle = config_get_int("rules.stealth.anon_battle", 1) != 0; rule_cavalry_mode = config_get_int("rules.cavalry.mode", 1); rule_cavalry_skill = config_get_int("rules.cavalry.skill", 2); + rule_vampire = config_get_int("rules.combat.demon_vampire", 0); rule_loot = config_get_int("rules.combat.loot", LOOT_MONSTERS | LOOT_OTHERS | LOOT_KEEPLOOT); /* new formula to calculate to-hit-chance */ @@ -202,12 +205,7 @@ static const char *sideabkz(side * s, bool truename) const faction *f = (s->stealthfaction && !truename) ? s->stealthfaction : s->faction; -#undef SIDE_ABKZ -#ifdef SIDE_ABKZ - abkz(f->name, sideabkz_buf, sizeof(sideabkz_buf), 3); -#else strlcpy(sideabkz_buf, itoa36(f->no), sizeof(sideabkz_buf)); -#endif return sideabkz_buf; } @@ -218,6 +216,7 @@ static void message_faction(battle * b, faction * f, struct message *m) assert(f); if (f->battles == NULL || f->battles->r != r) { struct bmsg *bm = (struct bmsg *)calloc(1, sizeof(struct bmsg)); + assert_alloc(bm); bm->next = f->battles; f->battles = bm; bm->r = r; @@ -251,6 +250,7 @@ static void fbattlerecord(battle * b, faction * f, const char *s) static bool set_enemy(side * as, side * ds, bool attacking) { int i; + assert(as && ds); for (i = 0; i != MAXSIDES; ++i) { if (ds->enemies[i] == NULL) ds->enemies[i] = as; @@ -304,11 +304,11 @@ static int dead_fighters(const fighter * df) } fighter *select_corpse(battle * b, fighter * af) -/* Wählt eine Leiche aus, der af hilft. casualties ist die Anzahl der +/* W�hlt eine Leiche aus, der af hilft. casualties ist die Anzahl der * Toten auf allen Seiten (im Array). Wenn af == NULL, wird die - * Parteizugehörigkeit ignoriert, und irgendeine Leiche genommen. + * Parteizugeh�rigkeit ignoriert, und irgendeine Leiche genommen. * - * Untote werden nicht ausgewählt (casualties, not dead) */ + * Untote werden nicht ausgew�hlt (casualties, not dead) */ { int si, maxcasualties = 0; fighter *df; @@ -324,7 +324,7 @@ fighter *select_corpse(battle * b, fighter * af) side *s; for (s = b->sides; s != b->sides + b->nsides; ++s) { for (df = s->fighters; df; df = df->next) { - /* Geflohene haben auch 0 hp, dürfen hier aber nicht ausgewählt + /* Geflohene haben auch 0 hp, d�rfen hier aber nicht ausgew�hlt * werden! */ int dead = dead_fighters(df); if (!playerrace(u_race(df->unit))) @@ -466,13 +466,7 @@ static int get_unitrow(const fighter * af, const side * vs) b->rowcache.result = get_row(af->side, row, vs); return b->rowcache.result; } -#ifdef DEBUG_FAST /* validation code */ - { - int i = get_row(af->side, row, vs); - assert(i == b->rowcache.result); - } -#endif - return b->rowcache.result; + return b->rowcache.result; } } @@ -624,7 +618,7 @@ weapon_skill(const weapon_type * wtype, const unit * u, bool attacking) } } else { - /* der rassen-defaultwert kann höher sein als der Talentwert von + /* der rassen-defaultwert kann h�her sein als der Talentwert von * waffenloser kampf */ if (attacking) { if (skill < u_race(u)->at_default) @@ -712,7 +706,7 @@ static int CavalryBonus(const unit * u, troop enemy, int type) static int weapon_effskill(troop t, troop enemy, const weapon * w, bool attacking, bool missile) -/* effektiver Waffenskill während des Kampfes */ +/* effektiver Waffenskill w�hrend des Kampfes */ { /* In dieser Runde alle die Modifier berechnen, die fig durch die * Waffen bekommt. */ @@ -771,22 +765,22 @@ bool missile) skill += CavalryBonus(tu, enemy, BONUS_SKILL); if (wtype) skill = - skillmod(urace(tu)->attribs, tu, tu->region, wtype->skill, skill, + skillmod(u_race(tu)->attribs, tu, tu->region, wtype->skill, skill, SMF_RIDING); } if (t.index < tf->elvenhorses) { /* Elfenpferde: Helfen dem Reiter, egal ob und welche Waffe. Das ist - * eleganter, und vor allem einfacher, sonst muß man noch ein + * eleganter, und vor allem einfacher, sonst mu� man noch ein * WMF_ELVENHORSE einbauen. */ skill += 2; } if (skill > 0 && !attacking && missile) { /* - * Wenn ich verteidige, und nicht direkt meinem Feind gegenüberstehe, - * halbiert sich mein Skill: (z.B. gegen Fernkämpfer. Nahkämpfer - * können mich eh nicht treffen) + * Wenn ich verteidige, und nicht direkt meinem Feind gegen�berstehe, + * halbiert sich mein Skill: (z.B. gegen Fernk�mpfer. Nahk�mpfer + * k�nnen mich eh nicht treffen) */ skill /= 2; } @@ -822,9 +816,9 @@ static const armor_type *select_armor(troop t, bool shield) } /* Hier ist zu beachten, ob und wie sich Zauber und Artefakte, die - * Rüstungschutz geben, addieren. - * - Artefakt "trollbelt" gibt Rüstung +1 - * - Zauber Rindenhaut gibt Rüstung +3 + * R�stungschutz geben, addieren. + * - Artefakt "trollbelt" gibt R�stung +1 + * - Zauber Rindenhaut gibt R�stung +3 */ static int trollbelts(const unit *u) { const struct resource_type *belt = rt_find("trollbelt"); @@ -842,7 +836,7 @@ int select_magicarmor(troop t) return ma; } -/* Sind side ds und Magier des meffect verbündet, dann return 1*/ +/* Sind side ds und Magier des meffect verb�ndet, dann return 1*/ bool meffect_protection(battle * b, meffect * s, side * ds) { if (!s->magician->alive) @@ -878,7 +872,7 @@ void rmfighter(fighter * df, int i) assert(df->alive >= i); assert(df->alive <= df->unit->number); - /* erst ziehen wir die Anzahl der Personen von den Kämpfern in der + /* erst ziehen wir die Anzahl der Personen von den K�mpfern in der * Schlacht, dann von denen auf dieser Seite ab*/ df->side->alive -= i; df->side->battle->alive -= i; @@ -1006,11 +1000,10 @@ const char *rel_dam(int dam, int hp) static void vampirism(troop at, int damage) { - int vampire = config_get_int("rules.combat.demon_vampire", 0); - if (vampire > 0) { - int gain = damage / vampire; - int chance = damage - vampire * gain; - if (chance > 0 && (rng_int() % vampire < chance)) + if (rule_vampire > 0) { + int gain = damage / rule_vampire; + int chance = damage - rule_vampire * gain; + if (chance > 0 && (rng_int() % rule_vampire < chance)) ++gain; if (gain > 0) { int maxhp = unit_max_hp(at.fighter->unit); @@ -1029,47 +1022,48 @@ static int armor_bonus(const race *rc) { int natural_armor(unit * du) { const race *rc = u_race(du); - int bonus, an = rc->armor; + int an; assert(rc); - bonus = armor_bonus(rc); - if (bonus > 0) { + an = armor_bonus(rc); + if (an > 0) { int sk = effskill(du, SK_STAMINA, 0); - sk /= bonus; - an += sk; + return rc->armor + sk / an; } - return an; + return rc->armor; } static int rc_specialdamage(const unit *au, const unit *du, const struct weapon_type *wtype) { const race *ar = u_race(au); int m, modifier = 0; - - switch (old_race(ar)) { - case RC_HALFLING: - if (wtype != NULL && dragonrace(u_race(du))) { - modifier += 5; + if (wtype != NULL) { + if (fval(u_race(du), RCF_DRAGON)) { + static int cache; + static const race *rc_halfling; + if (rc_changed(&cache)) { + rc_halfling = get_race(RC_HALFLING); + } + if (ar == rc_halfling) { + modifier += 5; + } } - break; - default: - break; - } - if (wtype != NULL && wtype->modifiers != NULL) { - for (m = 0; wtype->modifiers[m].value; ++m) { - /* weapon damage for this weapon, possibly by race */ - if (wtype->modifiers[m].flags & WMF_DAMAGE) { - race_list *rlist = wtype->modifiers[m].races; - if (rlist != NULL) { - while (rlist) { - if (rlist->data == ar) - break; - rlist = rlist->next; + if (wtype->modifiers != NULL) { + for (m = 0; wtype->modifiers[m].value; ++m) { + /* weapon damage for this weapon, possibly by race */ + if (wtype->modifiers[m].flags & WMF_DAMAGE) { + race_list *rlist = wtype->modifiers[m].races; + if (rlist != NULL) { + while (rlist) { + if (rlist->data == ar) + break; + rlist = rlist->next; + } + if (rlist == NULL) + continue; } - if (rlist == NULL) - continue; + modifier += wtype->modifiers[m].value; } - modifier += wtype->modifiers[m].value; } } } @@ -1097,15 +1091,15 @@ int calculate_armor(troop dt, const weapon_type *dwtype, const weapon_type *awty } } - /* natürliche Rüstung */ + /* nat�rliche R�stung */ an = natural_armor(du); - /* magische Rüstung durch Artefakte oder Sprüche */ - /* Momentan nur Trollgürtel und Werwolf-Eigenschaft */ + /* magische R�stung durch Artefakte oder Spr�che */ + /* Momentan nur Trollg�rtel und Werwolf-Eigenschaft */ am = select_magicarmor(dt); if (rule_nat_armor == 0) { - /* natürliche Rüstung ist halbkumulativ */ + /* nat�rliche R�stung ist halbkumulativ */ if (ar > 0) { ar += an / 2; } @@ -1139,7 +1133,7 @@ int calculate_armor(troop dt, const weapon_type *dwtype, const weapon_type *awty res *= (1 - dwtype->magres); } - /* gegen Magie wirkt nur natürliche und magische Rüstung */ + /* gegen Magie wirkt nur nat�rliche und magische R�stung */ ar = an + am; *magres = res > 0 ? res : 0; } @@ -1221,7 +1215,7 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile) while (chance(kritchance)) { if (bdebug) { - fprintf(bdebug, "%s/%d lands a critical hit\n", unitid(au), at.index); + fprintf(bdebug, "%s/%d lands a critical hit\n", itoa36(au->no), at.index); } da += dice_rand(damage); } @@ -1279,7 +1273,7 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile) rda -= hp; me->duration -= hp; } - /* gibt Rüstung +effect für duration Treffer */ + /* gibt R�stung +effect f�r duration Treffer */ if (me->typ == SHIELD_ARMOR) { rda = _max(rda - me->effect, 0); me->duration--; @@ -1302,7 +1296,7 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile) } } - if (df->person[dt.index].hp > 0) { /* Hat überlebt */ + if (df->person[dt.index].hp > 0) { /* Hat �berlebt */ if (bdebug) { fprintf(bdebug, "Damage %d, armor %d: %d -> %d HP\n", da, ar, df->person[dt.index].hp + rda, df->person[dt.index].hp); @@ -1441,18 +1435,10 @@ int select) if (b->alive == b->fast.alive && as == b->fast.side && sr == b->fast.status && minrow == b->fast.minrow && maxrow == b->fast.maxrow) { if (b->fast.enemies[select] >= 0) { -#ifdef DEBUG_FAST - int i = count_enemies_i(b, af, minrow, maxrow, select); - assert(i == b->fast.enemies[select]); -#endif return b->fast.enemies[select]; } else if (select & SELECT_FIND) { if (b->fast.enemies[select - SELECT_FIND] >= 0) { -#ifdef DEBUG_FAST - int i = count_enemies_i(b, af, minrow, maxrow, select); - assert((i > 0) == (b->fast.enemies[select - SELECT_FIND] > 0)); -#endif return b->fast.enemies[select - SELECT_FIND]; } } @@ -1716,7 +1702,7 @@ void do_combatmagic(battle * b, combatmagic_t was) unit *mage = fig->unit; if (fig->alive <= 0) - continue; /* fighter kann im Kampf getötet worden sein */ + continue; /* fighter kann im Kampf get�tet worden sein */ level = effskill(mage, SK_MAGIC, r); if (level > 0) { @@ -1825,12 +1811,12 @@ static void do_combatspell(troop at) sp = get_combatspell(caster, 1); if (sp == NULL) { - fi->magic = 0; /* Hat keinen Kampfzauber, kämpft nichtmagisch weiter */ + fi->magic = 0; /* Hat keinen Kampfzauber, k�mpft nichtmagisch weiter */ return; } ord = create_order(K_CAST, lang, "'%s'", spell_name(sp, lang)); if (!cancast(caster, sp, 1, 1, ord)) { - fi->magic = 0; /* Kann nicht mehr Zaubern, kämpft nichtmagisch weiter */ + fi->magic = 0; /* Kann nicht mehr Zaubern, k�mpft nichtmagisch weiter */ return; } @@ -1854,7 +1840,7 @@ static void do_combatspell(troop at) } } - /* Antimagie die Fehlschlag erhöht */ + /* Antimagie die Fehlschlag erh�ht */ if (rng_int() % 100 < fumblechance) { report_failed_spell(b, caster, sp); pay_spell(caster, sp, level, 1); @@ -1878,7 +1864,7 @@ static void do_combatspell(troop at) } /* Sonderattacken: Monster patzern nicht und zahlen auch keine - * Spruchkosten. Da die Spruchstärke direkt durch den Level bestimmt + * Spruchkosten. Da die Spruchst�rke direkt durch den Level bestimmt * wird, wirkt auch keine Antimagie (wird sonst in spellpower * gemacht) */ @@ -1901,7 +1887,13 @@ int skilldiff(troop at, troop dt, int dist) unit *au = af->unit, *du = df->unit; int is_protected = 0, skdiff = 0; weapon *awp = select_weapon(at, true, dist > 1); + static int rc_cache; + static const race *rc_halfling, *rc_goblin; + if (rc_changed(&rc_cache)) { + rc_halfling = get_race(RC_HALFLING); + rc_goblin = get_race(RC_GOBLIN); + } skdiff += af->person[at.index].attack; skdiff -= df->person[dt.index].defence; @@ -1909,49 +1901,43 @@ int skilldiff(troop at, troop dt, int dist) skdiff += 2; /* Effekte durch Rassen */ - if (awp != NULL && u_race(au) == get_race(RC_HALFLING) && dragonrace(u_race(du))) { + if (awp != NULL && u_race(au) == rc_halfling && dragonrace(u_race(du))) { skdiff += 5; } - - if (u_race(au) == get_race(RC_GOBLIN)) { + else if (u_race(au) == rc_goblin) { if (af->side->size[SUM_ROW] >= df->side->size[SUM_ROW] * rule_goblin_bonus) { skdiff += 1; } } if (df->building) { - bool init = false; - static const curse_type *strongwall_ct, *magicwalls_ct; - if (!init) { - strongwall_ct = ct_find("strongwall"); - magicwalls_ct = ct_find("magicwalls"); - init = true; + if (df->building->attribs) { + const curse_type *strongwall_ct = ct_find("strongwall"); + if (strongwall_ct) { + curse *c = get_curse(df->building->attribs, strongwall_ct); + if (curse_active(c)) { + /* wirkt auf alle Geb�ude */ + skdiff -= curse_geteffect_int(c); + is_protected = 2; + } + } } if (df->building->type->protection) { int beff = df->building->type->protection(df->building, du, DEFENSE_BONUS); if (beff) { skdiff -= beff; is_protected = 2; + if (df->building->attribs) { + const curse_type *magicwalls_ct = ct_find("magicwalls"); + if (magicwalls_ct + && curse_active(get_curse(df->building->attribs, magicwalls_ct))) { + /* Verdoppelt Burgenbonus */ + skdiff -= beff; + } + } } } - if (strongwall_ct) { - curse *c = get_curse(df->building->attribs, strongwall_ct); - if (curse_active(c)) { - /* wirkt auf alle Gebäude */ - skdiff -= curse_geteffect_int(c); - is_protected = 2; - } - } - if (magicwalls_ct - && curse_active(get_curse(df->building->attribs, magicwalls_ct))) { - /* Verdoppelt Burgenbonus */ - skdiff -= df->building->type->protection(df->building, du, DEFENSE_BONUS); - } } - /* Goblin-Verteidigung - * ist direkt in der Rassentabelle als df_default - */ - /* Effekte der Waffen */ skdiff += weapon_effskill(at, dt, awp, true, dist > 1); if (awp && fval(awp->type, WTF_MISSILE)) { @@ -1993,10 +1979,10 @@ debug_hit(troop at, const weapon * awp, troop dt, const weapon * dwp, int skdiff, int dist, bool success) { fprintf(bdebug, "%.4s/%d [%6s/%d] %s %.4s/%d [%6s/%d] with %d, distance %d\n", - unitid(at.fighter->unit), at.index, + itoa36(at.fighter->unit->no), at.index, LOC(default_locale, awp ? resourcename(awp->type->itype->rtype, 0) : "unarmed"), weapon_effskill(at, dt, awp, true, dist > 1), - success ? "hits" : "misses", unitid(dt.fighter->unit), dt.index, + success ? "hits" : "misses", itoa36(dt.fighter->unit->no), dt.index, LOC(default_locale, dwp ? resourcename(dwp->type->itype->rtype, 0) : "unarmed"), weapon_effskill(dt, at, dwp, false, dist > 1), skdiff, dist); @@ -2035,7 +2021,7 @@ int hits(troop at, troop dt, weapon * awp) } skdiff = skilldiff(at, dt, dist); - /* Verteidiger bekommt eine Rüstung */ + /* Verteidiger bekommt eine R�stung */ armor = select_armor(dt, true); if (dwp == NULL || (dwp->type->flags & WTF_USESHIELD)) { shield = select_armor(dt, false); @@ -2055,19 +2041,12 @@ int hits(troop at, troop dt, weapon * awp) void dazzle(battle * b, troop * td) { /* Nicht kumulativ ! */ - if (td->fighter->person[td->index].flags & FL_DAZZLED) - return; - #ifdef TODO_RUNESWORD if (td->fighter->weapon[WP_RUNESWORD].count > td->index) { return; } #endif - if (td->fighter->person[td->index].flags & FL_COURAGE) { - return; - } - - if (td->fighter->person[td->index].flags & FL_DAZZLED) { + if (td->fighter->person[td->index].flags & (FL_COURAGE|FL_DAZZLED)) { return; } @@ -2079,7 +2058,7 @@ void damage_building(battle * b, building * bldg, int damage_abs) { bldg->size = _max(1, bldg->size - damage_abs); - /* Wenn Burg, dann gucken, ob die Leute alle noch in das Gebäude passen. */ + /* Wenn Burg, dann gucken, ob die Leute alle noch in das Geb�ude passen. */ if (bldg->type->protection) { side *s; @@ -2137,7 +2116,7 @@ static void attack(battle * b, troop ta, const att * a, int numattack) switch (a->type) { case AT_COMBATSPELL: /* Magier versuchen immer erstmal zu zaubern, erst wenn das - * fehlschlägt, wird af->magic == 0 und der Magier kämpft + * fehlschl�gt, wird af->magic == 0 und der Magier k�mpft * konventionell weiter */ if (numattack == 0 && af->magic > 0) { /* wenn der magier in die potenzielle Reichweite von Attacken des @@ -2149,7 +2128,7 @@ static void attack(battle * b, troop ta, const att * a, int numattack) } } break; - case AT_STANDARD: /* Waffen, mag. Gegenstände, Kampfzauber */ + case AT_STANDARD: /* Waffen, mag. Gegenst�nde, Kampfzauber */ if (numattack > 0 || af->magic <= 0) { weapon *wp = ta.fighter->person[ta.index].missile; int melee = @@ -2166,7 +2145,7 @@ static void attack(battle * b, troop ta, const att * a, int numattack) bool standard_attack = true; bool reload = false; /* spezialattacken der waffe nur, wenn erste attacke in der runde. - * sonst helden mit feuerschwertern zu mächtig */ + * sonst helden mit feuerschwertern zu m�chtig */ if (numattack == 0 && wp && wp->type->attack) { int dead = 0; standard_attack = wp->type->attack(&ta, wp->type, &dead); @@ -2207,14 +2186,14 @@ static void attack(battle * b, troop ta, const att * a, int numattack) if (reload && wp && wp->type->reload && !getreload(ta)) { int i = setreload(ta); if (bdebug) { - fprintf(bdebug, "%s/%d reloading %d turns\n", unitid(au), + fprintf(bdebug, "%s/%d reloading %d turns\n", itoa36(au->no), ta.index, i); } } } } break; - case AT_SPELL: /* Extra-Sprüche. Kampfzauber in AT_COMBATSPELL! */ + case AT_SPELL: /* Extra-Spr�che. Kampfzauber in AT_COMBATSPELL! */ do_extra_spell(ta, a); break; case AT_NATURAL: @@ -2299,14 +2278,14 @@ void do_attack(fighter * af) assert(au && au->number); /* Da das Zuschlagen auf Einheiten und nicht auf den einzelnen - * Kämpfern beruht, darf die Reihenfolge und Größe der Einheit keine + * K�mpfern beruht, darf die Reihenfolge und Gr��e der Einheit keine * Rolle spielen, Das tut sie nur dann, wenn jeder, der am Anfang der - * Runde lebte, auch zuschlagen darf. Ansonsten ist der, der zufällig - * mit einer großen Einheit zuerst drankommt, extrem bevorteilt. */ + * Runde lebte, auch zuschlagen darf. Ansonsten ist der, der zuf�llig + * mit einer gro�en Einheit zuerst drankommt, extrem bevorteilt. */ ta.index = af->fighting; while (ta.index--) { - /* Wir suchen eine beliebige Feind-Einheit aus. An der können + /* Wir suchen eine beliebige Feind-Einheit aus. An der k�nnen * wir feststellen, ob noch jemand da ist. */ int apr, attacks = attacks_per_round(ta); if (!count_enemies(b, af, FIGHT_ROW, LAST_ROW, SELECT_FIND)) @@ -2331,7 +2310,7 @@ void do_attack(fighter * af) } } } - /* Der letzte Katapultschütze setzt die + /* Der letzte Katapultsch�tze setzt die * Ladezeit neu und generiert die Meldung. */ if (af->catmsg >= 0) { struct message *m = @@ -2405,7 +2384,7 @@ double fleechance(unit * u) { double c = 0.20; /* Fluchtwahrscheinlichkeit in % */ attrib *a = a_find(u->attribs, &at_fleechance); - /* Einheit u versucht, dem Getümmel zu entkommen */ + /* Einheit u versucht, dem Get�mmel zu entkommen */ c += (effskill(u, SK_STEALTH, 0) * 0.05); c += horse_fleeing_bonus(u); @@ -2440,7 +2419,7 @@ side *make_side(battle * b, const faction * f, const group * g, else { unit *u; for (u = b->region->units; u; u = u->next) { - if (is_guard(u, HELP_ALL)) { + if (is_guard(u)) { if (alliedunit(u, f, HELP_GUARD)) { flags |= SIDE_HASGUARDS; break; @@ -2510,7 +2489,7 @@ static int loot_quota(const unit * src, const unit * dst, { if (dst && src && src->faction != dst->faction) { double divisor = config_get_flt("rules.items.loot_divisor", 1); - assert(divisor == 0 || divisor >= 1); + assert(divisor <= 0 || divisor >= 1); if (divisor >= 1) { double r = n / divisor; int x = (int)r; @@ -2693,7 +2672,7 @@ static void aftermath(battle * b) for (s = b->sides; s != b->sides + b->nsides; ++s) { int snumber = 0; fighter *df; - bool relevant = false; /* Kampf relevant für diese Partei? */ + bool relevant = false; /* Kampf relevant f�r diese Partei? */ if (!fval(s, SIDE_HASGUARDS)) { relevant = true; } @@ -2733,7 +2712,7 @@ static void aftermath(battle * b) /* Report the casualties */ reportcasualties(b, df, dead); - /* Zuerst dürfen die Feinde plündern, die mitgenommenen Items + /* Zuerst d�rfen die Feinde pl�ndern, die mitgenommenen Items * stehen in fig->run.items. Dann werden die Fliehenden auf * die leere (tote) alte Einheit gemapt */ if (!fval(df, FIG_NOLOOT)) { @@ -2741,7 +2720,7 @@ static void aftermath(battle * b) } scale_number(du, df->run.number); du->hp = df->run.hp; - setguard(du, GUARD_NONE); + setguard(du, false); /* must leave ships or buildings, or a stealthy hobbit * can hold castles indefinitely */ if (!fval(r->terrain, SEA_REGION)) { @@ -2768,7 +2747,7 @@ static void aftermath(battle * b) } else { if (df->alive == 0) { - /* alle sind tot, niemand geflohen. Einheit auflösen */ + /* alle sind tot, niemand geflohen. Einheit aufl�sen */ df->run.number = 0; df->run.hp = 0; @@ -2778,7 +2757,7 @@ static void aftermath(battle * b) /* Distribute Loot */ loot_items(df); - setguard(du, GUARD_NONE); + setguard(du, false); scale_number(du, 0); } else { @@ -2830,7 +2809,7 @@ static void aftermath(battle * b) /* Wir benutzen drifted, um uns zu merken, ob ein Schiff * schonmal Schaden genommen hat. (moved und drifted - * sollten in flags überführt werden */ + * sollten in flags �berf�hrt werden */ for (s = b->sides; s != b->sides + b->nsides; ++s) { fighter *df; @@ -2851,7 +2830,7 @@ static void aftermath(battle * b) } /* Wenn sich die Einheit auf einem Schiff befindet, wird - * dieses Schiff beschädigt. Andernfalls ein Schiff, welches + * dieses Schiff besch�digt. Andernfalls ein Schiff, welches * evt. zuvor verlassen wurde. */ if (ships_damaged) { if (du->ship) @@ -2905,7 +2884,7 @@ static void battle_punit(unit * u, battle * b) faction *f = bf->faction; strlist *S = 0, *x; - spunit(&S, f, u, 4, see_battle); + spunit(&S, f, u, 4, seen_battle); for (x = S; x; x = x->next) { fbattlerecord(b, f, x->s); if (bdebug && u->faction == f) { @@ -3143,7 +3122,7 @@ static void print_stats(battle * b) static int weapon_weight(const weapon * w, bool missile) { - if (missile == i2b(fval(w->type, WTF_MISSILE))) { + if (missile == !!(fval(w->type, WTF_MISSILE))) { return w->attackskill + w->defenseskill; } return 0; @@ -3224,8 +3203,8 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack) else if (!stealthfaction) { s1->stealthfaction = NULL; } - /* Zu diesem Zeitpunkt ist attacked noch 0, da die Einheit für noch - * keinen Kampf ausgewählt wurde (sonst würde ein fighter existieren) */ + /* Zu diesem Zeitpunkt ist attacked noch 0, da die Einheit f�r noch + * keinen Kampf ausgew�hlt wurde (sonst w�rde ein fighter existieren) */ } fig = (struct fighter*)calloc(1, sizeof(struct fighter)); @@ -3233,8 +3212,8 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack) s1->fighters = fig; fig->unit = u; - /* In einer Burg muß man a) nicht Angreifer sein, und b) drin sein, und - * c) noch Platz finden. d) menschanähnlich sein */ + /* In einer Burg mu� man a) nicht Angreifer sein, und b) drin sein, und + * c) noch Platz finden. d) menschan�hnlich sein */ if (attack) { set_attacker(fig); } @@ -3260,10 +3239,10 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack) assert(h); rest = u->hp % u->number; - /* Effekte von Sprüchen */ + /* Effekte von Spr�chen */ - { - static const curse_type *speed_ct; + if (u->attribs) { + const curse_type *speed_ct; speed_ct = ct_find("speed"); if (speed_ct) { curse *c = get_curse(u->attribs, speed_ct); @@ -3281,7 +3260,7 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack) /* Effekte von Artefakten */ strongmen = _min(fig->unit->number, trollbelts(u)); - /* Hitpoints, Attack- und Defence-Boni für alle Personen */ + /* Hitpoints, Attack- und Defence-Boni f�r alle Personen */ for (i = 0; i < fig->alive; i++) { assert(i < fig->unit->number); fig->person[i].hp = h; @@ -3302,8 +3281,8 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack) } } - /* Für alle Waffengattungen wird bestimmt, wie viele der Personen mit - * ihr kämpfen könnten, und was ihr Wert darin ist. */ + /* F�r alle Waffengattungen wird bestimmt, wie viele der Personen mit + * ihr k�mpfen k�nnten, und was ihr Wert darin ist. */ if (u_race(u)->battle_flags & BF_EQUIPMENT) { int oi = 0, di = 0, w = 0; for (itm = u->items; itm && w != WMAX; itm = itm->next) { @@ -3421,12 +3400,12 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack) } } - /* Jetzt muß noch geschaut werden, wo die Einheit die jeweils besten - * Werte hat, das kommt aber erst irgendwo später. Ich entscheide - * wärend des Kampfes, welche ich nehme, je nach Gegner. Deswegen auch + /* Jetzt mu� noch geschaut werden, wo die Einheit die jeweils besten + * Werte hat, das kommt aber erst irgendwo sp�ter. Ich entscheide + * w�rend des Kampfes, welche ich nehme, je nach Gegner. Deswegen auch * keine addierten boni. */ - /* Zuerst mal die Spezialbehandlung gewisser Sonderfälle. */ + /* Zuerst mal die Spezialbehandlung gewisser Sonderf�lle. */ fig->magic = effskill(u, SK_MAGIC, 0); if (fig->horses) { @@ -3591,7 +3570,7 @@ battle *make_battle(region * r) b->region = r; b->plane = getplane(r); - /* Finde alle Parteien, die den Kampf beobachten können: */ + /* Finde alle Parteien, die den Kampf beobachten k�nnen: */ for (u = r->units; u; u = u->next) { if (u->number > 0) { if (!fval(u->faction, FFL_MARK)) { @@ -3780,18 +3759,18 @@ static void join_allies(battle * b) for (s = b->sides; s != s_end; ++s) { side *se; - /* Wenn alle attackierten noch FFL_NOAID haben, dann kämpfe nicht mit. */ + /* Wenn alle attackierten noch FFL_NOAID haben, dann k�mpfe nicht mit. */ if (fval(s->faction, FFL_NOAID)) continue; if (s->faction != f) { /* Wenn wir attackiert haben, kommt niemand mehr hinzu: */ if (s->bf->attacker) continue; - /* alliiert müssen wir schon sein, sonst ist's eh egal : */ + /* alliiert m�ssen wir schon sein, sonst ist's eh egal : */ if (!alliedunit(u, s->faction, HELP_FIGHT)) continue; /* wenn die partei verborgen ist, oder gar eine andere - * vorgespiegelt wird, und er sich uns gegenüber nicht zu + * vorgespiegelt wird, und er sich uns gegen�ber nicht zu * erkennen gibt, helfen wir ihm nicht */ if (s->stealthfaction) { if (!allysfm(s, u->faction, HELP_FSTEALTH)) { @@ -3799,7 +3778,7 @@ static void join_allies(battle * b) } } } - /* einen alliierten angreifen dürfen sie nicht, es sei denn, der + /* einen alliierten angreifen d�rfen sie nicht, es sei denn, der * ist mit einem alliierten verfeindet, der nicht attackiert * hat: */ for (se = b->sides; se != s_end; ++se) { @@ -3813,7 +3792,7 @@ static void join_allies(battle * b) } if (se == s_end) continue; - /* Wenn die Einheit belagert ist, muß auch einer der Alliierten belagert sein: */ + /* Wenn die Einheit belagert ist, mu� auch einer der Alliierten belagert sein: */ if (besieged(u)) { fighter *ally; for (ally = s->fighters; ally; ally = ally->next) { @@ -3824,7 +3803,7 @@ static void join_allies(battle * b) if (ally == NULL) continue; } - /* keine Einwände, also soll er mitmachen: */ + /* keine Einw�nde, also soll er mitmachen: */ if (c == NULL) { if (join_battle(b, u, false, &c)) { if (battledebug) { @@ -3893,7 +3872,7 @@ static void flee(const troop dt) fig->run.hp += fig->person[dt.index].hp; ++fig->run.number; - setguard(u, GUARD_NONE); + setguard(u, false); kill_troop(dt); } @@ -3940,7 +3919,7 @@ static bool start_battle(region * r, battle ** bp) continue; } - /* ist ein Flüchtling aus einem andern Kampf */ + /* ist ein Fl�chtling aus einem andern Kampf */ if (fval(u, UFL_LONGACTION)) continue; @@ -3956,12 +3935,12 @@ static bool start_battle(region * r, battle ** bp) if ((u->ship != NULL && !fval(r->terrain, SEA_REGION)) || (lsh = leftship(u)) != NULL) { - if (is_guarded(r, u, GUARD_TRAVELTHRU)) { + if (is_guarded(r, u)) { if (lsh) { cmistake(u, ord, 234, MSG_BATTLE); } else { - /* Fehler: "Das Schiff muß erst verlassen werden" */ + /* Fehler: "Das Schiff mu� erst verlassen werden" */ cmistake(u, ord, 19, MSG_BATTLE); } continue; @@ -4005,7 +3984,7 @@ static bool start_battle(region * r, battle ** bp) while (a && a->type == &at_curse) { curse *c = (curse *)a->data.v; if (c->type == calm_ct - && curse_geteffect(c) == u2->faction->subscription) { + && curse_geteffect_int(c) == u2->faction->subscription) { if (curse_active(c)) { calm = true; break; @@ -4046,8 +4025,8 @@ static bool start_battle(region * r, battle ** bp) freset(u2->faction, FFL_NOAID); if (c1 != NULL && c2 != NULL) { - /* Merken, wer Angreifer ist, für die Rückzahlung der - * Präcombataura bei kurzem Kampf. */ + /* Merken, wer Angreifer ist, f�r die R�ckzahlung der + * Pr�combataura bei kurzem Kampf. */ c1->side->bf->attacker = true; if (set_enemy(c1->side, c2->side, true) && battledebug) { @@ -4080,7 +4059,7 @@ static void battle_attacks(battle * b) && get_tactics(s, NULL) == b->max_tactics)) { for (fig = s->fighters; fig; fig = fig->next) { - /* ist in dieser Einheit noch jemand handlungsfähig? */ + /* ist in dieser Einheit noch jemand handlungsf�hig? */ if (fig->fighting <= 0) continue; @@ -4124,7 +4103,7 @@ static void battle_flee(battle * b) unit *u = fig->unit; troop dt; int runners = 0; - /* Flucht nicht bei mehr als 600 HP. Damit Wyrme tötbar bleiben. */ + /* Flucht nicht bei mehr als 600 HP. Damit Wyrme t�tbar bleiben. */ int runhp = _min(600, (int)(0.9 + unit_max_hp(u) * hpflee(u->status))); if (u->ship && fval(u->region->terrain, SEA_REGION)) { @@ -4244,7 +4223,7 @@ void do_battle(region * r) return; /* Bevor wir die alliierten hineinziehen, sollten wir schauen, * - * Ob jemand fliehen kann. Dann erübrigt sich das ganze ja + * Ob jemand fliehen kann. Dann er�brigt sich das ganze ja * vielleicht schon. */ print_header(b); if (!fighting) { @@ -4293,12 +4272,10 @@ void do_battle(region * r) if (rule_force_leave(FORCE_LEAVE_POSTCOMBAT)) { force_leave(b->region, b); } - /* Hier ist das Gefecht beendet, und wir können die - * Hilfsstrukturen * wieder löschen: */ + /* Hier ist das Gefecht beendet, und wir k�nnen die + * Hilfsstrukturen * wieder l�schen: */ - if (b) { - free_battle(b); - } + free_battle(b); } void do_battles(void) { diff --git a/src/battle.h b/src/battle.h index 3e156070d..007bda008 100644 --- a/src/battle.h +++ b/src/battle.h @@ -30,7 +30,7 @@ extern "C" { #define FS_HELP 2 /***** Verteidigungslinien. - * Eressea hat 4 Verteidigungslinien. 1 ist vorn, 5. enthält Summen + * Eressea hat 4 Verteidigungslinien. 1 ist vorn, 5. enthaelt Summen */ #define NUMROWS 5 @@ -72,9 +72,9 @@ extern "C" { unsigned char relations[MAXSIDES]; struct side *enemies[MAXSIDES]; struct fighter *fighters; - int index; /* Eintrag der Fraktion in b->matrix/b->enemies */ + unsigned int index; /* Eintrag der Fraktion in b->matrix/b->enemies */ int size[NUMROWS]; /* Anzahl Personen in Reihe X. 0 = Summe */ - int nonblockers[NUMROWS]; /* Anzahl nichtblockierender Kämpfer, z.B. Schattenritter. */ + int nonblockers[NUMROWS]; /* Anzahl nichtblockierender Kaempfer, z.B. Schattenritter. */ int alive; /* Die Partei hat den Kampf verlassen */ int removed; /* stoned */ int flee; @@ -131,7 +131,7 @@ extern "C" { /*** fighter::person::flags ***/ #define FL_TIRED 1 -#define FL_DAZZLED 2 /* durch Untote oder Dämonen eingeschüchtert */ +#define FL_DAZZLED 2 /* durch Untote oder Daemonen eingeschuechtert */ #define FL_PANICED 4 #define FL_COURAGE 8 /* Helden fliehen nie */ #define FL_SLEEPING 16 @@ -156,17 +156,17 @@ extern "C" { typedef struct fighter { struct fighter *next; struct side *side; - struct unit *unit; /* Die Einheit, die hier kämpft */ - struct building *building; /* Gebäude, in dem die Einheit evtl. steht */ + struct unit *unit; /* Die Einheit, die hier kaempft */ + struct building *building; /* Gebaeude, in dem die Einheit evtl. steht */ status_t status; /* Kampfstatus */ struct weapon *weapons; - struct armor *armors; /* Anzahl Rüstungen jeden Typs */ + struct armor *armors; /* Anzahl Ruestungen jeden Typs */ int alive; /* Anzahl der noch nicht Toten in der Einheit */ - int fighting; /* Anzahl der Kämpfer in der aktuellen Runde */ + int fighting; /* Anzahl der Kaempfer in der aktuellen Runde */ int removed; /* Anzahl Kaempfer, die nicht tot sind, aber aus dem Kampf raus sind (zB weil sie versteinert wurden). Diese werden auch - in alive noch mitgezählt! */ + in alive noch mitgezaehlt! */ int magic; /* Magietalent der Einheit */ int horses; /* Anzahl brauchbarer Pferde der Einheit */ int elvenhorses; /* Anzahl brauchbarer Elfenpferde der Einheit */ @@ -179,7 +179,7 @@ extern "C" { int defence : 8; /* (Magie) Paradenbonus der Personen */ int damage : 8; /* (Magie) Schadensbonus der Personen im Nahkampf */ int damage_rear : 8; /* (Magie) Schadensbonus der Personen im Fernkampf */ - int flags : 8; /* (Magie) Diverse Flags auf Kämpfern */ + int flags : 8; /* (Magie) Diverse Flags auf Kaempfern */ int speed : 8; /* (Magie) Geschwindigkeitsmultiplkator. */ int reload : 4; /* Anzahl Runden, die die Waffe x noch laden muss. * dahinter steckt ein array[RL_MAX] wenn er min. eine hat. */ @@ -224,6 +224,7 @@ extern "C" { } meffect; extern const troop no_troop; + extern bool battledebug; /* BEGIN battle interface */ side * find_side(battle * b, const struct faction * f, const struct group * g, unsigned int flags, const struct faction * stealthfaction); diff --git a/src/battle.test.c b/src/battle.test.c index f5c4979d7..7228ef90e 100644 --- a/src/battle.test.c +++ b/src/battle.test.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +60,7 @@ static void test_make_fighter(CuTest * tc) test_cleanup(); } -static int add_two(building * b, unit * u, building_bonus bonus) { +static int add_two(const building * b, const unit * u, building_bonus bonus) { return 2; } @@ -187,7 +188,7 @@ static void test_building_defence_bonus(CuTest * tc) test_cleanup(); r = test_create_region(0, 0, 0); btype = test_create_buildingtype("castle"); - btype->protection = (int(*)(struct building *, struct unit *, building_bonus))get_function("building_protection"); + btype->protection = (int(*)(const struct building *, const struct unit *, building_bonus))get_function("building_protection"); btype->construction->defense_bonus = 3; bld = test_create_building(r, btype); bld->size = 1; @@ -203,10 +204,14 @@ static void test_building_defence_bonus(CuTest * tc) } static fighter *setup_fighter(battle **bp, unit *u) { - battle *b; + battle *b = *bp; + side *s; - *bp = b = make_battle(u->region); - return make_fighter(b, u, make_side(b, u->faction, 0, 0, 0), false); + if (!b) { + *bp = b = make_battle(u->region); + } + s = make_side(b, u->faction, 0, 0, 0); + return make_fighter(b, u, s, false); } static void test_natural_armor(CuTest * tc) @@ -229,7 +234,7 @@ static void test_natural_armor(CuTest * tc) static void test_calculate_armor(CuTest * tc) { troop dt; - battle *b; + battle *b = NULL; region *r; unit *du; weapon_type *wtype; @@ -255,6 +260,7 @@ static void test_calculate_armor(CuTest * tc) CuAssertDblEquals_Msg(tc, "magres unmodified", 1.0, magres, 0.01); free_battle(b); + b = NULL; i_change(&du->items, ibelt, 1); dt.fighter = setup_fighter(&b, du); CuAssertIntEquals_Msg(tc, "magical armor", 1, calculate_armor(dt, 0, 0, 0)); @@ -263,6 +269,7 @@ static void test_calculate_armor(CuTest * tc) rc->armor = 0; free_battle(b); + b = NULL; i_change(&du->items, ishield, 1); i_change(&du->items, ichain, 1); dt.fighter = setup_fighter(&b, du); @@ -270,6 +277,7 @@ static void test_calculate_armor(CuTest * tc) CuAssertIntEquals_Msg(tc, "require BF_EQUIPMENT", 1, calculate_armor(dt, 0, 0, 0)); free_battle(b); + b = NULL; rc->battle_flags |= BF_EQUIPMENT; dt.fighter = setup_fighter(&b, du); CuAssertIntEquals_Msg(tc, "stack equipment rc", 5, calculate_armor(dt, 0, 0, 0)); @@ -296,7 +304,7 @@ static void test_calculate_armor(CuTest * tc) static void test_magic_resistance(CuTest *tc) { troop dt; - battle *b; + battle *b = NULL; region *r; unit *du; armor_type *ashield, *achain; @@ -324,6 +332,7 @@ static void test_magic_resistance(CuTest *tc) calculate_armor(dt, 0, 0, &magres); free_battle(b); + b = NULL; i_change(&du->items, ishield, 1); i_change(&du->items, ichain, 1); achain->flags |= ATF_LAEN; @@ -335,6 +344,7 @@ static void test_magic_resistance(CuTest *tc) CuAssertDblEquals_Msg(tc, "laen reduction", 0.81, magres, 0.01); free_battle(b); + b = NULL; i_change(&du->items, ishield, -1); i_change(&du->items, ichain, -1); set_level(du, SK_MAGIC, 2); @@ -359,7 +369,7 @@ static void test_magic_resistance(CuTest *tc) static void test_projectile_armor(CuTest * tc) { troop dt; - battle *b; + battle *b = NULL; region *r; unit *du; weapon_type *wtype; @@ -394,10 +404,88 @@ static void test_projectile_armor(CuTest * tc) test_cleanup(); } +static void test_battle_skilldiff(CuTest *tc) +{ + troop ta, td; + region *r; + unit *ua, *ud; + battle *b = NULL; + + test_cleanup(); + + r = test_create_region(0, 0, 0); + ud = test_create_unit(test_create_faction(0), r); + ua = test_create_unit(test_create_faction(0), r); + td.fighter = setup_fighter(&b, ud); + td.index = 0; + ta.fighter = setup_fighter(&b, ua); + ta.index = 0; + ua = test_create_unit(test_create_faction(0), r); + CuAssertIntEquals(tc, 0, skilldiff(ta, td, 0)); + + ta.fighter->person[0].attack = 2; + td.fighter->person[0].defence = 1; + CuAssertIntEquals(tc, 1, skilldiff(ta, td, 0)); + + td.fighter->person[0].flags |= FL_SLEEPING; + CuAssertIntEquals(tc, 3, skilldiff(ta, td, 0)); + + // TODO: unarmed halfling vs. dragon: +5 + // TODO: rule_goblin_bonus + // TODO: weapon modifiers, missiles, skill_formula + + free_battle(b); + test_cleanup(); +} + +static int protect(const building *b, const unit *u, building_bonus bonus) { + return (bonus == DEFENSE_BONUS) ? 4 : 0; +} + +static void test_battle_skilldiff_building(CuTest *tc) +{ + troop ta, td; + region *r; + unit *ua, *ud; + battle *b = NULL; + building_type *btype; + const curse_type *strongwall_ct, *magicwalls_ct; + + test_cleanup(); + btype = test_create_buildingtype("castle"); + strongwall_ct = ct_find("strongwall"); + magicwalls_ct = ct_find("magicwalls"); + + r = test_create_region(0, 0, 0); + ud = test_create_unit(test_create_faction(0), r); + ud->building = test_create_building(ud->region, btype); + ua = test_create_unit(test_create_faction(0), r); + td.fighter = setup_fighter(&b, ud); + td.index = 0; + ta.fighter = setup_fighter(&b, ua); + ta.index = 0; + ua = test_create_unit(test_create_faction(0), r); + CuAssertIntEquals(tc, 0, skilldiff(ta, td, 0)); + + btype->protection = protect; + CuAssertIntEquals(tc, -4, skilldiff(ta, td, 0)); + + create_curse(NULL, &ud->building->attribs, magicwalls_ct, 1, 1, 1, 1); + CuAssertIntEquals(tc, -8, skilldiff(ta, td, 0)); + + create_curse(NULL, &ud->building->attribs, strongwall_ct, 1, 1, 2, 1); + CuAssertIntEquals(tc, -10, skilldiff(ta, td, 0)); + + free_battle(b); + test_cleanup(); +} + CuSuite *get_battle_suite(void) { CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_make_fighter); + SUITE_ADD_TEST(suite, test_battle_skilldiff); + SUITE_ADD_TEST(suite, test_battle_skilldiff_building); SUITE_ADD_TEST(suite, test_defenders_get_building_bonus); SUITE_ADD_TEST(suite, test_attackers_get_no_building_bonus); SUITE_ADD_TEST(suite, test_building_bonus_respects_size); diff --git a/src/bind_eressea.c b/src/bind_eressea.c index d7683ec18..279ce8f4e 100755 --- a/src/bind_eressea.c +++ b/src/bind_eressea.c @@ -19,7 +19,7 @@ void eressea_free_game(void) { } int eressea_read_game(const char * filename) { - return readgame(filename, false); + return readgame(filename); } int eressea_write_game(const char * filename) { diff --git a/src/bind_faction.c b/src/bind_faction.c index a4302f3c9..36da798c1 100644 --- a/src/bind_faction.c +++ b/src/bind_faction.c @@ -19,7 +19,6 @@ without prior permission by the authors of Eressea. #include #include -#include #include #include #include @@ -38,6 +37,23 @@ without prior permission by the authors of Eressea. #include #include +typedef struct helpmode { + const char *name; + int status; +} helpmode; + +static helpmode helpmodes[] = { + { "all", HELP_ALL }, + { "money", HELP_MONEY }, + { "fight", HELP_FIGHT }, + { "observe", HELP_OBSERVE }, + { "give", HELP_GIVE }, + { "guard", HELP_GUARD }, + { "stealth", HELP_FSTEALTH }, + { "travel", HELP_TRAVEL }, + { NULL, 0 } +}; + int tolua_factionlist_next(lua_State * L) { faction **faction_ptr = (faction **)lua_touserdata(L, lua_upvalueindex(1)); @@ -376,7 +392,7 @@ static int tolua_faction_create(lua_State * L) f = addfaction(email, NULL, frace, loc, 0); } if (!f) { - log_error("faction.create(%s, %s, %s)\n", email, racename, locale_name(loc)); + log_error("cannot create %s faction for %s, unknown race.", racename, email); } tolua_pushusertype(L, f, TOLUA_CAST "faction"); return 1; diff --git a/src/bind_log.c b/src/bind_log.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/bind_log.h b/src/bind_log.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/bind_message.c b/src/bind_message.c index 15673f4f6..a3ab95d39 100644 --- a/src/bind_message.c +++ b/src/bind_message.c @@ -1,6 +1,4 @@ #include -#include - #include "spells.h" /* kernel includes */ diff --git a/src/bind_monsters.c b/src/bind_monsters.c index 271045491..3e3f24bee 100644 --- a/src/bind_monsters.c +++ b/src/bind_monsters.c @@ -47,6 +47,12 @@ static int tolua_spawn_dragons(lua_State * L) return 0; } +static int tolua_get_monsters(lua_State * L) +{ + tolua_pushusertype(L, get_monsters(), "faction"); + return 1; +} + static int tolua_spawn_undead(lua_State * L) { spawn_undead(); @@ -90,7 +96,8 @@ void bind_monsters(struct lua_State *L) tolua_function(L, TOLUA_CAST "plan_monsters", tolua_planmonsters); tolua_function(L, TOLUA_CAST "spawn_undead", tolua_spawn_undead); tolua_function(L, TOLUA_CAST "spawn_dragons", tolua_spawn_dragons); - tolua_function(L, TOLUA_CAST "fix_familiars", &fix_familiars); + tolua_function(L, TOLUA_CAST "fix_familiars", fix_familiars); + tolua_function(L, TOLUA_CAST "get_monsters", tolua_get_monsters); } tolua_endmodule(L); } diff --git a/src/bind_order.c b/src/bind_order.c index 90fc7d3b0..84399deec 100644 --- a/src/bind_order.c +++ b/src/bind_order.c @@ -1,5 +1,4 @@ #include -#include /* kernel includes */ #include diff --git a/src/bind_process.c b/src/bind_process.c index e8420c654..2b44eb19d 100755 --- a/src/bind_process.c +++ b/src/bind_process.c @@ -182,11 +182,6 @@ void process_promote(void) { process_cmd(K_PROMOTION, promotion_cmd, 0); } -void process_renumber(void) { - process_cmd(K_NUMBER, renumber_cmd, 0); - renumber_factions(); -} - void process_restack(void) { restack_units(); } diff --git a/src/bind_region.c b/src/bind_region.c index e56c3443c..1296e4a65 100644 --- a/src/bind_region.c +++ b/src/bind_region.c @@ -474,9 +474,6 @@ static int tolua_region_create(lua_State * L) } if (result) { terraform_region(result, terrain); - if (result->land) { - fix_demand(result); - } } tolua_pushusertype(L, result, TOLUA_CAST "region"); diff --git a/src/bind_ship.c b/src/bind_ship.c index 22015f673..f1c1c412a 100644 --- a/src/bind_ship.c +++ b/src/bind_ship.c @@ -233,15 +233,7 @@ void tolua_ship_open(lua_State * L) tolua_variable(L, TOLUA_CAST "type", tolua_ship_get_type, 0); tolua_variable(L, TOLUA_CAST "damage", tolua_ship_get_damage, tolua_ship_set_damage); - -#ifdef TODO - .property("weight", &ship_getweight) - .property("capacity", &ship_getcapacity) - .property("maxsize", &ship_maxsize) - .def_readwrite("damage", &ship::damage) - .def_readwrite("size", &ship::size) -#endif - tolua_variable(L, TOLUA_CAST "objects", tolua_ship_get_objects, 0); + tolua_variable(L, TOLUA_CAST "objects", tolua_ship_get_objects, 0); tolua_function(L, TOLUA_CAST "create", tolua_ship_create); } diff --git a/src/bind_storage.c b/src/bind_storage.c index 5dfca8c89..a81a3baeb 100644 --- a/src/bind_storage.c +++ b/src/bind_storage.c @@ -11,11 +11,9 @@ without prior permission by the authors of Eressea. */ #include -#include #include "bind_storage.h" #include -#include #include #include diff --git a/src/bind_unit.c b/src/bind_unit.c index 353bd4667..42fafae39 100755 --- a/src/bind_unit.c +++ b/src/bind_unit.c @@ -18,7 +18,6 @@ without prior permission by the authors of Eressea. #include "bindings.h" #include "move.h" #include "reports.h" -#include "seen.h" #include "guard.h" /* attributes includes */ @@ -60,7 +59,7 @@ without prior permission by the authors of Eressea. static int tolua_bufunit(lua_State * L) { char buf[8192]; unit *self = (unit *)tolua_tousertype(L, 1, 0); - int mode = (int)tolua_tonumber(L, 2, see_unit); + int mode = (int)tolua_tonumber(L, 2, (int)seen_unit); if (!self) return 0; bufunit(self->faction, self, 0, mode, buf, sizeof(buf)); @@ -259,18 +258,15 @@ static int tolua_unit_set_flags(lua_State * L) static int tolua_unit_get_guard(lua_State * L) { unit *self = (unit *)tolua_tousertype(L, 1, 0); - if (is_guard(self, GUARD_ALL)) { - lua_pushinteger(L, getguard(self)); - return 1; - } - return 0; + lua_pushboolean(L, is_guard(self)); + return 1; } static int tolua_unit_set_guard(lua_State * L) { unit *self = (unit *)tolua_tousertype(L, 1, 0); unsigned int flags = (unsigned int)tolua_tonumber(L, 2, 0); - setguard(self, flags); + setguard(self, flags!=0); return 0; } @@ -760,32 +756,11 @@ static int tolua_unit_get_spells(lua_State * L) quicklist *slist = 0; if (sb) { quicklist **slist_ptr = &sb->spells; - if (slist_ptr) { - slist = *slist_ptr; - } + slist = *slist_ptr; } return tolua_quicklist_push(L, "spellbook", "spell_entry", slist); } -#ifdef TODO /* spellbooks */ -static void unit_removespell(unit * u, spell * sp) -{ - quicklist **isptr; - - isptr = get_spelllist(get_mage(u), u->faction); - ql_set_remove(isptr, sp); -} - -static int tolua_unit_removespell(lua_State * L) -{ - unit *self = (unit *) tolua_tousertype(L, 1, 0); - spell *sp = (spell *) tolua_tousertype(L, 2, 0); - unit_removespell(self, sp); - return 0; -} - -#endif - static int tolua_unit_get_orders(lua_State * L) { unit *self = (unit *)tolua_tousertype(L, 1, 0); @@ -1019,9 +994,6 @@ void tolua_unit_open(lua_State * L) tolua_variable(L, TOLUA_CAST "race_name", &tolua_unit_get_racename, &tolua_unit_set_racename); tolua_function(L, TOLUA_CAST "add_spell", &tolua_unit_addspell); -#ifdef TODO /* spellbooks */ - tolua_function(L, TOLUA_CAST "remove_spell", &tolua_unit_removespell); -#endif tolua_variable(L, TOLUA_CAST "spells", &tolua_unit_get_spells, 0); tolua_function(L, TOLUA_CAST "cast_spell", &tolua_unit_castspell); diff --git a/src/bindings.c b/src/bindings.c index b95b1f9f0..aa2e177c1 100755 --- a/src/bindings.c +++ b/src/bindings.c @@ -26,7 +26,6 @@ without prior permission by the authors of Eressea. #include "helpers.h" #include "console.h" #include "reports.h" -#include "seen.h" #include "study.h" #include "calendar.h" @@ -51,7 +50,6 @@ without prior permission by the authors of Eressea. #include #include -#include "creport.h" #include "economy.h" #include "summary.h" #include "teleport.h" @@ -566,11 +564,14 @@ static int tolua_write_summary(lua_State * L) struct summary *sum_end = make_summary(); report_summary(sum_end, sum_begin, false); report_summary(sum_end, sum_begin, true); + free_summary(sum_end); + free_summary(sum_begin); + sum_begin = 0; return 0; } return 0; } - +/* static int tolua_write_map(lua_State * L) { const char *filename = tolua_tostring(L, 1, 0); @@ -579,7 +580,7 @@ static int tolua_write_map(lua_State * L) } return 0; } - +*/ static int tolua_read_turn(lua_State * L) { int cturn = current_turn(); @@ -972,7 +973,7 @@ static int tolua_report_unit(lua_State * L) char buffer[512]; unit *u = (unit *)tolua_tousertype(L, 1, 0); faction *f = (faction *)tolua_tousertype(L, 2, 0); - bufunit(f, u, 0, see_unit, buffer, sizeof(buffer)); + bufunit(f, u, 0, seen_unit, buffer, sizeof(buffer)); tolua_pushstring(L, buffer); return 1; } @@ -1088,7 +1089,7 @@ int tolua_bindings_open(lua_State * L) tolua_function(L, TOLUA_CAST "factions", tolua_get_factions); tolua_function(L, TOLUA_CAST "regions", tolua_get_regions); tolua_function(L, TOLUA_CAST "read_turn", tolua_read_turn); - tolua_function(L, TOLUA_CAST "write_map", &tolua_write_map); +// tolua_function(L, TOLUA_CAST "write_map", &tolua_write_map); tolua_function(L, TOLUA_CAST "read_orders", tolua_read_orders); tolua_function(L, TOLUA_CAST "process_orders", tolua_process_orders); tolua_function(L, TOLUA_CAST "init_reports", tolua_init_reports); diff --git a/src/building_action.c b/src/building_action.c index b6ce0f72c..5c533f4d0 100644 --- a/src/building_action.c +++ b/src/building_action.c @@ -13,7 +13,6 @@ without prior permission by the authors of Eressea. #include #include #include -#include #include #include #include diff --git a/src/buildno.h b/src/buildno.h deleted file mode 100644 index 783125b69..000000000 --- a/src/buildno.h +++ /dev/null @@ -1,3 +0,0 @@ -#define VERSION_MAJOR 3 -#define VERSION_MINOR 9 -#define VERSION_BUILD 4 diff --git a/src/calendar.c b/src/calendar.c index 0f4617642..7a27328a7 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -38,22 +38,34 @@ void calendar_cleanup(void) free(agename); - for (i = 0; i != seasons; ++i) { - free(seasonnames[i]); + if (seasonnames) { + for (i = 0; i != seasons; ++i) { + free(seasonnames[i]); + } + free(seasonnames); + seasonnames = 0; } - free(seasonnames); - for (i = 0; i != months_per_year; ++i) { - free(monthnames[i]); + if (monthnames) { + for (i = 0; i != months_per_year; ++i) { + free(monthnames[i]); + } + free(storms); + storms = 0; + free(month_season); + month_season = 0; + free(monthnames); + monthnames = 0; } - free(storms); - free(month_season); - free(monthnames); for (i = 0; i != weeks_per_month; ++i) { - free(weeknames[i]); - free(weeknames2[i]); + if (weeknames) + free(weeknames[i]); + if (weeknames2) + free(weeknames2[i]); } free(weeknames); + weeknames = 0; free(weeknames2); + weeknames2 = 0; } diff --git a/src/callback.c b/src/callback.c deleted file mode 100644 index 79bd69b71..000000000 --- a/src/callback.c +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include "callback.h" -#include -#include - -static struct reg { - struct reg * next; - HCALLBACK cb; - char *name; -} *registry; - -HCALLBACK create_callback(void(*cbv)(va_list va)) { - HCALLBACK cb; - cb.cbv = cbv; - return cb; -} - -void reset_callbacks(void) { - while (registry) { - struct reg *r = registry; - registry = r->next; - free(r->name); - free(r); - } - registry = 0; -} - -HCALLBACK register_callback(const char *name, void(*cbv)(va_list va)) -{ - struct reg * r = (struct reg *)malloc(sizeof(struct reg)); - r->next = registry; - r->name = _strdup(name); - r->cb.cbv = cbv; - registry = r; - return r->cb; -} - -int find_callback(const char *name, HCALLBACK *result) { - if (result && name) { - struct reg *r; - for (r = registry; r; r = r->next) { - if (strcmp(r->name, name) == 0) { - *result = r->cb; - return 0; - } - } - } - return -1; -} - -int call_callback(HCALLBACK cb, const char *name, ...) { - va_list ap; - if (name) { - int err = find_callback(name, &cb); - if (err) return err; - } - va_start(ap, name); - cb.cbv(ap); - va_end(ap); - return 0; -} diff --git a/src/callback.h b/src/callback.h deleted file mode 100644 index 288a148e9..000000000 --- a/src/callback.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef H_CALLBACK_H -#define H_CALLBACK_H - -#include - -typedef struct { - void(*cbv)(va_list va); -} HCALLBACK; - -HCALLBACK register_callback(const char *name, void(*cbv)(va_list va)); -HCALLBACK create_callback(void(*cbv)(va_list va)); -int find_callback(const char *name, HCALLBACK *result); -int call_callback(HCALLBACK cb, const char *name, ...); -void reset_callbacks(void); - -#endif diff --git a/src/callback.test.c b/src/callback.test.c deleted file mode 100644 index 317cc6d50..000000000 --- a/src/callback.test.c +++ /dev/null @@ -1,51 +0,0 @@ -#include "callback.h" -#include -#include - -void callback(va_list ap) { - int i = (int)va_arg(ap, int); - int *p = va_arg(ap, int *); - *p += i; -} - -static void test_find_callback(CuTest *tc) { - HCALLBACK cb; - reset_callbacks(); - CuAssertIntEquals(tc, -1, find_callback("test", &cb)); - cb = register_callback("test", callback); - CuAssertIntEquals(tc, 0, find_callback("test", &cb)); - reset_callbacks(); -} - -static void test_call_by_handle(CuTest *tc) { - HCALLBACK cb; - int x = 0; - reset_callbacks(); - cb = create_callback(callback); - CuAssertIntEquals(tc, 0, call_callback(cb, 0, 42, &x)); - CuAssertIntEquals(tc, 42, x); - reset_callbacks(); -} - -static void test_call_by_name(CuTest *tc) { - HCALLBACK cb = { 0 }; - HCALLBACK ca = { 0 }; - int x = 0; - reset_callbacks(); - CuAssertIntEquals(tc, -1, call_callback(cb, "test", 42, &x)); - cb = register_callback("test", callback); - CuAssertIntEquals(tc, 0, call_callback(cb, "test", 42, &x)); - CuAssertIntEquals(tc, 42, x); - CuAssertIntEquals(tc, 0, call_callback(ca, "test", 42, &x)); - CuAssertIntEquals(tc, 84, x); - reset_callbacks(); -} - -CuSuite *get_callback_suite(void) -{ - CuSuite *suite = CuSuiteNew(); - SUITE_ADD_TEST(suite, test_find_callback); - SUITE_ADD_TEST(suite, test_call_by_name); - SUITE_ADD_TEST(suite, test_call_by_handle); - return suite; -} diff --git a/src/chaos.c b/src/chaos.c index afa787b29..942fb87bc 100644 --- a/src/chaos.c +++ b/src/chaos.c @@ -28,7 +28,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include #include #include @@ -86,7 +85,7 @@ static const terrain_type *chaosterrain(void) if (numtypes == 0) { const terrain_type *terrain; for (terrain = terrains(); terrain != NULL; terrain = terrain->next) { - if (fval(terrain, LAND_REGION) && terrain->herbs) { + if ((terrain->flags & LAND_REGION) && terrain->herbs) { ++numtypes; } } @@ -94,7 +93,7 @@ static const terrain_type *chaosterrain(void) types = malloc(sizeof(terrain_type *) * numtypes); numtypes = 0; for (terrain = terrains(); terrain != NULL; terrain = terrain->next) { - if (fval(terrain, LAND_REGION) && terrain->herbs) { + if ((terrain->flags & LAND_REGION) && terrain->herbs) { types[numtypes++] = terrain; } } @@ -140,7 +139,7 @@ static void chaos(region * r) if (rng_int() % 100 < 8) { switch (rng_int() % 3) { case 0: /* Untote */ - if (!fval(r->terrain, SEA_REGION)) { + if (!(r->terrain->flags & SEA_REGION)) { unit *u = random_unit(r); if (u && playerrace(u_race(u))) { ADDMSG(&u->faction->msgs, msg_message("chaos_disease", "unit", u)); @@ -162,29 +161,28 @@ static void chaos(region * r) break; case 1: mfac = 500; - u = - create_unit(r, get_monsters(), rng_int() % 4 + 1, + u = create_unit(r, get_monsters(), rng_int() % 4 + 1, get_race(RC_DRAGON), 0, NULL, NULL); break; default: mfac = 1000; - u = - create_unit(r, get_monsters(), rng_int() % 2 + 1, + u = create_unit(r, get_monsters(), rng_int() % 2 + 1, get_race(RC_WYRM), 0, NULL, NULL); break; } - if (mfac) + if (mfac) { set_money(u, u->number * (rng_int() % mfac)); - fset(u, UFL_ISNEW | UFL_MOVED); + } + u->flags |= (UFL_ISNEW | UFL_MOVED); } break; - case 2: /* Terrainveränderung */ - if (!fval(r->terrain, FORBIDDEN_REGION)) { - if (!fval(r->terrain, SEA_REGION)) { + case 2: /* Terrainver�nderung */ + if (!(r->terrain->flags & FORBIDDEN_REGION)) { + if (!(r->terrain->flags & SEA_REGION)) { direction_t dir; for (dir = 0; dir != MAXDIRECTIONS; ++dir) { region *rn = rconnect(r, dir); - if (rn && fval(rn->terrain, SEA_REGION)) + if (rn && (rn->terrain->flags & SEA_REGION)) break; } if (dir != MAXDIRECTIONS) { @@ -225,7 +223,7 @@ static void chaos(region * r) direction_t dir; for (dir = 0; dir != MAXDIRECTIONS; ++dir) { region *rn = rconnect(r, dir); - if (rn && fval(rn->terrain, SEA_REGION)) + if (rn && (rn->terrain->flags & SEA_REGION)) break; } if (dir != MAXDIRECTIONS) { @@ -243,7 +241,7 @@ void chaos_update(void) { for (r = regions; r; r = r->next) { int i; - if (fval(r, RF_CHAOTIC)) { + if ((r->flags & RF_CHAOTIC)) { chaos(r); } i = get_chaoscount(r); diff --git a/src/console.h b/src/console.h index a00a3ad58..fdc869f11 100644 --- a/src/console.h +++ b/src/console.h @@ -18,6 +18,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef H_LUA_CONSOLE #define H_LUA_CONSOLE + +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/src/creport.c b/src/creport.c index 6ba9f5e39..c05377e2e 100644 --- a/src/creport.c +++ b/src/creport.c @@ -1,4 +1,4 @@ -/* +/* +-------------------+ Enno Rehling | Eressea PBEM host | Christian Schlittchen | (c) 1998 - 2008 | Katja Zedel @@ -9,9 +9,10 @@ without prior permission by the authors of Eressea. #include #include -#include "buildno.h" +#include #include "creport.h" -#include "seen.h" +#include "market.h" +#include "guard.h" #include "travelthru.h" /* tweakable features */ @@ -24,7 +25,6 @@ without prior permission by the authors of Eressea. /* attributes include */ #include -#include #include #include #include @@ -58,7 +58,6 @@ without prior permission by the authors of Eressea. #include #include #include -#include /* util includes */ #include @@ -71,6 +70,7 @@ without prior permission by the authors of Eressea. #include #include #include +#include /* libc includes */ #include @@ -178,7 +178,7 @@ static void print_items(FILE * F, item * items, const struct locale *lang) } static void -cr_output_curses(stream *out, const faction * viewer, const void *obj, objtype_t typ) +cr_output_curses(struct stream *out, const faction * viewer, const void *obj, objtype_t typ) { bool header = false; attrib *a = NULL; @@ -186,9 +186,9 @@ cr_output_curses(stream *out, const faction * viewer, const void *obj, objtype_t region *r; /* Die Sichtbarkeit eines Zaubers und die Zaubermeldung sind bei - * Gebäuden und Schiffen je nach, ob man Besitzer ist, verschieden. + * Gebaeuden und Schiffen je nach, ob man Besitzer ist, verschieden. * Bei Einheiten sieht man Wirkungen auf eigene Einheiten immer. - * Spezialfälle (besonderes Talent, verursachender Magier usw. werde + * Spezialfaelle (besonderes Talent, verursachender Magier usw. werde * bei jedem curse gesondert behandelt. */ if (typ == TYP_SHIP) { ship *sh = (ship *)obj; @@ -735,20 +735,17 @@ static void cr_output_spells(stream *out, const unit * u, int maxlevel) * @param u unit to report */ void cr_output_unit(stream *out, const region * r, const faction * f, - const unit * u, int mode) + const unit * u, seen_mode mode) { /* Race attributes are always plural and item attributes always * singular */ const char *str; const item_type *lasttype; int pr; - item *itm, *show; + item *itm, *show = NULL; building *b; const char *pzTmp; skill *sv; - bool itemcloak = false; - static const curse_type *itemcloak_ct = 0; - static bool init = false; item result[MAX_INVENTORY]; const faction *sf; const char *prefix; @@ -758,15 +755,6 @@ void cr_output_unit(stream *out, const region * r, const faction * f, if (fval(u_race(u), RCF_INVISIBLE)) return; - if (!init) { - init = true; - itemcloak_ct = ct_find("itemcloak"); - } - if (itemcloak_ct != NULL) { - curse * cu = get_curse(u->attribs, itemcloak_ct); - itemcloak = cu && curse_active(cu); - } - stream_printf(out, "EINHEIT %d\n", u->no); stream_printf(out, "\"%s\";Name\n", unit_getname(u)); str = u_description(u, f->locale); @@ -794,7 +782,7 @@ void cr_output_unit(stream *out, const region * r, const faction * f, if (sf != u->faction) stream_printf(out, "%d;Verkleidung\n", sf->no); if (fval(u, UFL_ANON_FACTION)) - stream_printf(out, "%d;Parteitarnung\n", i2b(fval(u, UFL_ANON_FACTION))); + stream_printf(out, "%d;Parteitarnung\n", (u->flags & UFL_ANON_FACTION)!=0); if (otherfaction && otherfaction != u->faction) { stream_printf(out, "%d;Anderepartei\n", otherfaction->no); } @@ -806,7 +794,7 @@ void cr_output_unit(stream *out, const region * r, const faction * f, else { if (fval(u, UFL_ANON_FACTION)) { /* faction info is hidden */ - stream_printf(out, "%d;Parteitarnung\n", i2b(fval(u, UFL_ANON_FACTION))); + stream_printf(out, "%d;Parteitarnung\n", (u->flags & UFL_ANON_FACTION) != 0); } else { const attrib *a_otherfaction = a_find(u->attribs, &at_otherfaction); @@ -862,7 +850,7 @@ void cr_output_unit(stream *out, const region * r, const faction * f, assert(u->ship->region); stream_printf(out, "%d;Schiff\n", u->ship->no); } - if (is_guard(u, GUARD_ALL) != 0) { + if (is_guard(u)) { stream_printf(out, "%d;bewacht\n", 1); } if ((b = usiege(u)) != NULL) { @@ -970,16 +958,14 @@ void cr_output_unit(stream *out, const region * r, const faction * f, if (f == u->faction || omniscient(f)) { show = u->items; } - else if (!itemcloak && mode >= see_unit) { - int n = report_items(u->items, result, MAX_INVENTORY, u, f); - assert(n >= 0); - if (n > 0) - show = result; - else - show = NULL; - } else { - show = NULL; + if (mode >= seen_unit) { + int n = report_items(u, result, MAX_INVENTORY, u, f); + assert(n >= 0); + if (n > 0) { + show = result; + } + } } lasttype = NULL; for (itm = show; itm; itm = itm->next) { @@ -1126,8 +1112,7 @@ static char *cr_output_resource(char *buf, const char *name, } static void -cr_borders(seen_region ** seen, const region * r, const faction * f, -int seemode, FILE * F) +cr_borders(const region * r, const faction * f, seen_mode mode, FILE * F) { direction_t d; int g = 0; @@ -1136,9 +1121,8 @@ int seemode, FILE * F) const connection *b; if (!r2) continue; - if (seemode == see_neighbour) { - seen_region *sr = find_seen(seen, r2); - if (sr == NULL || sr->mode <= see_neighbour) + if (mode == seen_neighbour) { + if (r2->seen.mode <= seen_neighbour) continue; } b = get_borders(r, r2); @@ -1179,13 +1163,12 @@ int seemode, FILE * F) } static void -cr_output_resources(FILE * F, report_context * ctx, seen_region * sr) +cr_output_resources(FILE * F, report_context * ctx, region *r, bool see_unit) { char cbuf[BUFFERSIZE], *pos = cbuf; - const region *r = sr->r; faction *f = ctx->f; resource_report result[MAX_RAWMATERIALS]; - int n, size = report_resources(sr, result, MAX_RAWMATERIALS, f); + int n, size = report_resources(r, result, MAX_RAWMATERIALS, f, see_unit); #ifdef RESOURCECOMPAT int trees = rtrees(r, 2); @@ -1271,10 +1254,9 @@ static void cr_output_travelthru(FILE *F, region *r, const faction *f) { travelthru_map(r, cb_cr_travelthru_unit, &cbdata); } -static void cr_output_region(FILE * F, report_context * ctx, seen_region * sr) +static void cr_output_region(FILE * F, report_context * ctx, region * r) { faction *f = ctx->f; - region *r = sr->r; plane *pl = rplane(r); int plid = plane_id(pl), nx, ny; const char *tname; @@ -1282,7 +1264,7 @@ static void cr_output_region(FILE * F, report_context * ctx, seen_region * sr) int uid = r->uid; #ifdef OCEAN_NEIGHBORS_GET_NO_ID - if (sr->mode <= see_neighbour && !r->land) { + if (r->seen.mode <= seen_neighbour && !r->land) { uid = 0; } #endif @@ -1331,28 +1313,25 @@ static void cr_output_region(FILE * F, report_context * ctx, seen_region * sr) tname = terrain_name(r); fprintf(F, "\"%s\";Terrain\n", translate(tname, LOC(f->locale, tname))); - if (sr->mode != see_unit) - fprintf(F, "\"%s\";visibility\n", visibility[sr->mode]); - if (sr->mode == see_neighbour) { - cr_borders(ctx->f->seen, r, f, sr->mode, F); + if (r->seen.mode != seen_unit) + fprintf(F, "\"%s\";visibility\n", visibility[r->seen.mode]); + if (r->seen.mode == seen_neighbour) { + cr_borders(r, f, r->seen.mode, F); } else { building *b; ship *sh; unit *u; - int stealthmod = stealth_modifier(sr->mode); + int stealthmod = stealth_modifier(r->seen.mode); if (r->display && r->display[0]) fprintf(F, "\"%s\";Beschr\n", r->display); if (fval(r->terrain, LAND_REGION)) { assert(r->land); fprintf(F, "%d;Bauern\n", rpeasants(r)); - if (fval(r, RF_ORCIFIED)) { - fprintf(F, "1;Verorkt\n"); - } fprintf(F, "%d;Pferde\n", rhorses(r)); - if (sr->mode >= see_unit) { + if (r->seen.mode >= seen_unit) { if (rule_region_owners()) { faction *owner = region_get_owner(r); if (owner) { @@ -1383,9 +1362,9 @@ static void cr_output_region(FILE * F, report_context * ctx, seen_region * sr) /* this writes both some tags (RESOURCECOMPAT) and a block. * must not write any blocks before it */ - cr_output_resources(F, ctx, sr); + cr_output_resources(F, ctx, r, r->seen.mode >= seen_unit); - if (sr->mode >= see_unit) { + if (r->seen.mode >= seen_unit) { /* trade */ if (markets_module() && r->land) { const item_type *lux = r_luxury(r); @@ -1422,8 +1401,8 @@ static void cr_output_region(FILE * F, report_context * ctx, seen_region * sr) print_items(F, r->land->items, f->locale); } cr_output_curses_compat(F, f, r, TYP_REGION); - cr_borders(ctx->f->seen, r, f, sr->mode, F); - if (sr->mode == see_unit && is_astral(r) + cr_borders(r, f, r->seen.mode, F); + if (r->seen.mode == seen_unit && is_astral(r) && !is_cursed(r->attribs, C_ASTRALBLOCK, 0)) { /* Sonderbehandlung Teleport-Ebene */ region_list *rl = astralregions(r, inhabitable); @@ -1446,7 +1425,7 @@ static void cr_output_region(FILE * F, report_context * ctx, seen_region * sr) } cr_output_travelthru(F, r, f); - if (sr->mode == see_unit || sr->mode == see_travel) { + if (r->seen.mode == seen_unit || r->seen.mode == seen_travel) { message_list *mlist = r_getmessages(r, f); cr_output_messages(F, r->msgs, f); if (mlist) { @@ -1481,7 +1460,7 @@ static void cr_output_region(FILE * F, report_context * ctx, seen_region * sr) if (u->building || u->ship || (stealthmod > INT_MIN && cansee(f, r, u, stealthmod))) { - cr_output_unit_compat(F, r, f, u, sr->mode); + cr_output_unit_compat(F, r, f, u, r->seen.mode); } } } @@ -1489,7 +1468,7 @@ static void cr_output_region(FILE * F, report_context * ctx, seen_region * sr) /* main function of the creport. creates the header and traverses all regions */ static int -report_computer(const char *filename, report_context * ctx, const char *charset) +report_computer(const char *filename, report_context * ctx, const char *bom) { static int era = -1; int i; @@ -1498,8 +1477,9 @@ report_computer(const char *filename, report_context * ctx, const char *charset) region *r; const char *mailto = LOC(f->locale, "mailto"); const attrib *a; - seen_region *sr = NULL; FILE *F = fopen(filename, "w"); + static const race *rc_human; + static int rc_cache; if (era < 0) { era = config_get_int("world.era", 1); @@ -1508,9 +1488,8 @@ report_computer(const char *filename, report_context * ctx, const char *charset) perror(filename); return -1; } - else if (_strcmpl(charset, "utf-8") == 0 || _strcmpl(charset, "utf8") == 0) { - const unsigned char utf8_bom[4] = { 0xef, 0xbb, 0xbf, 0 }; - fwrite(utf8_bom, 1, 3, F); + else if (bom) { + fwrite(bom, 1, strlen(bom), F); } /* must call this to get all the neighbour regions */ @@ -1518,8 +1497,8 @@ report_computer(const char *filename, report_context * ctx, const char *charset) /* initialisations, header and lists */ fprintf(F, "VERSION %d\n", C_REPORT_VERSION); - fprintf(F, "\"%s\";charset\n", charset); - fprintf(F, "\"%s\";locale\n", locale_name(f->locale)); + fprintf(F, "\"utf-8\";charset\n\"%s\";locale\n", + locale_name(f->locale)); fprintf(F, "%d;noskillpoints\n", 1); fprintf(F, "%lld;date\n", (long long)ctx->report_time); fprintf(F, "\"%s\";Spiel\n", game_name()); @@ -1529,7 +1508,7 @@ report_computer(const char *filename, report_context * ctx, const char *charset) fprintf(F, "%d;Basis\n", 36); fprintf(F, "%d;Runde\n", turn); fprintf(F, "%d;Zeitalter\n", era); - fprintf(F, "\"%d.%d.%d\";Build\n", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD); + fprintf(F, "\"%s\";Build\n", eressea_version()); if (mailto != NULL) { fprintf(F, "\"%s\";mailto\n", mailto); fprintf(F, "\"%s\";mailcmd\n", LOC(f->locale, "mailcmd")); @@ -1566,7 +1545,10 @@ report_computer(const char *filename, report_context * ctx, const char *charset) fprintf(F, "%d;Anzahl Personen\n", count_all(f)); fprintf(F, "\"%s\";Magiegebiet\n", magic_school[f->magiegebiet]); - if (f->race == get_race(RC_HUMAN)) { + if (rc_changed(&rc_cache)) { + rc_human = rc_find("human"); + } + if (f->race == rc_human) { fprintf(F, "%d;Anzahl Immigranten\n", count_migrants(f)); fprintf(F, "%d;Max. Immigranten\n", count_maxmigrants(f)); } @@ -1676,11 +1658,10 @@ report_computer(const char *filename, report_context * ctx, const char *charset) } /* traverse all regions */ - for (r = ctx->first; sr == NULL && r != ctx->last; r = r->next) { - sr = find_seen(ctx->f->seen, r); - } - for (; sr != NULL; sr = sr->next) { - cr_output_region(F, ctx, sr); + for (r = ctx->first; r != ctx->last; r = r->next) { + if (r->seen.mode > seen_none) { + cr_output_region(F, ctx, r); + } } report_crtypes(F, f->locale); write_translations(F); diff --git a/src/creport.h b/src/creport.h index c2c2ff385..fc2517859 100644 --- a/src/creport.h +++ b/src/creport.h @@ -11,6 +11,9 @@ */ #ifndef H_GC_CREPORT #define H_GC_CREPORT + +#include + #ifdef __cplusplus extern "C" { #endif @@ -24,7 +27,8 @@ extern "C" { void register_cr(void); int crwritemap(const char *filename); - void cr_output_unit(struct stream *out, const struct region * r, const struct faction * f, const struct unit * u, int mode); + void cr_output_unit(struct stream *out, const struct region * r, + const struct faction * f, const struct unit * u, seen_mode mode); #ifdef __cplusplus } diff --git a/src/creport.test.c b/src/creport.test.c new file mode 100644 index 000000000..72669e99f --- /dev/null +++ b/src/creport.test.c @@ -0,0 +1,57 @@ +#include +#include "creport.h" +#include "move.h" +#include "travelthru.h" +#include "keyword.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +static void test_cr_unit(CuTest *tc) { + stream strm; + char line[1024]; + faction *f; + region *r; + unit *u; + + test_cleanup(); + f = test_create_faction(0); + r = test_create_region(0, 0, 0); + u = test_create_unit(f, r); + renumber_unit(u, 1234); + + mstream_init(&strm); + cr_output_unit(&strm, r, f, u, seen_unit); + strm.api->rewind(strm.handle); + CuAssertIntEquals(tc, 0, strm.api->readln(strm.handle, line, sizeof(line))); + CuAssertStrEquals(tc, line, "EINHEIT 1234"); + mstream_done(&strm); + test_cleanup(); +} + +CuSuite *get_creport_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_cr_unit); + return suite; +} diff --git a/src/direction.c b/src/direction.c index 0b9bb8206..5e2333bbe 100644 --- a/src/direction.c +++ b/src/direction.c @@ -12,7 +12,7 @@ void init_direction(const struct locale *lang, direction_t dir, const char *str) void **tokens = get_translations(lang, UT_DIRECTIONS); variant token; token.i = dir; - addtoken(tokens, str, token); + addtoken((struct tnode **)tokens, str, token); } void init_directions(struct locale *lang) { @@ -47,7 +47,7 @@ void init_directions(struct locale *lang) { if (str) { variant token; token.i = dirs[i].direction; - addtoken(tokens, str, token); + addtoken((struct tnode **)tokens, str, token); } } } diff --git a/src/direction.test.c b/src/direction.test.c index c2feebd3f..bf50df6bf 100644 --- a/src/direction.test.c +++ b/src/direction.test.c @@ -3,6 +3,7 @@ #include "direction.h" #include "tests.h" +#include #include #include @@ -10,7 +11,7 @@ static void test_init_directions(CuTest *tc) { struct locale *lang; - test_cleanup(); + test_setup(); lang = get_or_create_locale("de"); locale_setstring(lang, "dir_nw", "NW"); init_directions(lang); @@ -20,19 +21,23 @@ static void test_init_directions(CuTest *tc) { static void test_init_direction(CuTest *tc) { struct locale *lang; - test_cleanup(); + test_setup(); lang = get_or_create_locale("de"); init_direction(lang, D_NORTHWEST, "NW"); + init_direction(lang, D_NORTHWEST, "northwest"); init_direction(lang, D_EAST, "OST"); + init_direction(lang, D_EAST, "O"); CuAssertIntEquals(tc, D_NORTHWEST, get_direction("nw", lang)); + CuAssertIntEquals(tc, D_NORTHWEST, get_direction("northwest", lang)); CuAssertIntEquals(tc, D_EAST, get_direction("ost", lang)); + CuAssertIntEquals(tc, D_EAST, get_direction("O", lang)); CuAssertIntEquals(tc, NODIRECTION, get_direction("east", lang)); test_cleanup(); } static void test_finddirection(CuTest *tc) { - test_cleanup(); + test_setup(); CuAssertIntEquals(tc, D_SOUTHWEST, finddirection("southwest")); CuAssertIntEquals(tc, D_SOUTHEAST, finddirection("southeast")); CuAssertIntEquals(tc, D_NORTHWEST, finddirection("northwest")); @@ -42,6 +47,7 @@ static void test_finddirection(CuTest *tc) { CuAssertIntEquals(tc, D_PAUSE, finddirection("pause")); CuAssertIntEquals(tc, NODIRECTION, finddirection("")); CuAssertIntEquals(tc, NODIRECTION, finddirection("potato")); + test_cleanup(); } CuSuite *get_direction_suite(void) diff --git a/src/economy.c b/src/economy.c index 155a46b7e..d3f6189fc 100644 --- a/src/economy.c +++ b/src/economy.c @@ -24,6 +24,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "alchemy.h" #include "direction.h" #include "donations.h" +#include "guard.h" #include "give.h" #include "laws.h" #include "randenc.h" @@ -68,7 +69,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#include /* libs includes */ #include @@ -97,7 +97,7 @@ static request *nextentertainer; static int entertaining; static unsigned int norders; -static request *oa; +static request *g_requests; #define RECRUIT_MERGE 1 static int rules_recruit = -1; @@ -112,18 +112,27 @@ static void recruit_init(void) } } +int entertainmoney(const region * r) +{ + double n; + + if (is_cursed(r->attribs, C_DEPRESSION, 0)) { + return 0; + } + + n = rmoney(r) / (double)ENTERTAINFRACTION; + + if (is_cursed(r->attribs, C_GENEROUS, 0)) { + n *= get_curseeffect(r->attribs, C_GENEROUS, 0); + } + + return (int)n; +} + int income(const unit * u) { - switch (old_race(u_race(u))) { - case RC_FIREDRAGON: - return 150 * u->number; - case RC_DRAGON: - return 1000 * u->number; - case RC_WYRM: - return 5000 * u->number; - default: - return 20 * u->number; - } + const race *rc = u_race(u); + return rc->income * u->number; } static void scramble(void *data, unsigned int n, size_t width) @@ -162,21 +171,21 @@ static void expandorders(region * r, request * requests) if (norders > 0) { int i = 0; - oa = (request *)calloc(norders, sizeof(request)); + g_requests = (request *)calloc(norders, sizeof(request)); for (o = requests; o; o = o->next) { if (o->qty > 0) { unsigned int j; for (j = o->qty; j; j--) { - oa[i] = *o; - oa[i].unit->n = 0; + g_requests[i] = *o; + g_requests[i].unit->n = 0; i++; } } } - scramble(oa, norders, sizeof(request)); + scramble(g_requests, norders, sizeof(request)); } else { - oa = NULL; + g_requests = NULL; } while (requests) { request *o = requests->next; @@ -188,15 +197,6 @@ static void expandorders(region * r, request * requests) /* ------------------------------------------------------------- */ -static void change_level(unit * u, skill_t sk, int bylevel) -{ - skill *sv = unit_skill(u, sk); - assert(bylevel > 0); - if (sv == 0) - sv = add_skill(u, sk); - sk_set(sv, sv->level + bylevel); -} - typedef struct recruitment { struct recruitment *next; faction *f; @@ -244,7 +244,7 @@ static recruitment *select_recruitment(request ** rop, return recruits; } -static void add_recruits(unit * u, int number, int wanted) +void add_recruits(unit * u, int number, int wanted) { region *r = u->region; assert(number <= wanted); @@ -266,10 +266,6 @@ static void add_recruits(unit * u, int number, int wanted) strlcat(equipment, "_unit", sizeof(equipment)); equip_unit(unew, get_equipment(equipment)); - if (u_race(unew)->ec_flags & ECF_REC_HORSES) { - change_level(unew, SK_RIDING, 1); - } - if (unew != u) { transfermen(unew, u, unew->number); remove_unit(&r->units, unew); @@ -286,24 +282,6 @@ static int any_recruiters(const struct race *rc, int qty) return (int)(qty * 2 * rc->recruit_multi); } -/*static int peasant_recruiters(const struct race *rc, int qty) -{ -if (rc->ec_flags & ECF_REC_ETHEREAL) -return -1; -if (rc->ec_flags & ECF_REC_HORSES) -return -1; -return (int)(qty * 2 * rc->recruit_multi); -}*/ - -static int horse_recruiters(const struct race *rc, int qty) -{ - if (rc->ec_flags & ECF_REC_ETHEREAL) - return -1; - if (rc->ec_flags & ECF_REC_HORSES) - return (int)(qty * 2.0 * rc->recruit_multi); - return -1; -} - static int do_recruiting(recruitment * recruits, int available) { recruitment *rec; @@ -379,8 +357,8 @@ static int do_recruiting(recruitment * recruits, int available) /* unit is empty, dead, and cannot recruit */ number = 0; } + add_recruits(u, number, req->qty); if (number > 0) { - add_recruits(u, number, req->qty); dec = (int)(number * multi); if ((rc->ec_flags & ECF_REC_ETHEREAL) == 0) { recruited += dec; @@ -415,17 +393,6 @@ static void expandrecruit(region * r, request * recruitorders) int orc_total = 0; - /* centaurs: */ - recruits = select_recruitment(&recruitorders, horse_recruiters, &orc_total); - if (recruits) { - int recruited, horses = rhorses(r) * 2; - if (orc_total < horses) - horses = orc_total; - recruited = do_recruiting(recruits, horses); - rsethorses(r, (horses - recruited) / 2); - free_recruitments(recruits); - } - /* peasant limited: */ recruits = select_recruitment(&recruitorders, any_recruiters, &orc_total); if (recruits) { @@ -478,7 +445,7 @@ static void recruit(unit * u, struct order *ord, request ** recruitorders) init_order(ord); n = getint(); - if (n<=0) { + if (n <= 0) { syntax_error(u, ord); return; } @@ -509,7 +476,7 @@ static void recruit(unit * u, struct order *ord, request ** recruitorders) /* this is a very special case because the recruiting unit may be empty * at this point and we have to look at the creating unit instead. This * is done in cansee, which is called indirectly by is_guarded(). */ - if (is_guarded(r, u, GUARD_RECRUIT)) { + if (is_guarded(r, u)) { cmistake(u, ord, 70, MSG_EVENT); return; } @@ -547,13 +514,6 @@ static void recruit(unit * u, struct order *ord, request ** recruitorders) return; } - if (!(rc->ec_flags & ECF_REC_HORSES) && fval(r, RF_ORCIFIED)) { - if (rc != get_race(RC_ORC)) { - cmistake(u, ord, 238, MSG_EVENT); - return; - } - } - if (recruitcost) { pl = getplane(r); if (pl && fval(pl, PFL_NORECRUITS)) { @@ -713,7 +673,7 @@ static int maintain(building * b) { int c; region *r = b->region; - bool paid = true, work = true; + bool paid = true; unit *u; if (fval(b, BLD_MAINTAINED) || b->type == NULL || b->type->maintenance == NULL) { @@ -734,78 +694,40 @@ static int maintain(building * b) return 0; } } - for (c = 0; b->type->maintenance[c].number; ++c) { + for (c = 0; b->type->maintenance[c].number && paid; ++c) { const maintenance *m = b->type->maintenance + c; int need = m->number; if (fval(m, MTF_VARIABLE)) need = need * b->size; - if (u) { - /* first ist im ersten versuch true, im zweiten aber false! Das - * bedeutet, das in der Runde in die Region geschafften Resourcen - * nicht genutzt werden können, weil die reserviert sind! */ - need -= get_pooled(u, m->rtype, GET_DEFAULT, need); - } + need -= get_pooled(u, m->rtype, GET_DEFAULT, need); if (need > 0) { - if (!fval(m, MTF_VITAL)) - work = false; - else { - paid = false; - break; - } + paid = false; } } if (fval(b, BLD_DONTPAY)) { + ADDMSG(&r->msgs, msg_message("maintenance_nowork", "building", b)); return 0; } - u = building_owner(b); - if (!u) { + if (!paid) { + ADDMSG(&u->faction->msgs, msg_message("maintenancefail", "unit building", u, b)); + ADDMSG(&r->msgs, msg_message("maintenance_nowork", "building", b)); return 0; } for (c = 0; b->type->maintenance[c].number; ++c) { const maintenance *m = b->type->maintenance + c; - int need = m->number; + int cost = m->number; - if (fval(m, MTF_VARIABLE)) - need = need * b->size; - if (u) { - need -= get_pooled(u, m->rtype, GET_DEFAULT, need); - if (need > 0) { - work = false; - if (fval(m, MTF_VITAL)) { - paid = false; - break; - } - } + if (fval(m, MTF_VARIABLE)) { + cost = cost * b->size; } - } - if (paid && c > 0) { - if (!work) { - ADDMSG(&u->faction->msgs, msg_message("maintenancefail", "unit building", u, b)); - return 0; - } - - for (c = 0; b->type->maintenance[c].number; ++c) { - const maintenance *m = b->type->maintenance + c; - int cost = m->number; - - if (!fval(m, MTF_VITAL) && !work) - continue; - if (fval(m, MTF_VARIABLE)) - cost = cost * b->size; - - cost -= - use_pooled(u, m->rtype, GET_SLACK | GET_RESERVE | GET_POOLED_SLACK, + cost -= + use_pooled(u, m->rtype, GET_SLACK | GET_RESERVE | GET_POOLED_SLACK, cost); - assert(cost == 0); - } - if (work) { - ADDMSG(&u->faction->msgs, msg_message("maintenance", "unit building", u, b)); - return BLD_MAINTAINED; - } + assert(cost == 0); } - ADDMSG(&u->faction->msgs, msg_message("maintenancefail", "unit building", u, b)); - return 0; + ADDMSG(&u->faction->msgs, msg_message("maintenance", "unit building", u, b)); + return BLD_MAINTAINED; } void maintain_buildings(region * r) @@ -815,24 +737,11 @@ void maintain_buildings(region * r) while (*bp) { building *b = *bp; int flags = BLD_MAINTAINED; - + if (!curse_active(get_curse(b->attribs, nocost_ct))) { flags = maintain(b); } fset(b, flags); - - if (!fval(b, BLD_MAINTAINED)) { - unit *u = building_owner(b); - struct message *msg = msg_message("maintenance_nowork", "building", b); - if (u) { - add_message(&u->faction->msgs, msg); - r_addmessage(r, u->faction, msg); - } - else { - add_message(&r->msgs, msg); - } - msg_release(msg); - } bp = &b->next; } } @@ -929,12 +838,12 @@ static void manufacture(unit * u, const item_type * itype, int want) case EBUILDINGREQ: ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "building_needed", "building", - itype->construction->btype->_name)); + itype->construction->btype->_name)); return; case ELOWSKILL: ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "manufacture_skills", - "skill minskill product", sk, minskill, itype->rtype, 1)); + "skill minskill product", sk, minskill, itype->rtype, 1)); return; case ENOMATERIALS: ADDMSG(&u->faction->msgs, msg_materials_required(u, u->thisorder, @@ -973,19 +882,6 @@ typedef struct allocation_list { static allocation_list *allocations; -static bool can_guard(const unit * guard, const unit * u) -{ - if (fval(guard, UFL_ISNEW)) - return false; - if (guard->number <= 0 || !cansee(guard->faction, guard->region, u, 0)) - return false; - if (besieged(guard) || !(fval(u_race(guard), RCF_UNARMEDGUARD) - || armedmen(guard, true))) - return false; - - return !alliedunit(guard, u->faction, HELP_GUARD); -} - enum { AFL_DONE = 1 << 0, AFL_LOWSKILL = 1 << 1 @@ -1036,17 +932,6 @@ static void allocate_resource(unit * u, const resource_type * rtype, int want) } } - if (rdata->guard != 0) { - unit *u2; - for (u2 = r->units; u2; u2 = u2->next) { - if (is_guard(u2, rdata->guard) != 0 && can_guard(u2, u)) { - ADDMSG(&u->faction->msgs, - msg_feedback(u, u->thisorder, "region_guarded", "guard", u2)); - return; - } - } - } - /* Bergwächter können Abbau von Eisen/Laen durch Bewachen verhindern. * Als magische Wesen 'sehen' Bergwächter alles und werden durch * Belagerung nicht aufgehalten. (Ansonsten wie oben bei Elfen anpassen). @@ -1054,7 +939,7 @@ static void allocate_resource(unit * u, const resource_type * rtype, int want) if (itype->rtype && (itype->rtype == get_resourcetype(R_IRON) || itype->rtype == rt_find("laen"))) { unit *u2; for (u2 = r->units; u2; u2 = u2->next) { - if (is_guard(u, GUARD_MINING) + if (is_guard(u) && !fval(u2, UFL_ISNEW) && u2->number && !alliedunit(u2, u->faction, HELP_GUARD)) { ADDMSG(&u->faction->msgs, @@ -1077,8 +962,8 @@ static void allocate_resource(unit * u, const resource_type * rtype, int want) skill_t sk = itype->construction->skill; add_message(&u->faction->msgs, msg_feedback(u, u->thisorder, "manufacture_skills", - "skill minskill product", sk, itype->construction->minskill, - itype->rtype)); + "skill minskill product", sk, itype->construction->minskill, + itype->rtype)); return; } else { @@ -1276,7 +1161,7 @@ attrib_allocation(const resource_type * rtype, region * r, allocation * alist) } typedef void(*allocate_function) (const resource_type *, struct region *, -struct allocation *); + struct allocation *); static allocate_function get_allocator(const struct resource_type *rtype) { @@ -1345,7 +1230,7 @@ static void create_potion(unit * u, const potion_type * ptype, int want) case EBUILDINGREQ: ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "building_needed", "building", - ptype->itype->construction->btype->_name)); + ptype->itype->construction->btype->_name)); break; case ECOMPLETE: assert(0); @@ -1371,7 +1256,7 @@ static void create_item(unit * u, const item_type * itype, int want) { if (itype->construction && fval(itype->rtype, RTF_LIMITED)) { #if GUARD_DISABLES_PRODUCTION == 1 - if (is_guarded(u->region, u, GUARD_PRODUCE)) { + if (is_guarded(u->region, u)) { cmistake(u, u->thisorder, 70, MSG_EVENT); return; } @@ -1410,7 +1295,7 @@ int make_cmd(unit * u, struct order *ord) s = gettoken(token, sizeof(token)); if (s) { - m = atoi((const char *)s); + m = atoip(s); sprintf(ibuf, "%d", m); if (!strcmp(ibuf, (const char *)s)) { /* a quantity was given */ @@ -1590,16 +1475,16 @@ static void expandbuying(region * r, request * buyorders) for (j = 0; j != norders; j++) { int price, multi; - ltype = oa[j].type.ltype; + ltype = g_requests[j].type.ltype; trade = trades; while (trade->type != ltype) ++trade; multi = trade->multi; price = ltype->price * multi; - if (get_pooled(oa[j].unit, rsilver, GET_DEFAULT, + if (get_pooled(g_requests[j].unit, rsilver, GET_DEFAULT, price) >= price) { - unit *u = oa[j].unit; + unit *u = g_requests[j].unit; item *items; /* litems zählt die Güter, die verkauft wurden, u->n das Geld, das @@ -1613,7 +1498,7 @@ static void expandbuying(region * r, request * buyorders) items = a->data.v; i_change(&items, ltype->itype, 1); a->data.v = items; - i_change(&oa[j].unit->items, ltype->itype, 1); + i_change(&g_requests[j].unit->items, ltype->itype, 1); use_pooled(u, rsilver, GET_DEFAULT, price); if (u->n < 0) u->n = 0; @@ -1631,7 +1516,7 @@ static void expandbuying(region * r, request * buyorders) fset(u, UFL_LONGACTION | UFL_NOTMOVING); } } - free(oa); + free(g_requests); /* Ausgabe an Einheiten */ @@ -1673,11 +1558,11 @@ static void buy(unit * u, request ** buyorders, struct order *ord) keyword_t kwd; const char *s; - if (u->ship && is_guarded(r, u, GUARD_CREWS)) { + if (u->ship && is_guarded(r, u)) { cmistake(u, ord, 69, MSG_INCOME); return; } - if (u->ship && is_guarded(r, u, GUARD_CREWS)) { + if (u->ship && is_guarded(r, u)) { cmistake(u, ord, 69, MSG_INCOME); return; } @@ -1687,7 +1572,7 @@ static void buy(unit * u, request ** buyorders, struct order *ord) kwd = init_order(ord); assert(kwd == K_BUY); n = getint(); - if (n<=0) { + if (n <= 0) { cmistake(u, ord, 26, MSG_COMMERCE); return; } @@ -1709,7 +1594,11 @@ static void buy(unit * u, request ** buyorders, struct order *ord) /* ...oder in der Region muß es eine Burg geben. */ building *b = 0; if (r->buildings) { - const struct building_type *bt_castle = bt_find("castle"); + static int cache; + static const struct building_type *bt_castle; + if (bt_changed(&cache)) { + bt_castle = bt_find("castle"); + } for (b = r->buildings; b; b = b->next) { if (b->type == bt_castle && b->size >= 2) { @@ -1795,7 +1684,14 @@ static void expandselling(region * r, request * sellorders, int limit) unit *hafenowner; static int counter[MAXLUXURIES]; static int ncounter = 0; + static int bt_cache; + static const struct building_type *castle_bt, *harbour_bt, *caravan_bt; + if (bt_changed(&bt_cache)) { + castle_bt = bt_find("castle"); + harbour_bt = bt_find("harbour"); + caravan_bt = bt_find("caravan"); + } if (ncounter == 0) { const luxury_type *ltype; for (ltype = luxurytypes; ltype; ltype = ltype->next) { @@ -1810,21 +1706,20 @@ static void expandselling(region * r, request * sellorders, int limit) } /* Stelle Eigentümer der größten Burg fest. Bekommt Steuern aus jedem * Verkauf. Wenn zwei Burgen gleicher Größe bekommt gar keiner etwas. */ - for (b = rbuildings(r); b; b = b->next) { if (b->size > maxsize && building_owner(b) != NULL - && b->type == bt_find("castle")) { + && b->type == castle_bt) { maxb = b; maxsize = b->size; maxowner = building_owner(b); } - else if (b->size == maxsize && b->type == bt_find("castle")) { + else if (b->size == maxsize && b->type == castle_bt) { maxb = (building *)NULL; maxowner = (unit *)NULL; } } - hafenowner = owner_buildingtyp(r, bt_find("harbour")); + hafenowner = owner_buildingtyp(r, harbour_bt); if (maxb != (building *)NULL && maxowner != (unit *)NULL) { maxeffsize = buildingeffsize(maxb, false); @@ -1846,7 +1741,7 @@ static void expandselling(region * r, request * sellorders, int limit) return; if (r->terrain == newterrain(T_DESERT) - && buildingtype_exists(r, bt_find("caravan"), true)) { + && buildingtype_exists(r, caravan_bt, true)) { max_products = rpeasants(r) * 2 / TRADE_FRACTION; } /* Verkauf: so programmiert, dass er leicht auf mehrere Gueter pro @@ -1858,7 +1753,7 @@ static void expandselling(region * r, request * sellorders, int limit) for (j = 0; j != norders; j++) { const luxury_type *search = NULL; - const luxury_type *ltype = oa[j].type.ltype; + const luxury_type *ltype = g_requests[j].type.ltype; int multi = r_demand(r, ltype); int i; int use = 0; @@ -1875,7 +1770,7 @@ static void expandselling(region * r, request * sellorders, int limit) if (money >= price) { int abgezogenhafen = 0; int abgezogensteuer = 0; - unit *u = oa[j].unit; + unit *u = g_requests[j].unit; item *itm; attrib *a = a_find(u->attribs, &at_luxuries); if (a == NULL) @@ -1923,16 +1818,10 @@ static void expandselling(region * r, request * sellorders, int limit) } } if (use > 0) { -#ifdef NDEBUG - use_pooled(oa[j].unit, ltype->itype->rtype, GET_DEFAULT, use); -#else - /* int i = */ use_pooled(oa[j].unit, ltype->itype->rtype, GET_DEFAULT, - use); - /* assert(i==use); */ -#endif + use_pooled(g_requests[j].unit, ltype->itype->rtype, GET_DEFAULT, use); } } - free(oa); + free(g_requests); /* Steuern. Hier werden die Steuern dem Besitzer der größten Burg gegeben. */ if (maxowner) { @@ -1979,8 +1868,15 @@ static bool sell(unit * u, request ** sellorders, struct order *ord) region *r = u->region; const char *s; keyword_t kwd; + static int bt_cache; + static const struct building_type *castle_bt, *caravan_bt; - if (u->ship && is_guarded(r, u, GUARD_CREWS)) { + if (bt_changed(&bt_cache)) { + castle_bt = bt_find("castle"); + caravan_bt = bt_find("caravan"); + } + + if (u->ship && is_guarded(r, u)) { cmistake(u, ord, 69, MSG_INCOME); return false; } @@ -1995,7 +1891,7 @@ static bool sell(unit * u, request ** sellorders, struct order *ord) unlimited = false; n = rpeasants(r) / TRADE_FRACTION; if (r->terrain == newterrain(T_DESERT) - && buildingtype_exists(r, bt_find("caravan"), true)) + && buildingtype_exists(r, caravan_bt, true)) n *= 2; if (n == 0) { cmistake(u, ord, 303, MSG_COMMERCE); @@ -2003,7 +1899,7 @@ static bool sell(unit * u, request ** sellorders, struct order *ord) } } else { - n = s ? atoi(s) : 0; + n = s ? atoip(s) : 0; if (n == 0) { cmistake(u, ord, 27, MSG_COMMERCE); return false; @@ -2028,9 +1924,8 @@ static bool sell(unit * u, request ** sellorders, struct order *ord) /* ...oder in der Region muß es eine Burg geben. */ building *b = 0; if (r->buildings) { - const struct building_type *bt_castle = bt_find("castle"); for (b = r->buildings; b; b = b->next) { - if (b->type == bt_castle && b->size >= 2) break; + if (b->type == castle_bt && b->size >= 2) break; } } if (!b) { @@ -2050,7 +1945,7 @@ static bool sell(unit * u, request ** sellorders, struct order *ord) s = gettoken(token, sizeof(token)); itype = s ? finditemtype(s, u->faction->locale) : 0; ltype = itype ? resource2luxury(itype->rtype) : 0; - if (ltype == NULL) { + if (ltype == NULL || itype == NULL) { cmistake(u, ord, 126, MSG_COMMERCE); return false; } @@ -2087,7 +1982,7 @@ static bool sell(unit * u, request ** sellorders, struct order *ord) * produktion, wo für jedes produkt einzeln eine obere limite * existiert, so dass man arrays von orders machen kann. */ - /* Ein Händler kann nur 10 Güter pro Talentpunkt handeln. */ + /* Ein Händler kann nur 10 Güter pro Talentpunkt handeln. */ k = u->number * 10 * effskill(u, SK_TRADE, 0); /* hat der Händler bereits gehandelt, muss die Menge der bereits @@ -2132,8 +2027,8 @@ static void expandstealing(region * r, request * stealorders) * u ist die beklaute unit. oa.unit ist die klauende unit. */ - for (j = 0; j != norders && oa[j].unit->n <= oa[j].unit->wants; j++) { - unit *u = findunitg(oa[j].no, r); + for (j = 0; j != norders && g_requests[j].unit->n <= g_requests[j].unit->wants; j++) { + unit *u = findunitg(g_requests[j].no, r); int n = 0; if (u && u->region == r) { n = get_pooled(u, rsilver, GET_ALL, INT_MAX); @@ -2157,17 +2052,17 @@ static void expandstealing(region * r, request * stealorders) n = 10; } if (n > 0) { - n = _min(n, oa[j].unit->wants); + n = _min(n, g_requests[j].unit->wants); use_pooled(u, rsilver, GET_ALL, n); - oa[j].unit->n = n; - change_money(oa[j].unit, n); + g_requests[j].unit->n = n; + change_money(g_requests[j].unit, n); ADDMSG(&u->faction->msgs, msg_message("stealeffect", "unit region amount", u, u->region, n)); } - add_income(oa[j].unit, IC_STEAL, oa[j].unit->wants, oa[j].unit->n); - fset(oa[j].unit, UFL_LONGACTION | UFL_NOTMOVING); + add_income(g_requests[j].unit, IC_STEAL, g_requests[j].unit->wants, g_requests[j].unit->n); + fset(g_requests[j].unit, UFL_LONGACTION | UFL_NOTMOVING); } - free(oa); + free(g_requests); } /* ------------------------------------------------------------- */ @@ -2182,18 +2077,18 @@ static void plant(unit * u, int raw) if (!fval(r->terrain, LAND_REGION)) { return; } - if (rherbtype(r) == NULL) { + itype = rherbtype(r); + if (itype == NULL) { cmistake(u, u->thisorder, 108, MSG_PRODUCE); return; } /* Skill prüfen */ skill = effskill(u, SK_HERBALISM, 0); - itype = rherbtype(r); if (skill < 6) { ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "plant_skills", - "skill minskill product", SK_HERBALISM, 6, itype->rtype, 1)); + "skill minskill product", SK_HERBALISM, 6, itype->rtype, 1)); return; } /* Wasser des Lebens prüfen */ @@ -2207,7 +2102,7 @@ static void plant(unit * u, int raw) if (n == 0) { ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "resource_missing", "missing", - itype->rtype)); + itype->rtype)); return; } @@ -2223,7 +2118,7 @@ static void plant(unit * u, int raw) /* Alles ok. Abziehen. */ use_pooled(u, rt_water, GET_DEFAULT, 1); use_pooled(u, itype->rtype, GET_DEFAULT, n); - rsetherbs(r, (short) (rherbs(r) + planted)); + rsetherbs(r, (short)(rherbs(r) + planted)); ADDMSG(&u->faction->msgs, msg_message("plant", "unit region amount herb", u, r, planted, itype->rtype)); } @@ -2246,13 +2141,13 @@ static void planttrees(unit * u, int raw) if (skill < 6) { ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "plant_skills", - "skill minskill product", SK_HERBALISM, 6, rtype, 1)); + "skill minskill product", SK_HERBALISM, 6, rtype, 1)); return; } if (fval(r, RF_MALLORN) && skill < 7) { ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "plant_skills", - "skill minskill product", SK_HERBALISM, 7, rtype, 1)); + "skill minskill product", SK_HERBALISM, 7, rtype, 1)); return; } @@ -2289,7 +2184,7 @@ static void breedtrees(unit * u, int raw) int current_season; region *r = u->region; gamedate date; - + get_gamedate(turn, &date); current_season = date.season; @@ -2345,9 +2240,15 @@ static void breedhorses(unit * u) int n, c, breed = 0; const struct resource_type *rhorse = get_resourcetype(R_HORSE); int horses, effsk; + static int bt_cache; + static const struct building_type *stables_bt; + + if (bt_changed(&bt_cache)) { + stables_bt = bt_find("stables"); + } assert(rhorse && rhorse->itype); - if (!active_building(u, bt_find("stables"))) { + if (!active_building(u, stables_bt)) { cmistake(u, u->thisorder, 122, MSG_PRODUCE); return; } @@ -2390,7 +2291,7 @@ static void breed_cmd(unit * u, struct order *ord) (void)init_order(ord); s = gettoken(token, sizeof(token)); - m = s ? atoi((const char *)s) : 0; + m = s ? atoip(s) : 0; if (m != 0) { /* first came a want-paramter */ s = gettoken(token, sizeof(token)); @@ -2541,13 +2442,15 @@ static void steal_cmd(unit * u, struct order *ord, request ** stealorders) return; } id = read_unitid(u->faction, r); - if (id>0) { + if (id > 0) { u2 = findunitr(r, id); } if (u2 && u2->region == u->region) { f = u2->faction; } else { + // TODO: is this really necessary? it's the only time we use faction.c/deadhash + // it allows stealing from a unit in a dead faction, but why? f = dfindhash(id); } @@ -2688,7 +2591,7 @@ void entertain_cmd(unit * u, struct order *ord) cmistake(u, ord, 60, MSG_INCOME); return; } - if (u->ship && is_guarded(r, u, GUARD_CREWS)) { + if (u->ship && is_guarded(r, u)) { cmistake(u, ord, 69, MSG_INCOME); return; } @@ -2756,13 +2659,10 @@ expandwork(region * r, request * work_begin, request * work_end, int maxwork) jobs = rpeasants(r); } earnings = jobs * p_wage; - if (rule_blessed_harvest() == HARVEST_TAXES) { + if (r->attribs && rule_blessed_harvest() == HARVEST_TAXES) { /* E3 rules */ - static const curse_type *blessedharvest_ct; - if (!blessedharvest_ct) { - blessedharvest_ct = ct_find("blessedharvest"); - } - if (blessedharvest_ct && r->attribs) { + const curse_type *blessedharvest_ct = ct_find("blessedharvest"); + if (blessedharvest_ct) { int happy = (int)curse_geteffect(get_curse(r->attribs, blessedharvest_ct)); happy = _min(happy, jobs); @@ -2788,7 +2688,7 @@ static int do_work(unit * u, order * ord, request * o) cmistake(u, ord, 60, MSG_INCOME); return -1; } - if (u->ship && is_guarded(r, u, GUARD_CREWS)) { + if (u->ship && is_guarded(r, u)) { if (ord) cmistake(u, ord, 69, MSG_INCOME); return -1; @@ -2819,13 +2719,13 @@ static void expandloot(region * r, request * lootorders) return; for (i = 0; i != norders && startmoney > looted + TAXFRACTION * 2; i++) { - change_money(oa[i].unit, TAXFRACTION); - oa[i].unit->n += TAXFRACTION; + change_money(g_requests[i].unit, TAXFRACTION); + g_requests[i].unit->n += TAXFRACTION; /*Looting destroys double the money*/ looted += TAXFRACTION * 2; } rsetmoney(r, startmoney - looted); - free(oa); + free(g_requests); /* Lowering morale by 1 depending on the looted money (+20%) */ if (rng_int() % 100 < 20 + (looted * 80) / startmoney) { @@ -2854,11 +2754,11 @@ void expandtax(region * r, request * taxorders) return; for (i = 0; i != norders && rmoney(r) > TAXFRACTION; i++) { - change_money(oa[i].unit, TAXFRACTION); - oa[i].unit->n += TAXFRACTION; + change_money(g_requests[i].unit, TAXFRACTION); + g_requests[i].unit->n += TAXFRACTION; rsetmoney(r, rmoney(r) - TAXFRACTION); } - free(oa); + free(g_requests); for (u = r->units; u; u = u->next) { if (u->n >= 0) { @@ -2925,7 +2825,7 @@ void tax_cmd(unit * u, struct order *ord, request ** taxorders) u->wants = _min(n * effskill(u, SK_TAXING, 0) * taxperlevel, max); } - u2 = is_guarded(r, u, GUARD_TAX); + u2 = is_guarded(r, u); if (u2) { ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "region_guarded", "guard", u2)); @@ -2980,7 +2880,7 @@ void loot_cmd(unit * u, struct order *ord, request ** lootorders) return; } - u2 = is_guarded(r, u, GUARD_TAX); + u2 = is_guarded(r, u); if (u2) { ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "region_guarded", "guard", u2)); @@ -3025,7 +2925,7 @@ void auto_work(region * r) } } if (nextworker != workers) { - expandwork(r, workers, nextworker, maxworkingpeasants(r)); + expandwork(r, workers, nextworker, region_maxworkers(r)); } } @@ -3056,9 +2956,10 @@ static void peasant_taxes(region * r) maxsize = buildingeffsize(b, false); if (maxsize > 0) { double taxfactor = money * b->type->taxes(b, maxsize); - double morale = money * region_get_morale(r) * MORALE_TAX_FACTOR; - if (taxfactor > morale) + double morale = MORALE_TAX_FACTOR * money * region_get_morale(r); + if (taxfactor > morale) { taxfactor = morale; + } if (taxfactor > 0) { int taxmoney = (int)taxfactor; change_money(u, taxmoney); @@ -3085,6 +2986,19 @@ void produce(struct region *r) unit *u; bool limited = true; request *nextworker = workers; + static int bt_cache; + static const struct building_type *caravan_bt; + static int rc_cache; + static const race *rc_spell, *rc_insect, *rc_aquarian; + + if (bt_changed(&bt_cache)) { + caravan_bt = bt_find("caravan"); + } + if (rc_changed(&rc_cache)) { + rc_spell = get_race(RC_SPELL); + rc_insect = get_race(RC_INSECT); + rc_aquarian = get_race(RC_AQUARIAN); + } assert(r); /* das sind alles befehle, die 30 tage brauchen, und die in thisorder @@ -3119,10 +3033,10 @@ void produce(struct region *r) bool trader = false; keyword_t todo; - if (u_race(u) == get_race(RC_SPELL) || fval(u, UFL_LONGACTION)) + if (u_race(u) == rc_spell || fval(u, UFL_LONGACTION)) continue; - if (u_race(u) == get_race(RC_INSECT) && r_insectstalled(r) && + if (u_race(u) == rc_insect && r_insectstalled(r) && !is_cursed(u->attribs, C_KAELTESCHUTZ, 0)) continue; @@ -3159,7 +3073,7 @@ void produce(struct region *r) if (todo == NOKEYWORD) continue; - if (fval(r->terrain, SEA_REGION) && u_race(u) != get_race(RC_AQUARIAN) + if (fval(r->terrain, SEA_REGION) && u_race(u) != rc_aquarian && !(u_race(u)->flags & RCF_SWIM) && todo != K_STEAL && todo != K_SPY && todo != K_SABOTAGE) continue; @@ -3216,7 +3130,7 @@ void produce(struct region *r) if (entertaining) expandentertainment(r); if (!rule_autowork()) { - expandwork(r, workers, nextworker, maxworkingpeasants(r)); + expandwork(r, workers, nextworker, region_maxworkers(r)); } if (taxorders) expandtax(r, taxorders); @@ -3234,7 +3148,7 @@ void produce(struct region *r) if (sellorders) { int limit = rpeasants(r) / TRADE_FRACTION; if (r->terrain == newterrain(T_DESERT) - && buildingtype_exists(r, bt_find("caravan"), true)) + && buildingtype_exists(r, caravan_bt, true)) limit *= 2; expandselling(r, sellorders, limited ? limit : INT_MAX); } diff --git a/src/economy.h b/src/economy.h index b6c8002c9..5549e13cb 100644 --- a/src/economy.h +++ b/src/economy.h @@ -48,6 +48,7 @@ extern "C" { struct request; int income(const struct unit *u); + int entertainmoney(const struct region *r); void economics(struct region *r); void produce(struct region *r); @@ -61,7 +62,7 @@ extern "C" { void give_control(struct unit * u, struct unit * u2); void tax_cmd(struct unit * u, struct order *ord, struct request ** taxorders); void expandtax(struct region * r, struct request * taxorders); - + void add_recruits(struct unit * u, int number, int wanted); struct message * check_steal(const struct unit * u, struct order *ord); #ifdef __cplusplus diff --git a/src/economy.test.c b/src/economy.test.c index ce09aae43..3c4a5f257 100644 --- a/src/economy.test.c +++ b/src/economy.test.c @@ -241,11 +241,15 @@ static void test_tax_cmd(CuTest *tc) { test_cleanup(); } +/** + * see https://bugs.eressea.de/view.php?id=2234 + */ static void test_maintain_buildings(CuTest *tc) { region *r; building *b; building_type *btype; unit *u; + faction *f; maintenance *req; item_type *itype; @@ -253,7 +257,8 @@ static void test_maintain_buildings(CuTest *tc) { btype = test_create_buildingtype("Hort"); btype->maxsize = 10; r = test_create_region(0, 0, 0); - u = test_create_unit(test_create_faction(0), r); + f = test_create_faction(0); + u = test_create_unit(f, r); b = test_create_building(r, btype); itype = test_create_itemtype("money"); b->size = btype->maxsize; @@ -263,6 +268,8 @@ static void test_maintain_buildings(CuTest *tc) { b->flags = 0; maintain_buildings(r); CuAssertIntEquals(tc, BLD_MAINTAINED, fval(b, BLD_MAINTAINED)); + CuAssertPtrEquals(tc, 0, f->msgs); + CuAssertPtrEquals(tc, 0, r->msgs); req = calloc(2, sizeof(maintenance)); req[0].number = 100; @@ -273,28 +280,73 @@ static void test_maintain_buildings(CuTest *tc) { b->flags = 0; maintain_buildings(r); CuAssertIntEquals(tc, 0, fval(b, BLD_MAINTAINED)); - + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "maintenancefail")); + CuAssertPtrNotNull(tc, test_find_messagetype(r->msgs, "maintenance_nowork")); + test_clear_messagelist(&f->msgs); + test_clear_messagelist(&r->msgs); + // we can afford to pay: i_change(&u->items, itype, 100); b->flags = 0; maintain_buildings(r); CuAssertIntEquals(tc, BLD_MAINTAINED, fval(b, BLD_MAINTAINED)); CuAssertIntEquals(tc, 0, i_get(u->items, itype)); + CuAssertPtrEquals(tc, 0, r->msgs); + CuAssertPtrEquals(tc, 0, test_find_messagetype(f->msgs, "maintenance_nowork")); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "maintenance")); + test_clear_messagelist(&f->msgs); // this building has no owner, it doesn't work: u_set_building(u, NULL); b->flags = 0; maintain_buildings(r); CuAssertIntEquals(tc, 0, fval(b, BLD_MAINTAINED)); + CuAssertPtrEquals(tc, 0, f->msgs); + CuAssertPtrNotNull(tc, test_find_messagetype(r->msgs, "maintenance_noowner")); + test_clear_messagelist(&r->msgs); test_cleanup(); } +static void test_recruit(CuTest *tc) { + unit *u; + faction *f; + + test_setup(); + f = test_create_faction(0); + u = test_create_unit(f, test_create_region(0, 0, 0)); + CuAssertIntEquals(tc, 1, u->number); + add_recruits(u, 1, 1); + CuAssertIntEquals(tc, 2, u->number); + CuAssertPtrEquals(tc, u, f->units); + CuAssertPtrEquals(tc, NULL, u->nextF); + CuAssertPtrEquals(tc, NULL, u->prevF); + CuAssertPtrEquals(tc, NULL, test_find_messagetype(f->msgs, "recruit")); + add_recruits(u, 1, 2); + CuAssertIntEquals(tc, 3, u->number); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "recruit")); + test_cleanup(); +} + +static void test_income(CuTest *tc) +{ + race *rc; + unit *u; + test_setup(); + rc = test_create_race("nerd"); + u = test_create_unit(test_create_faction(rc), test_create_region(0, 0, 0)); + CuAssertIntEquals(tc, 20, income(u)); + u->number = 5; + CuAssertIntEquals(tc, 100, income(u)); + test_cleanup(); +} + CuSuite *get_economy_suite(void) { CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_give_control_building); SUITE_ADD_TEST(suite, test_give_control_ship); + SUITE_ADD_TEST(suite, test_income); SUITE_ADD_TEST(suite, test_steal_okay); SUITE_ADD_TEST(suite, test_steal_ocean); SUITE_ADD_TEST(suite, test_steal_nosteal); @@ -302,5 +354,6 @@ CuSuite *get_economy_suite(void) SUITE_ADD_TEST(suite, test_heroes_dont_recruit); SUITE_ADD_TEST(suite, test_tax_cmd); SUITE_ADD_TEST(suite, test_maintain_buildings); + SUITE_ADD_TEST(suite, test_recruit); return suite; } diff --git a/src/eressea.c b/src/eressea.c index 18c98cad6..dead153cb 100755 --- a/src/eressea.c +++ b/src/eressea.c @@ -14,23 +14,27 @@ #include #include #include -#include -#include -#include #include +#include +#include +#include +#include #include #include #include #include +#include #include + +#include "calendar.h" #include "chaos.h" -#include "report.h" #include "items.h" #include "creport.h" -#include "jsreport.h" +#include "report.h" #include "names.h" -#include "wormhole.h" +#include "reports.h" #include "spells.h" +#include "wormhole.h" void game_done(void) { @@ -46,12 +50,11 @@ void game_done(void) #ifdef REPORT_FORMAT_NR report_cleanup(); #endif - calendar_cleanup(); #endif + calendar_cleanup(); free_functions(); free_config(); free_locales(); - curses_done(); kernel_done(); } @@ -63,7 +66,6 @@ void game_init(void) register_nr(); register_cr(); - register_jsreport(); register_races(); register_spells(); diff --git a/src/game.pkg b/src/game.pkg index 88b3bda9a..dc2b324e4 100644 --- a/src/game.pkg +++ b/src/game.pkg @@ -1,6 +1,5 @@ $#undef tolua_reg_types $#define tolua_reg_types tolua_reg_types_game -$#include "config.h" $#include "bind_eressea.h" module eressea { diff --git a/src/game.pkg.c b/src/game.pkg.c index abd7832ca..30671021d 100644 --- a/src/game.pkg.c +++ b/src/game.pkg.c @@ -20,7 +20,6 @@ LUALIB_API int luaopen_game (lua_State* tolua_S); #undef tolua_reg_types #define tolua_reg_types tolua_reg_types_game -#include "config.h" #include "bind_eressea.h" /* function to register type */ diff --git a/src/give.c b/src/give.c index 80f4a1ab5..524a27017 100644 --- a/src/give.c +++ b/src/give.c @@ -1,4 +1,4 @@ -/* +/* +-------------------+ Christian Schlittchen | | Enno Rehling | Eressea PBEM host | Katja Zedel @@ -34,7 +34,6 @@ /* attributes includes */ #include -#include /* util includes */ #include @@ -138,7 +137,7 @@ int give_quota(const unit * src, const unit * dst, const item_type * type, } if (dst && src && src->faction != dst->faction) { divisor = config_get_flt("rules.items.give_divisor", 1); - assert(divisor == 0 || divisor >= 1); + assert(divisor <= 0 || divisor >= 1); if (divisor >= 1) { /* predictable > correct: */ int x = (int)(n / divisor); @@ -224,15 +223,11 @@ static bool unit_has_cursed_item(const unit * u) return false; } -static bool can_give_men(const unit *u, order *ord, message **msg) { - if (u_race(u) == get_race(RC_SNOTLING)) { - /* snotlings may not be given to the peasants. */ - if (msg) *msg = msg_error(u, ord, 307); - } - else if (unit_has_cursed_item(u)) { +static bool can_give_men(const unit *u, const unit *dst, order *ord, message **msg) { + if (unit_has_cursed_item(u)) { if (msg) *msg = msg_error(u, ord, 78); } - else if (has_skill(u, SK_MAGIC)) { + else if (dst && (has_skill(u, SK_MAGIC) && dst->number > 0)) { /* cannot give units to and from magicians */ if (msg) *msg = msg_error(u, ord, 158); } @@ -263,9 +258,9 @@ message * give_men(int n, unit * u, unit * u2, struct order *ord) message * msg; int maxt = max_transfers(); - assert(u2); + assert(u2); // use disband_men for GIVE 0 - if (!can_give_men(u, ord, &msg)) { + if (!can_give_men(u, u2, ord, &msg)) { return msg; } @@ -400,20 +395,21 @@ message * give_men(int n, unit * u, unit * u2, struct order *ord) message * disband_men(int n, unit * u, struct order *ord) { message * msg; + static const race *rc_snotling; + static int rccache; - if (!can_give_men(u, ord, &msg)) { + if (rc_changed(&rccache)) { + rc_snotling = get_race(RC_SNOTLING); + } + + if (u_race(u) == rc_snotling) { + /* snotlings may not be given to the peasants. */ + return msg_error(u, ord, 307); + } + if (!can_give_men(u, NULL, ord, &msg)) { return msg; } transfermen(u, NULL, n); -#ifdef ORCIFICATION - if (u_race(u) == get_race(RC_SNOTLING) && !fval(u->region, RF_ORCIFIED)) { - attrib *a = a_find(u->region->attribs, &at_orcification); - if (!a) { - a = a_add(&u->region->attribs, a_new(&at_orcification)); - } - a->data.i += n; - } -#endif if (fval(u->region->terrain, SEA_REGION)) { return msg_message("give_person_ocean", "unit amount", u, n); } @@ -604,16 +600,19 @@ void give_cmd(unit * u, order * ord) } if (u2 && u_race(u2) == get_race(RC_SPELL)) { - ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", - "")); + ADDMSG(&u->faction->msgs, msg_feedback(u, ord, + "feedback_unit_not_found", "")); return; } - else if (u2 && !alliedunit(u2, u->faction, HELP_GIVE) && !ucontact(u2, u)) { cmistake(u, ord, 40, MSG_COMMERCE); return; } - + else if (p == NOPARAM) { + /* the most likely case: giving items to someone. + * let's catch this and save ourselves the rest of the param_t checks. + */ + } else if (p == P_HERBS) { bool given = false; if ((u_race(u)->ec_flags & ECF_KEEP_ITEM) && u2 != NULL) { @@ -782,7 +781,7 @@ void give_cmd(unit * u, order * ord) } if (u2 != NULL) { - if ((u_race(u)->ec_flags & ECF_KEEP_ITEM) && u2 != NULL) { + if ((u_race(u)->ec_flags & ECF_KEEP_ITEM)) { ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "race_nogive", "race", u_race(u))); return; diff --git a/src/give.test.c b/src/give.test.c index e65c2861c..f2b0d60a9 100644 --- a/src/give.test.c +++ b/src/give.test.c @@ -23,6 +23,7 @@ #include struct give { + struct locale * lang; struct unit *src, *dst; struct region *r; struct faction *f1, *f2; @@ -46,11 +47,16 @@ static void setup_give(struct give *env) { ally * al = ally_add(&env->f2->allies, env->f1); al->status = HELP_GIVE; } + if (env->lang) { + locale_setstring(env->lang, env->itype->rtype->_name, "SILBER"); + init_locale(env->lang); + env->f1->locale = env->lang; + } } static void test_give_unit_to_peasants(CuTest * tc) { - struct give env; - test_cleanup(); + struct give env = { 0 }; + test_setup_ex(tc); env.f1 = test_create_faction(0); env.f2 = 0; setup_give(&env); @@ -62,8 +68,8 @@ static void test_give_unit_to_peasants(CuTest * tc) { } static void test_give_unit(CuTest * tc) { - struct give env; - test_cleanup(); + struct give env = { 0 }; + test_setup_ex(tc); env.f1 = test_create_faction(0); env.f2 = test_create_faction(0); setup_give(&env); @@ -81,8 +87,8 @@ static void test_give_unit(CuTest * tc) { } static void test_give_unit_in_ocean(CuTest * tc) { - struct give env; - test_cleanup(); + struct give env = { 0 }; + test_setup_ex(tc); env.f1 = test_create_faction(0); env.f2 = 0; setup_give(&env); @@ -93,8 +99,8 @@ static void test_give_unit_in_ocean(CuTest * tc) { } static void test_give_men(CuTest * tc) { - struct give env; - test_cleanup(); + struct give env = { 0 }; + test_setup_ex(tc); env.f2 = env.f1 = test_create_faction(0); setup_give(&env); CuAssertPtrEquals(tc, 0, give_men(1, env.src, env.dst, NULL)); @@ -103,10 +109,41 @@ static void test_give_men(CuTest * tc) { test_cleanup(); } -static void test_give_men_limit(CuTest * tc) { - struct give env; - message *msg; +static void test_give_men_magicians(CuTest * tc) { + struct give env = { 0 }; + int p; + message * msg; + + test_setup_ex(tc); + env.f2 = env.f1 = test_create_faction(0); + setup_give(&env); + set_level(env.src, SK_MAGIC, 1); + CuAssertPtrNotNull(tc, msg = give_men(1, env.src, env.dst, NULL)); + CuAssertStrEquals(tc, "error158", (const char *)msg->parameters[3].v); + CuAssertIntEquals(tc, 1, env.dst->number); + CuAssertIntEquals(tc, 1, env.src->number); + msg_release(msg); + + + set_number(env.dst, 0); + CuAssertPtrEquals(tc, NULL, give_men(1, env.src, env.dst, NULL)); + CuAssertIntEquals(tc, 1, env.dst->number); + CuAssertIntEquals(tc, 0, env.src->number); + + p = rpeasants(env.r); + CuAssertPtrNotNull(tc, msg = disband_men(1, env.dst, NULL)); + CuAssertStrEquals(tc, "give_person_peasants", (const char *)msg->parameters[0].v); + CuAssertIntEquals(tc, 0, env.dst->number); + CuAssertIntEquals(tc, p+1, rpeasants(env.r)); + msg_release(msg); + test_cleanup(); +} + +static void test_give_men_limit(CuTest * tc) { + struct give env = { 0 }; + message *msg; + test_setup_ex(tc); env.f2 = test_create_faction(0); env.f1 = test_create_faction(0); setup_give(&env); @@ -134,10 +171,10 @@ static void test_give_men_limit(CuTest * tc) { } static void test_give_men_in_ocean(CuTest * tc) { - struct give env; + struct give env = { 0 }; message * msg; - test_cleanup(); + test_setup_ex(tc); env.f1 = test_create_faction(0); env.f2 = 0; setup_give(&env); @@ -150,8 +187,8 @@ static void test_give_men_in_ocean(CuTest * tc) { } static void test_give_men_too_many(CuTest * tc) { - struct give env; - test_cleanup(); + struct give env = { 0 }; + test_setup_ex(tc); env.f2 = env.f1 = test_create_faction(0); setup_give(&env); CuAssertPtrEquals(tc, 0, give_men(2, env.src, env.dst, NULL)); @@ -161,10 +198,10 @@ static void test_give_men_too_many(CuTest * tc) { } static void test_give_men_none(CuTest * tc) { - struct give env; + struct give env = { 0 }; message * msg; - test_cleanup(); + test_setup_ex(tc); env.f2 = env.f1 = test_create_faction(0); setup_give(&env); msg = give_men(0, env.src, env.dst, NULL); @@ -176,10 +213,10 @@ static void test_give_men_none(CuTest * tc) { } static void test_give_men_other_faction(CuTest * tc) { - struct give env; + struct give env = { 0 }; message * msg; - test_cleanup(); + test_setup_ex(tc); env.f1 = test_create_faction(0); env.f2 = test_create_faction(0); setup_give(&env); @@ -193,12 +230,12 @@ static void test_give_men_other_faction(CuTest * tc) { } static void test_give_men_requires_contact(CuTest * tc) { - struct give env; + struct give env = { 0 }; message * msg; order *ord; char cmd[32]; - test_cleanup(); + test_setup_ex(tc); env.f1 = test_create_faction(0); env.f2 = test_create_faction(0); setup_give(&env); @@ -220,9 +257,9 @@ static void test_give_men_requires_contact(CuTest * tc) { } static void test_give_men_not_to_self(CuTest * tc) { - struct give env; + struct give env = { 0 }; message * msg; - test_cleanup(); + test_setup_ex(tc); env.f2 = env.f1 = test_create_faction(0); setup_give(&env); msg = give_men(1, env.src, env.src, NULL); @@ -233,10 +270,10 @@ static void test_give_men_not_to_self(CuTest * tc) { } static void test_give_peasants(CuTest * tc) { - struct give env; + struct give env = { 0 }; message * msg; - test_cleanup(); + test_setup_ex(tc); env.f1 = test_create_faction(0); env.f2 = 0; setup_give(&env); @@ -250,9 +287,9 @@ static void test_give_peasants(CuTest * tc) { } static void test_give(CuTest * tc) { - struct give env; + struct give env = { 0 }; - test_cleanup(); + test_setup_ex(tc); env.f2 = env.f1 = test_create_faction(0); setup_give(&env); @@ -267,12 +304,35 @@ static void test_give(CuTest * tc) { test_cleanup(); } -static void test_give_herbs(CuTest * tc) { - struct give env; +static void test_give_cmd(CuTest * tc) { + struct give env = { 0 }; struct order *ord; char cmd[32]; + test_setup_ex(tc); + env.lang = test_create_locale(); + env.f2 = env.f1 = test_create_faction(0); + setup_give(&env); + + i_change(&env.src->items, env.itype, 10); + + _snprintf(cmd, sizeof(cmd), "%s 5 %s", itoa36(env.dst->no), LOC(env.f1->locale, env.itype->rtype->_name)); + ord = create_order(K_GIVE, env.f1->locale, cmd); + assert(ord); + give_cmd(env.src, ord); + CuAssertIntEquals(tc, 5, i_get(env.src->items, env.itype)); + CuAssertIntEquals(tc, 5, i_get(env.dst->items, env.itype)); + + free_order(ord); test_cleanup(); +} + +static void test_give_herbs(CuTest * tc) { + struct give env = { 0 }; + struct order *ord; + char cmd[32]; + + test_setup_ex(tc); test_create_world(); env.f2 = env.f1 = test_create_faction(0); setup_give(&env); @@ -290,9 +350,9 @@ static void test_give_herbs(CuTest * tc) { } static void test_give_okay(CuTest * tc) { - struct give env; + struct give env = { 0 }; - test_cleanup(); + test_setup_ex(tc); env.f2 = env.f1 = test_create_faction(0); setup_give(&env); @@ -302,10 +362,10 @@ static void test_give_okay(CuTest * tc) { } static void test_give_denied_by_rules(CuTest * tc) { - struct give env; + struct give env = { 0 }; struct message *msg; - test_cleanup(); + test_setup_ex(tc); env.f1 = test_create_faction(0); env.f2 = test_create_faction(0); setup_give(&env); @@ -317,10 +377,10 @@ static void test_give_denied_by_rules(CuTest * tc) { } static void test_give_dead_unit(CuTest * tc) { - struct give env; + struct give env = { 0 }; struct message *msg; - test_cleanup(); + test_setup_ex(tc); env.f1 = test_create_faction(0); env.f2 = test_create_faction(0); setup_give(&env); @@ -332,9 +392,9 @@ static void test_give_dead_unit(CuTest * tc) { } static void test_give_new_unit(CuTest * tc) { - struct give env; + struct give env = { 0 }; - test_cleanup(); + test_setup_ex(tc); env.f1 = test_create_faction(0); env.f2 = test_create_faction(0); setup_give(&env); @@ -346,10 +406,10 @@ static void test_give_new_unit(CuTest * tc) { static void test_give_invalid_target(CuTest *tc) { // bug https://bugs.eressea.de/view.php?id=1685 - struct give env; + struct give env = { 0 }; order *ord; - test_cleanup(); + test_setup_ex(tc); env.f1 = test_create_faction(0); env.f2 = 0; setup_give(&env); @@ -369,7 +429,9 @@ CuSuite *get_give_suite(void) { CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_give); + SUITE_ADD_TEST(suite, test_give_cmd); SUITE_ADD_TEST(suite, test_give_men); + SUITE_ADD_TEST(suite, test_give_men_magicians); SUITE_ADD_TEST(suite, test_give_men_limit); SUITE_ADD_TEST(suite, test_give_men_in_ocean); SUITE_ADD_TEST(suite, test_give_men_none); diff --git a/src/gmtool.c b/src/gmtool.c index 9533ccab8..7aab2fea7 100644 --- a/src/gmtool.c +++ b/src/gmtool.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include @@ -185,7 +184,7 @@ map_region *mr_get(const view * vi, int xofs, int yofs) static point *coor2point(const coordinate * c, point * p) { assert(c && p); - p->x = c->x * TWIDTH + c->y * TWIDTH / 2; + p->x = c->x * TWIDTH + c->y * TWIDTH / 2; //-V537 p->y = c->y * THEIGHT; return p; } @@ -263,7 +262,7 @@ static chtype mr_tile(const map_region * mr, int highlight) const region *r = mr->r; switch (r->terrain->_name[0]) { case 'o': - return '.' | COLOR_PAIR(hl + COLOR_CYAN) | A_BOLD; + return '.' | COLOR_PAIR(hl + COLOR_CYAN) | A_BOLD; //-V525 case 'd': return 'D' | COLOR_PAIR(hl + COLOR_YELLOW) | A_BOLD; case 't': @@ -824,8 +823,7 @@ void loaddata(state *st) { askstring(st->wnd_status->handle, "save as:", datafile, sizeof(datafile)); if (strlen(datafile) > 0) { - create_backup(datafile); - readgame(datafile, false); + readgame(datafile); st->modified = 0; } } @@ -835,7 +833,6 @@ void savedata(state *st) { askstring(st->wnd_status->handle, "save as:", datafile, sizeof(datafile)); if (strlen(datafile) > 0) { - create_backup(datafile); remove_empty_units(); writegame(datafile); st->modified = 0; @@ -1170,7 +1167,7 @@ static void handlekey(state * st, int c) region *first = (mr && mr->r && mr->r->next) ? mr->r->next : regions; if (findmode == 'f') { - sprintf(sbuffer, "find-faction: %s", locate); + snprintf(sbuffer, sizeof(sbuffer), "find-faction: %s", locate); statusline(st->wnd_status->handle, sbuffer); f = findfaction(atoi36(locate)); if (f == NULL) { diff --git a/src/guard.c b/src/guard.c index f779e7e2e..ee26e467b 100644 --- a/src/guard.c +++ b/src/guard.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 1998-2015, Enno Rehling Katja Zedel #include #include "guard.h" +#include "laws.h" +#include "monster.h" -#include +#include #include #include #include #include #include -#include #include -attrib_type at_guard = { - "guard", - DEFAULT_INIT, - DEFAULT_FINALIZE, - DEFAULT_AGE, - a_writeint, - a_readint, - NULL, - ATF_UNIQUE -}; +guard_t can_start_guarding(const unit * u) +{ + if (u->status >= ST_FLEE || fval(u, UFL_FLEEING)) + return E_GUARD_FLEEING; + /* Monster der Monsterpartei duerfen immer bewachen */ + if (is_monsters(u->faction) || fval(u_race(u), RCF_UNARMEDGUARD)) + return E_GUARD_OK; + if (!armedmen(u, true)) + return E_GUARD_UNARMED; + if (IsImmune(u->faction)) + return E_GUARD_NEWBIE; + return E_GUARD_OK; +} void update_guards(void) { @@ -51,91 +55,102 @@ void update_guards(void) for (u = r->units; u; u = u->next) { if (fval(u, UFL_GUARD)) { if (can_start_guarding(u) != E_GUARD_OK) { - setguard(u, GUARD_NONE); - } - else { - attrib *a = a_find(u->attribs, &at_guard); - if (a && a->data.i == (int)guard_flags(u)) { - /* this is really rather not necessary */ - a_remove(&u->attribs, a); - } + setguard(u, false); } } } } } -unsigned int guard_flags(const unit * u) +void setguard(unit * u, bool enabled) { - unsigned int flags = - GUARD_CREWS | GUARD_LANDING | GUARD_TRAVELTHRU | GUARD_TAX; -#if GUARD_DISABLES_PRODUCTION == 1 - flags |= GUARD_PRODUCE; -#endif -#if GUARD_DISABLES_RECRUIT == 1 - flags |= GUARD_RECRUIT; -#endif - switch (old_race(u_race(u))) { - case RC_ELF: - if (u->faction->race != u_race(u)) - break; - /* else fallthrough */ - case RC_TREEMAN: - flags |= GUARD_TREES; - break; - case RC_IRONKEEPER: - flags = GUARD_MINING; - break; - default: - /* TODO: This should be configuration variables, all of it */ - break; - } - return flags; -} - -void setguard(unit * u, unsigned int flags) -{ - /* setzt die guard-flags der Einheit */ - attrib *a = NULL; - assert(flags == 0 || !fval(u, UFL_MOVED)); - assert(flags == 0 || u->status < ST_FLEE); - if (fval(u, UFL_GUARD)) { - a = a_find(u->attribs, &at_guard); - } - if (flags == GUARD_NONE) { + if (!enabled) { freset(u, UFL_GUARD); - if (a) - a_remove(&u->attribs, a); - return; - } - fset(u, UFL_GUARD); - fset(u->region, RF_GUARDED); - if (flags == guard_flags(u)) { - if (a) - a_remove(&u->attribs, a); - } - else { - if (!a) - a = a_add(&u->attribs, a_new(&at_guard)); - a->data.i = (int)flags; + } else { + assert(!fval(u, UFL_MOVED)); + assert(u->status < ST_FLEE); + fset(u, UFL_GUARD); + fset(u->region, RF_GUARDED); } } -unsigned int getguard(const unit * u) +void guard(unit * u) { - attrib *a; - - assert(fval(u, UFL_GUARD) || (u->building && u == building_owner(u->building)) - || !"you're doing it wrong! check is_guard first"); - a = a_find(u->attribs, &at_guard); - if (a) { - return (unsigned int)a->data.i; - } - return guard_flags(u); + setguard(u, true); } -void guard(unit * u, unsigned int mask) +static bool is_guardian_u(const unit * guard, unit * u) { - unsigned int flags = guard_flags(u); - setguard(u, flags & mask); + if (guard->faction == u->faction) + return false; + if (is_guard(guard) == 0) + return false; + if (alliedunit(guard, u->faction, HELP_GUARD)) + return false; + if (ucontact(guard, u)) + return false; + if (!cansee(guard->faction, u->region, u, 0)) + return false; + if (!(u_race(guard)->flags & RCF_FLY) && u_race(u)->flags & RCF_FLY) + return false; + + return true; +} + +static bool is_guardian_r(const unit * guard) +{ + if (guard->number == 0) + return false; + if (besieged(guard)) + return false; + + /* if region_owners exist then they may be guardians: */ + if (guard->building && rule_region_owners() && guard == building_owner(guard->building)) { + faction *owner = region_get_owner(guard->region); + if (owner == guard->faction) { + building *bowner = largestbuilding(guard->region, &cmp_taxes, false); + if (bowner == guard->building) { + return true; + } + } + } + + if ((guard->flags & UFL_GUARD) == 0) + return false; + return fval(u_race(guard), RCF_UNARMEDGUARD) || is_monsters(guard->faction) || (armedmen(guard, true) > 0); +} + +bool is_guard(const struct unit * u) +{ + return is_guardian_r(u); +} + +unit *is_guarded(region * r, unit * u) +{ + unit *u2; + int noguards = 1; + + if (!fval(r, RF_GUARDED)) { + return NULL; + } + + /* at this point, u2 is the last unit we tested to + * be a guard (and failed), or NULL + * i is the position of the first free slot in the cache */ + + for (u2 = r->units; u2; u2 = u2->next) { + if (is_guardian_r(u2)) { + noguards = 0; + if (is_guardian_u(u2, u)) { + /* u2 is our guard. stop processing (we might have to go further next time) */ + return u2; + } + } + } + + if (noguards) { + /* you are mistaken, sir. there are no guards in these lands */ + freset(r, RF_GUARDED); + } + return NULL; } diff --git a/src/guard.h b/src/guard.h index 564be61a2..4fb6cbf56 100644 --- a/src/guard.h +++ b/src/guard.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #ifndef H_GUARD #define H_GUARD @@ -7,18 +7,17 @@ extern "C" { #endif struct unit; - + struct region; + typedef enum { E_GUARD_OK, E_GUARD_UNARMED, E_GUARD_NEWBIE, E_GUARD_FLEEING } guard_t; - extern struct attrib_type at_guard; - guard_t can_start_guarding(const struct unit * u); void update_guards(void); - unsigned int guard_flags(const struct unit * u); - unsigned int getguard(const struct unit * u); - void setguard(struct unit * u, unsigned int flags); + void setguard(struct unit * u, bool enabled); + void guard(struct unit *u); - void guard(struct unit * u, unsigned int mask); + struct unit *is_guarded(struct region *r, struct unit *u); + bool is_guard(const struct unit *u); #ifdef __cplusplus } diff --git a/src/guard.test.c b/src/guard.test.c new file mode 100644 index 000000000..60e5453c6 --- /dev/null +++ b/src/guard.test.c @@ -0,0 +1,141 @@ +#include + +#include "guard.h" +#include "laws.h" +#include "monster.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include "tests.h" + +static void test_is_guarded(CuTest *tc) { + unit *u1, *u2; + region *r; + race *rc; + + test_cleanup(); + rc = rc_get_or_create("dragon"); + rc->flags |= RCF_UNARMEDGUARD; + r = test_create_region(0, 0, 0); + u1 = test_create_unit(test_create_faction(0), r); + u2 = test_create_unit(test_create_faction(rc), r); + CuAssertPtrEquals(tc, 0, is_guarded(r, u1)); + setguard(u2, true); + CuAssertPtrEquals(tc, u2, is_guarded(r, u1)); + test_cleanup(); +} + +static void test_guard_unskilled(CuTest * tc) +// TODO: it would be better to test armedmen() +{ + unit *u, *ug; + region *r; + item_type *itype; + + test_setup(); + itype = it_get_or_create(rt_get_or_create("sword")); + new_weapontype(itype, 0, 0.0, NULL, 0, 0, 0, SK_MELEE, 2); + r = test_create_region(0, 0, 0); + u = test_create_unit(test_create_faction(0), r); + ug = test_create_unit(test_create_faction(0), r); + i_change(&ug->items, itype, 1); + set_level(ug, SK_MELEE, 1); + setguard(ug, true); + CuAssertPtrEquals(tc, 0, is_guarded(r, u)); + test_cleanup(); +} + +static void test_guard_armed(CuTest * tc) +{ + unit *u, *ug; + region *r; + item_type *itype; + + test_setup(); + itype = it_get_or_create(rt_get_or_create("sword")); + new_weapontype(itype, 0, 0.0, NULL, 0, 0, 0, SK_MELEE, 2); + r = test_create_region(0, 0, 0); + u = test_create_unit(test_create_faction(0), r); + ug = test_create_unit(test_create_faction(0), r); + i_change(&ug->items, itype, 1); + set_level(ug, SK_MELEE, 2); + setguard(ug, true); + CuAssertPtrEquals(tc, ug, is_guarded(r, u)); + test_cleanup(); +} + +static void test_is_guard(CuTest * tc) +{ + unit *ug; + region *r; + item_type *itype; + + test_setup(); + itype = it_get_or_create(rt_get_or_create("sword")); + new_weapontype(itype, 0, 0.0, NULL, 0, 0, 0, SK_MELEE, 2); + r = test_create_region(0, 0, 0); + ug = test_create_unit(test_create_faction(0), r); + i_change(&ug->items, itype, 1); + set_level(ug, SK_MELEE, 2); + setguard(ug, true); + CuAssertIntEquals(tc, 1, armedmen(ug, false)); + CuAssertTrue(tc, is_guard(ug)); + set_level(ug, SK_MELEE, 1); + CuAssertIntEquals(tc, 0, armedmen(ug, false)); + CuAssertTrue(tc, !is_guard(ug)); + set_level(ug, SK_MELEE, 2); + CuAssertIntEquals(tc, 1, armedmen(ug, false)); + CuAssertTrue(tc, is_guard(ug)); + test_cleanup(); +} + +static void test_guard_unarmed(CuTest * tc) +{ + unit *u, *ug; + region *r; + race *rc; + + test_setup(); + rc = test_create_race("mountainguard"); + rc->flags |= RCF_UNARMEDGUARD; + r = test_create_region(0, 0, 0); + u = test_create_unit(test_create_faction(0), r); + ug = test_create_unit(test_create_faction(rc), r); + setguard(ug, true); + CuAssertPtrEquals(tc, ug, is_guarded(r, u)); + test_cleanup(); +} + +static void test_guard_monsters(CuTest * tc) +{ + unit *u, *ug; + region *r; + + test_setup(); + r = test_create_region(0, 0, 0); + u = test_create_unit(test_create_faction(0), r); + ug = test_create_unit(get_monsters(), r); + setguard(ug, true); + CuAssertPtrEquals(tc, ug, is_guarded(r, u)); + test_cleanup(); +} + +CuSuite *get_guard_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_is_guarded); + SUITE_ADD_TEST(suite, test_is_guard); + SUITE_ADD_TEST(suite, test_guard_unskilled); + SUITE_ADD_TEST(suite, test_guard_armed); + SUITE_ADD_TEST(suite, test_guard_unarmed); + SUITE_ADD_TEST(suite, test_guard_monsters); + return suite; +} diff --git a/src/helpers.c b/src/helpers.c index 3d08f1c08..aa9bc12eb 100644 --- a/src/helpers.c +++ b/src/helpers.c @@ -31,7 +31,6 @@ without prior permission by the authors of Eressea. #include #include #include -#include #include diff --git a/src/items.c b/src/items.c index 5e9a357e6..6fbf957b3 100644 --- a/src/items.c +++ b/src/items.c @@ -1,8 +1,8 @@ #include -#include #include "items.h" #include "study.h" +#include "economy.h" #include "move.h" #include "magic.h" @@ -114,10 +114,9 @@ struct order *ord) const resource_type *rt_crystal = NULL; int i; - if (rt_crystal == NULL) { - rt_crystal = rt_find("antimagic"); - assert(rt_crystal != NULL); - } + rt_crystal = rt_find("antimagic"); + assert(rt_crystal != NULL); + for (i = 0; i != amount; ++i) { int effect, duration = 2; double force; @@ -138,7 +137,7 @@ struct order *ord) while (*ap && force > 0) { curse *c; attrib *a = *ap; - if (!fval(a->type, ATF_CURSE)) { + if (!(a->type->flags & ATF_CURSE)) { do { ap = &(*ap)->next; } while (*ap && a->type == (*ap)->type); diff --git a/src/items/CMakeLists.txt b/src/items/CMakeLists.txt index 9ab324e77..0a2c581b4 100644 --- a/src/items/CMakeLists.txt +++ b/src/items/CMakeLists.txt @@ -8,7 +8,6 @@ SET(_FILES artrewards.c demonseye.c itemtypes.c -phoenixcompass.c seed.c speedsail.c weapons.c diff --git a/src/items/artrewards.c b/src/items/artrewards.c index 8b6288f61..602841d23 100644 --- a/src/items/artrewards.c +++ b/src/items/artrewards.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "artrewards.h" /* kernel includes */ @@ -26,7 +25,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include #include #include diff --git a/src/items/demonseye.c b/src/items/demonseye.c index 704e77f4c..ffc1c5179 100644 --- a/src/items/demonseye.c +++ b/src/items/demonseye.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "demonseye.h" /* kernel includes */ diff --git a/src/items/itemtypes.c b/src/items/itemtypes.c index 4c154efdb..930829668 100644 --- a/src/items/itemtypes.c +++ b/src/items/itemtypes.c @@ -11,12 +11,10 @@ */ #include -#include #include "itemtypes.h" #include "xerewards.h" #include "artrewards.h" -#include "phoenixcompass.h" #include "weapons.h" #include "seed.h" @@ -26,7 +24,6 @@ void register_itemtypes(void) register_weapons(); register_xerewards(); register_artrewards(); - register_phoenixcompass(); } void init_itemtypes(void) diff --git a/src/items/phoenixcompass.c b/src/items/phoenixcompass.c deleted file mode 100644 index 86a4f50d9..000000000 --- a/src/items/phoenixcompass.c +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright (c) 1998-2015, Enno Rehling -Katja Zedel - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -**/ - -#include -#include -#include "phoenixcompass.h" - -/* kernel includes */ -#include -#include -#include -#include -#include -#include - -/* util includes */ -#include -#include -#include - -/* libc includes */ -#include -#include -#include - -static int -use_phoenixcompass(struct unit *u, const struct item_type *itype, -int amount, struct order *ord) -{ - region *r; - unit *closest_phoenix = NULL; - int closest_phoenix_distance = INT_MAX; - bool confusion = false; - direction_t direction; - unit *u2; - direction_t closest_neighbour_direction = 0; - static const race *rc_phoenix = NULL; - - if (rc_phoenix == NULL) { - rc_phoenix = rc_find("phoenix"); - if (rc_phoenix == NULL) - return 0; - } - - /* find the closest phoenix. */ - - for (r = regions; r; r = r->next) { - for (u2 = r->units; u2; u2 = u2->next) { - if (u_race(u2) == rc_phoenix) { - if (closest_phoenix == NULL) { - closest_phoenix = u2; - closest_phoenix_distance = - distance(u->region, closest_phoenix->region); - } - else { - int dist = distance(u->region, r); - if (dist < closest_phoenix_distance) { - closest_phoenix = u2; - closest_phoenix_distance = dist; - confusion = false; - } - else if (dist == closest_phoenix_distance) { - confusion = true; - } - } - } - } - } - - /* no phoenix found at all.* if confusion == true more than one phoenix - * at the same distance was found and the device is confused */ - - if (closest_phoenix == NULL - || closest_phoenix->region == u->region || confusion) { - add_message(&u->faction->msgs, msg_message("phoenixcompass_confusion", - "unit region command", u, u->region, ord)); - return 0; - } - - /* else calculate the direction. this is tricky. we calculate the - * neighbouring region which is closest to the phoenix found. hardcoded - * for readability. */ - - for (direction = 0; direction < MAXDIRECTIONS; ++direction) { - region *neighbour; - int closest_neighbour_distance = INT_MAX; - - neighbour = r_connect(u->region, direction); - if (neighbour != NULL) { - int dist = distance(neighbour, closest_phoenix->region); - if (dist < closest_neighbour_distance) { - closest_neighbour_direction = direction; - closest_neighbour_distance = dist; - } - else if (dist == closest_neighbour_distance && rng_int() % 100 < 50) { - /* there can never be more than two neighbours with the same - * distance (except when you are standing in the same region - * as the phoenix, but that case has already been handled). - * therefore this simple solution is correct */ - closest_neighbour_direction = direction; - closest_neighbour_distance = dist; - } - } - } - - add_message(&u->faction->msgs, msg_message("phoenixcompass_success", - "unit region command dir", - u, u->region, ord, closest_neighbour_direction)); - - return 0; -} - -void register_phoenixcompass(void) -{ - register_item_use(use_phoenixcompass, "use_phoenixcompass"); -} diff --git a/src/items/seed.c b/src/items/seed.c index 0e4b54e98..f17e8ed29 100644 --- a/src/items/seed.c +++ b/src/items/seed.c @@ -17,13 +17,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "seed.h" /* kernel includes */ #include -#include #include #include @@ -42,7 +40,7 @@ static void produce_seeds(region * r, const resource_type * rtype, int norders) static int limit_seeds(const region * r, const resource_type * rtype) { - if (fval(r, RF_MALLORN)) { + if ((r->flags & RF_MALLORN)) { return 0; } return r->land ? r->land->trees[0] : 0; @@ -68,13 +66,13 @@ void init_seed(void) static void produce_mallornseeds(region * r, const resource_type * rtype, int norders) { - assert(fval(r, RF_MALLORN)); + assert(r->flags & RF_MALLORN); r->land->trees[0] -= norders; } static int limit_mallornseeds(const region * r, const resource_type * rtype) { - if (!fval(r, RF_MALLORN)) { + if (!(r->flags & RF_MALLORN)) { return 0; } return r->land ? r->land->trees[0] : 0; diff --git a/src/items/speedsail.c b/src/items/speedsail.c index 9d5aad747..8bdaa41ab 100644 --- a/src/items/speedsail.c +++ b/src/items/speedsail.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "speedsail.h" /* kernel includes */ diff --git a/src/items/weapons.c b/src/items/weapons.c index f5015e39a..1806e61a0 100644 --- a/src/items/weapons.c +++ b/src/items/weapons.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "weapons.h" #include "battle.h" diff --git a/src/items/xerewards.c b/src/items/xerewards.c index 98e099070..ab5226a32 100644 --- a/src/items/xerewards.c +++ b/src/items/xerewards.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "xerewards.h" #include "magic.h" diff --git a/src/json.c b/src/json.c index 007c3aeda..10322fe3f 100644 --- a/src/json.c +++ b/src/json.c @@ -1,8 +1,9 @@ #include "platform.h" -#include #include "json.h" +#include +#include #include #include #include @@ -22,12 +23,20 @@ int json_import(struct stream * out) { assert(out && out->api); while (!out->api->readln(out->handle, buffer, sizeof(buffer))) { size_t len = strlen(buffer); - data = (char *)realloc(data, sz + len + 1); + char *tmp; + tmp = (char *)realloc(data, sz + len + 1); + if (!tmp) { + log_fatal("allocation failure in json_import"); + free(data); + return 1; + } + data = tmp; memcpy(data + sz, buffer, len); sz += len; data[sz] = 0; } json = cJSON_Parse(data); + free(data); child = cJSON_GetObjectItem(json, "regions"); if (child && child->type == cJSON_Object) { cJSON *j; @@ -64,7 +73,7 @@ int json_export(stream * out, int flags) { cJSON_AddItemToObject(root, "planes", json = cJSON_CreateObject()); for (p = planes; p; p = p->next) { cJSON *data; - _snprintf(id, sizeof(id), "%u", p->id); + _snprintf(id, sizeof(id), "%d", p->id); cJSON_AddItemToObject(json, id, data = cJSON_CreateObject()); cJSON_AddNumberToObject(data, "x", p->minx); cJSON_AddNumberToObject(data, "y", p->miny); @@ -76,7 +85,7 @@ int json_export(stream * out, int flags) { cJSON_AddItemToObject(root, "regions", json = cJSON_CreateObject()); for (r = regions; r; r = r->next) { cJSON *data; - _snprintf(id, sizeof(id), "%u", r->uid); + _snprintf(id, sizeof(id), "%d", r->uid); cJSON_AddItemToObject(json, id, data = cJSON_CreateObject()); cJSON_AddNumberToObject(data, "x", r->x); cJSON_AddNumberToObject(data, "y", r->y); diff --git a/src/jsreport.c b/src/jsreport.c index 4450d0165..dc22c760a 100644 --- a/src/jsreport.c +++ b/src/jsreport.c @@ -1,6 +1,5 @@ -#include "reports.h" +#include "reports.h" #include "jsreport.h" -#include "seen.h" #include #include #include diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt index 9e829d4f4..d3a2e8e56 100644 --- a/src/kernel/CMakeLists.txt +++ b/src/kernel/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 2.6) project(kernel C) SET(_TEST_FILES @@ -19,7 +20,7 @@ order.test.c plane.test.c pool.test.c race.test.c -# region.test.c +region.test.c # resources.test.c save.test.c ship.test.c @@ -64,6 +65,8 @@ xmlreader.c jsonconf.c ) +SET(VERSION_SRC ${PROJECT_NAME}/version.c PARENT_SCOPE) + FOREACH(_FILE ${_FILES}) LIST(APPEND _SOURCES ${PROJECT_NAME}/${_FILE}) ENDFOREACH(_FILE) diff --git a/src/kernel/alliance.c b/src/kernel/alliance.c index c9bd26f40..36d054323 100644 --- a/src/kernel/alliance.c +++ b/src/kernel/alliance.c @@ -23,7 +23,6 @@ without prior permission by the authors of Eressea. #include #include #include -#include #include /* util includes */ @@ -288,14 +287,12 @@ static void perform_join(void) static syntaxtree * build_syntax(void) { syntaxtree *slang, *stree = stree_create(); for (slang = stree; slang; slang = slang->next) { - void *leaf = 0; - add_command(&leaf, NULL, LOC(slang->lang, alliance_kwd[ALLIANCE_KICK]), &cmd_kick); - add_command(&leaf, NULL, LOC(slang->lang, alliance_kwd[ALLIANCE_LEAVE]), &cmd_leave); - add_command(&leaf, NULL, LOC(slang->lang, alliance_kwd[ALLIANCE_TRANSFER]), &cmd_transfer); - add_command(&leaf, NULL, LOC(slang->lang, alliance_kwd[ALLIANCE_NEW]), &cmd_new); - add_command(&leaf, NULL, LOC(slang->lang, alliance_kwd[ALLIANCE_INVITE]), &cmd_invite); - add_command(&leaf, NULL, LOC(slang->lang, alliance_kwd[ALLIANCE_JOIN]), &cmd_join); - slang->root = leaf; + stree_add(slang, LOC(slang->lang, alliance_kwd[ALLIANCE_KICK]), &cmd_kick); + stree_add(slang, LOC(slang->lang, alliance_kwd[ALLIANCE_LEAVE]), &cmd_leave); + stree_add(slang, LOC(slang->lang, alliance_kwd[ALLIANCE_TRANSFER]), &cmd_transfer); + stree_add(slang, LOC(slang->lang, alliance_kwd[ALLIANCE_NEW]), &cmd_new); + stree_add(slang, LOC(slang->lang, alliance_kwd[ALLIANCE_INVITE]), &cmd_invite); + stree_add(slang, LOC(slang->lang, alliance_kwd[ALLIANCE_JOIN]), &cmd_join); } return stree; } diff --git a/src/kernel/alliance.test.c b/src/kernel/alliance.test.c index 8432f1692..72a31a42c 100644 --- a/src/kernel/alliance.test.c +++ b/src/kernel/alliance.test.c @@ -17,7 +17,6 @@ typedef struct alliance_fixture { } alliance_fixture; static void setup_alliance(alliance_fixture *fix) { - test_cleanup(); test_create_world(); fix->rc = test_create_race("human"); fix->f1 = test_create_faction(fix->rc); @@ -28,7 +27,7 @@ static void setup_alliance(alliance_fixture *fix) { static void test_alliance_make(CuTest *tc) { alliance * al; - test_cleanup(); + test_setup(); assert(!alliances); al = makealliance(1, "Hodor"); CuAssertPtrNotNull(tc, al); @@ -50,6 +49,7 @@ static void test_alliance_join(CuTest *tc) { alliance_fixture fix; alliance * al; + test_setup(); setup_alliance(&fix); CuAssertPtrEquals(tc, 0, fix.f1->alliance); CuAssertPtrEquals(tc, 0, fix.f2->alliance); @@ -69,7 +69,7 @@ static void test_alliance_dead_faction(CuTest *tc) { faction *f, *f2; alliance *al; - test_cleanup(); + test_setup(); f = test_create_faction(0); f2 = test_create_faction(0); al = makealliance(42, "Hodor"); @@ -91,7 +91,7 @@ static void test_alliance_cmd(CuTest *tc) { struct region *r; struct alliance *al; - test_cleanup(); + test_setup(); r = test_create_region(0, 0, 0); u1 = test_create_unit(test_create_faction(0), r); u2 = test_create_unit(test_create_faction(0), r); @@ -118,7 +118,7 @@ static void test_alliance_cmd_kick(CuTest *tc) { struct region *r; struct alliance *al; - test_cleanup(); + test_setup(); al = makealliance(42, "Hodor"); r = test_create_region(0, 0, 0); u1 = test_create_unit(test_create_faction(0), r); @@ -138,7 +138,7 @@ static void test_alliance_cmd_no_invite(CuTest *tc) { unit *u1, *u2; struct region *r; - test_cleanup(); + test_setup(); r = test_create_region(0, 0, 0); u1 = test_create_unit(test_create_faction(0), r); u2 = test_create_unit(test_create_faction(0), r); @@ -159,7 +159,7 @@ static void test_alliance_cmd_leave(CuTest *tc) { struct region *r; struct alliance *al; - test_cleanup(); + test_setup(); al = makealliance(42, "Hodor"); r = test_create_region(0, 0, 0); u1 = test_create_unit(test_create_faction(0), r); @@ -180,7 +180,7 @@ static void test_alliance_cmd_transfer(CuTest *tc) { struct region *r; struct alliance *al; - test_cleanup(); + test_setup(); al = makealliance(42, "Hodor"); r = test_create_region(0, 0, 0); u1 = test_create_unit(test_create_faction(0), r); diff --git a/src/kernel/ally.c b/src/kernel/ally.c index 3152ab4b7..5a5a5b1c3 100644 --- a/src/kernel/ally.c +++ b/src/kernel/ally.c @@ -3,7 +3,6 @@ #include "types.h" #include "ally.h" -#include "save.h" #include "unit.h" #include "region.h" #include "group.h" @@ -133,19 +132,21 @@ attrib_type at_npcfaction = { */ int HelpMask(void) { - const char *str = config_get("rules.help.mask"); - int rule = 0; - if (str != NULL) { - char *sstr = _strdup(str); - char *tok = strtok(sstr, " "); - while (tok) { - rule |= ally_flag(tok, -1); - tok = strtok(NULL, " "); + static int config, rule = 0; + if (config_changed(&config)) { + const char *str = config_get("rules.help.mask"); + if (str != NULL) { + char *sstr = _strdup(str); + char *tok = strtok(sstr, " "); + while (tok) { + rule |= ally_flag(tok, -1); + tok = strtok(NULL, " "); + } + free(sstr); + } + else { + rule = HELP_ALL; } - free(sstr); - } - else { - rule = HELP_ALL; } return rule; } diff --git a/src/kernel/build.c b/src/kernel/build.c index f9e10b09e..b5a1b3417 100644 --- a/src/kernel/build.c +++ b/src/kernel/build.c @@ -24,6 +24,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "direction.h" #include "move.h" #include "study.h" +#include "guard.h" #include "laws.h" #include "skill.h" #include "lighthouse.h" @@ -113,7 +114,7 @@ static void destroy_road(unit * u, int nmax, struct order *ord) } for (u2 = r->units; u2; u2 = u2->next) { - if (u2->faction != u->faction && is_guard(u2, GUARD_TAX) + if (u2->faction != u->faction && is_guard(u2) && cansee(u2->faction, u->region, u, 0) && !alliedunit(u, u2->faction, HELP_GUARD)) { cmistake(u, ord, 70, MSG_EVENT); @@ -130,13 +131,15 @@ static void destroy_road(unit * u, int nmax, struct order *ord) if (willdo == 0) { /* TODO: error message */ } - if (willdo > SHRT_MAX) + else if (willdo > SHRT_MAX) road = 0; else road = (short)(road - willdo); rsetroad(r, d, road); - ADDMSG(&u->faction->msgs, msg_message("destroy_road", - "unit from to", u, r, r2)); + if (willdo > 0) { + ADDMSG(&u->faction->msgs, msg_message("destroy_road", + "unit from to", u, r, r2)); + } } } } @@ -163,19 +166,17 @@ int destroy_cmd(unit * u, struct order *ord) init_order(ord); s = gettoken(token, sizeof(token)); - if (findparam(s, u->faction->locale) == P_ROAD) { - destroy_road(u, INT_MAX, ord); - return 0; - } - if (s && *s) { n = atoi((const char *)s); if (n <= 0) { n = INT_MAX; } + else { + s = gettoken(token, sizeof(token)); + } } - if (getparam(u->faction->locale) == P_ROAD) { + if (s && isparam(s, u->faction->locale, P_ROAD)) { destroy_road(u, n, ord); return 0; } @@ -248,7 +249,7 @@ int destroy_cmd(unit * u, struct order *ord) } if (con) { - /* TODO: Nicht an ZERSTÖRE mit Punktangabe angepasst! */ + /* TODO: Nicht an ZERST�RE mit Punktangabe angepasst! */ int c; for (c = 0; con->materials[c].number; ++c) { const requirement *rq = con->materials + c; @@ -419,8 +420,9 @@ int value) int roqf_factor(void) { - int value = -1; - if (value < 0) { + static int config; + static int value; + if (config_changed(&config)) { value = config_get_int("rules.economy.roqf", 10); } return value; @@ -511,8 +513,8 @@ int build(unit * u, const construction * ctype, int completed, int want) /* Hier ist entweder maxsize == -1, oder completed < maxsize. * Andernfalls ist das Datenfile oder sonstwas kaputt... - * (enno): Nein, das ist für Dinge, bei denen die nächste Ausbaustufe - * die gleiche wie die vorherige ist. z.b. gegenstände. + * (enno): Nein, das ist f�r Dinge, bei denen die n�chste Ausbaustufe + * die gleiche wie die vorherige ist. z.b. gegenst�nde. */ if (type->maxsize > 0) { completed = completed % type->maxsize; @@ -640,7 +642,6 @@ message *msg_materials_required(unit * u, order * ord, if (multi <= 0 || multi == INT_MAX) multi = 1; for (c = 0; ctype && ctype->materials[c].number; ++c) { - // TODO: lots of alloc/dealloc calls here (make var_copy_resources take an array) resource *res = malloc(sizeof(resource)); res->number = multi * ctype->materials[c].number / ctype->reqsize; res->type = ctype->materials[c].rtype; @@ -758,10 +759,8 @@ build_building(unit * u, const building_type * btype, int id, int want, order * return 0; } } - } - - if (b) built = b->size; + } if (n <= 0 || n == INT_MAX) { if (b == NULL) { if (btype->maxsize > 0) { @@ -816,11 +815,11 @@ build_building(unit * u, const building_type * btype, int id, int want, order * btname = LOC(lang, btype->_name); if (want - built <= 0) { - /* gebäude fertig */ + /* geb�ude fertig */ new_order = default_order(lang); } else if (want != INT_MAX && btname) { - /* reduzierte restgröße */ + /* reduzierte restgr��e */ const char *hasspace = strchr(btname, ' '); if (hasspace) { new_order = @@ -832,7 +831,7 @@ build_building(unit * u, const building_type * btype, int id, int want, order * } } else if (btname) { - /* Neues Haus, Befehl mit Gebäudename */ + /* Neues Haus, Befehl mit Geb�udename */ const char *hasspace = strchr(btname, ' '); if (hasspace) { new_order = create_order(K_MAKE, lang, "\"%s\" %i", btname, b->no); diff --git a/src/kernel/build.test.c b/src/kernel/build.test.c index 41dcdb1a5..b714f58f0 100644 --- a/src/kernel/build.test.c +++ b/src/kernel/build.test.c @@ -1,8 +1,11 @@ #include #include + +#include #include "alchemy.h" #include "types.h" #include "build.h" +#include "guard.h" #include "order.h" #include "unit.h" #include "building.h" @@ -265,10 +268,145 @@ static void test_build_building_success(CuTest *tc) { teardown_build(&bf); } +static void test_build_destroy_road(CuTest *tc) +{ + region *r, *r2; + faction *f; + unit *u; + order *ord; + message *m; + + test_cleanup(); + mt_register(mt_new_va("destroy_road", "unit:unit", "from:region", "to:region", 0)); + r2 = test_create_region(1, 0, 0); + r = test_create_region(0, 0, 0); + rsetroad(r, D_EAST, 100); + u = test_create_unit(f = test_create_faction(0), r); + u->orders = ord = create_order(K_DESTROY, f->locale, "%s %s", LOC(f->locale, parameters[P_ROAD]), LOC(f->locale, directions[D_EAST])); + + CuAssertIntEquals(tc, 0, destroy_cmd(u, ord)); + CuAssertIntEquals(tc, 100, rroad(r, D_EAST)); + CuAssertPtrEquals(tc, 0, test_find_messagetype(f->msgs, "destroy_road")); + + set_level(u, SK_ROAD_BUILDING, 1); + CuAssertIntEquals(tc, 0, destroy_cmd(u, ord)); + CuAssertIntEquals(tc, 99, rroad(r, D_EAST)); + CuAssertPtrNotNull(tc, m = test_find_messagetype(f->msgs, "destroy_road")); + CuAssertPtrEquals(tc, u, m->parameters[0].v); + CuAssertPtrEquals(tc, r, m->parameters[1].v); + CuAssertPtrEquals(tc, r2, m->parameters[2].v); + + set_level(u, SK_ROAD_BUILDING, 4); + CuAssertIntEquals(tc, 0, destroy_cmd(u, ord)); + CuAssertIntEquals(tc, 95, rroad(r, D_EAST)); + + scale_number(u, 4); + set_level(u, SK_ROAD_BUILDING, 2); + CuAssertIntEquals(tc, 0, destroy_cmd(u, ord)); + CuAssertIntEquals(tc, 87, rroad(r, D_EAST)); + test_cleanup(); +} + +unit *test_create_guard(region *r, faction *f, race *rc) { + unit *ug; + + if (!rc) { + rc = test_create_race("guardian"); + rc->flags |= RCF_UNARMEDGUARD; + } + if (!f) { + f = test_create_faction(rc); + } + ug = test_create_unit(f, r); + setguard(ug, true); + + return ug; +} + +static void test_build_destroy_road_guard(CuTest *tc) +{ + region *r; + faction *f; + unit *u, *ug; + order *ord; + + test_cleanup(); + test_create_region(1, 0, 0); + r = test_create_region(0, 0, 0); + rsetroad(r, D_EAST, 100); + ug = test_create_guard(r, 0, 0); + u = test_create_unit(f = test_create_faction(0), r); + u->orders = ord = create_order(K_DESTROY, f->locale, "%s %s", LOC(f->locale, parameters[P_ROAD]), LOC(f->locale, directions[D_EAST])); + + set_level(u, SK_ROAD_BUILDING, 1); + CuAssertIntEquals(tc, 0, destroy_cmd(u, ord)); + CuAssertIntEquals(tc, 100, rroad(r, D_EAST)); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "error70")); + CuAssertPtrEquals(tc, 0, test_find_messagetype(f->msgs, "destroy_road")); + + test_clear_messages(f); + setguard(ug, false); + + CuAssertIntEquals(tc, 0, destroy_cmd(u, ord)); + CuAssertIntEquals(tc, 99, rroad(r, D_EAST)); + CuAssertPtrEquals(tc, NULL, test_find_messagetype(f->msgs, "error70")); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "destroy_road")); + + test_cleanup(); +} + +static void test_build_destroy_road_limit(CuTest *tc) +{ + region *r; + faction *f; + unit *u; + order *ord; + + test_cleanup(); + test_create_region(1, 0, 0); + r = test_create_region(0, 0, 0); + rsetroad(r, D_EAST, 100); + u = test_create_unit(f = test_create_faction(0), r); + u->orders = ord = create_order(K_DESTROY, f->locale, "1 %s %s", LOC(f->locale, parameters[P_ROAD]), LOC(f->locale, directions[D_EAST])); + + set_level(u, SK_ROAD_BUILDING, 1); + CuAssertIntEquals(tc, 0, destroy_cmd(u, ord)); + CuAssertIntEquals(tc, 99, rroad(r, D_EAST)); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "destroy_road")); + + set_level(u, SK_ROAD_BUILDING, 4); + CuAssertIntEquals(tc, 0, destroy_cmd(u, ord)); + CuAssertIntEquals(tc, 98, rroad(r, D_EAST)); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "destroy_road")); + + test_cleanup(); +} + +static void test_build_destroy_cmd(CuTest *tc) { + unit *u; + faction *f; + + test_setup(); + u = test_create_unit(f = test_create_faction(0), test_create_region(0, 0, 0)); + u->thisorder = create_order(K_DESTROY, f->locale, NULL); + CuAssertIntEquals(tc, 138, destroy_cmd(u, u->thisorder)); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "error138")); + test_cleanup(); +} + +static void test_build_roqf_factor(CuTest *tc) { + test_setup(); + CuAssertIntEquals(tc, 10, roqf_factor()); + config_set("rules.economy.roqf", "50"); + CuAssertIntEquals(tc, 50, roqf_factor()); + test_cleanup(); +} + CuSuite *get_build_suite(void) { CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_build_limits); + SUITE_ADD_TEST(suite, test_build_roqf_factor); SUITE_ADD_TEST(suite, test_build_failure_low_skill); SUITE_ADD_TEST(suite, test_build_failure_missing_skill); SUITE_ADD_TEST(suite, test_build_requires_materials); @@ -279,6 +417,10 @@ CuSuite *get_build_suite(void) SUITE_ADD_TEST(suite, test_build_building_success); SUITE_ADD_TEST(suite, test_build_building_with_golem); SUITE_ADD_TEST(suite, test_build_building_no_materials); + SUITE_ADD_TEST(suite, test_build_destroy_cmd); + SUITE_ADD_TEST(suite, test_build_destroy_road); + SUITE_ADD_TEST(suite, test_build_destroy_road_limit); + SUITE_ADD_TEST(suite, test_build_destroy_road_guard); return suite; } diff --git a/src/kernel/building.c b/src/kernel/building.c index cf40c0ea3..8d76df030 100644 --- a/src/kernel/building.c +++ b/src/kernel/building.c @@ -22,15 +22,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "building.h" /* kernel includes */ +#include "curse.h" #include "item.h" #include "unit.h" #include "faction.h" #include "race.h" #include "region.h" #include "skill.h" -#include "save.h" +#include "terrain.h" #include "lighthouse.h" -#include "version.h" /* util includes */ #include @@ -54,6 +54,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include /* attributes includes */ +#include #include typedef struct building_typelist { @@ -84,15 +85,28 @@ const building_type *bt_find(const char *name) return bt_find_i(name); } +static int bt_changes = 1; + +bool bt_changed(int *cache) +{ + assert(cache); + if (*cache != bt_changes) { + *cache = bt_changes; + return true; + } + return false; +} + void bt_register(building_type * type) { if (type->init) { type->init(type); } ql_push(&buildingtypes, (void *)type); + ++bt_changes; } -void free_buildingtype(void *ptr) { +static void free_buildingtype(void *ptr) { building_type *btype = (building_type *)ptr; free_construction(btype->construction); free(btype->maintenance); @@ -104,6 +118,7 @@ void free_buildingtypes(void) { ql_foreach(buildingtypes, free_buildingtype); ql_free(buildingtypes); buildingtypes = 0; + ++bt_changes; } building_type *bt_get_or_create(const char *name) @@ -158,9 +173,7 @@ const char *buildingtype(const building_type * btype, const building * b, int bs s = btype->name(btype, b, bsize); } if (b && b->attribs) { - const struct building_type *bt_generic = bt_find("generic"); - - if (btype == bt_generic) { + if (is_building_type(btype, "generic")) { const attrib *a = a_find(b->attribs, &at_building_generic_type); if (a) { s = (const char *)a->data.v; @@ -313,7 +326,7 @@ const building_type *findbuildingtype(const char *name, const char *n = LOC(lang, btype->_name); type.v = (void *)btype; - addtoken(&bn->names, n, type); + addtoken((struct tnode **)&bn->names, n, type); } bnames = bn; } @@ -322,9 +335,8 @@ const building_type *findbuildingtype(const char *name, return (const building_type *)type.v; } -static int building_protection(building * b, unit * u, building_bonus bonus) +static int building_protection(const building * b, const unit * u, building_bonus bonus) { - int i = 0; int bsize = buildingeffsize(b, false); const construction *cons = b->type->construction; @@ -350,23 +362,6 @@ static int building_protection(building * b, unit * u, building_bonus bonus) } } -static int meropis_building_protection(building * b, unit * u) -{ - return 2; -} - -void register_buildings(void) -{ - register_function((pf_generic)building_protection, - "building_protection"); - register_function((pf_generic)meropis_building_protection, - "meropis_building_protection"); - register_function((pf_generic)init_smithy, "init_smithy"); - register_function((pf_generic)castle_name, "castle_name"); - register_function((pf_generic)castle_name_2, "castle_name_2"); - register_function((pf_generic)fort_name, "fort_name"); -} - void write_building_reference(const struct building *b, struct storage *store) { WRITE_INT(store, (b && b->region) ? b->no : 0); @@ -398,16 +393,9 @@ building *new_building(const struct building_type * btype, region * r, { building **bptr = &r->buildings; building *b = (building *)calloc(1, sizeof(building)); - static bool init_lighthouse = false; - static const struct building_type *bt_lighthouse = 0; const char *bname = 0; char buffer[32]; - if (!init_lighthouse) { - bt_lighthouse = bt_find("lighthouse"); - init_lighthouse = true; - } - b->no = newcontainerid(); bhash(b); @@ -417,9 +405,7 @@ building *new_building(const struct building_type * btype, region * r, bptr = &(*bptr)->next; *bptr = b; - if (b->type == bt_lighthouse) { - r->flags |= RF_LIGHTHOUSE; - } + update_lighthouse(b); if (b->type->name) { bname = LOC(lang, buildingtype(btype, b, 0)); } @@ -433,7 +419,7 @@ building *new_building(const struct building_type * btype, region * r, bname = parameters[P_GEBAEUDE]; } assert(bname); - slprintf(buffer, sizeof(buffer), "%s %s", bname, buildingid(b)); + slprintf(buffer, sizeof(buffer), "%s %s", bname, itoa36(b->no)); b->name = _strdup(bname); return b; } @@ -463,8 +449,9 @@ void remove_building(building ** blist, building * b) update_lighthouse(b); bunhash(b); - /* Falls Karawanserei, Damm oder Tunnel einstürzen, wird die schon - * gebaute Straße zur Hälfte vernichtet */ + /* Falls Karawanserei, Damm oder Tunnel einst�rzen, wird die schon + * gebaute Stra�e zur H�lfte vernichtet */ + // TODO: caravan, tunnel, dam modularization ? is_building_type ? if (b->type == bt_caravan || b->type == bt_dam || b->type == bt_tunnel) { region *r = b->region; int d; @@ -576,7 +563,7 @@ void building_set_owner(struct unit * owner) static unit *building_owner_ex(const building * bld, const struct faction * last_owner) { unit *u, *heir = 0; - /* Eigentümer tot oder kein Eigentümer vorhanden. Erste lebende Einheit + /* Eigent�mer tot oder kein Eigent�mer vorhanden. Erste lebende Einheit * nehmen. */ for (u = bld->region->units; u; u = u->next) { if (u->building == bld) { @@ -703,3 +690,233 @@ bool in_safe_building(unit *u1, unit *u2) { } return false; } + +bool is_building_type(const struct building_type *btype, const char *name) { + assert(btype); + return name && strcmp(btype->_name, name)==0; +} + +building *largestbuilding(const region * r, cmp_building_cb cmp_gt, + bool imaginary) +{ + building *b, *best = NULL; + + for (b = rbuildings(r); b; b = b->next) { + if (cmp_gt(b, best) <= 0) + continue; + if (!imaginary) { + const attrib *a = a_find(b->attribs, &at_icastle); + if (a) + continue; + } + best = b; + } + return best; +} +/* Lohn bei den einzelnen Burgstufen f�r Normale Typen, Orks, Bauern, + * Modifikation f�r St�dter. */ + +static const int wagetable[7][4] = { + { 10, 10, 11, -7 }, /* Baustelle */ + { 10, 10, 11, -5 }, /* Handelsposten */ + { 11, 11, 12, -3 }, /* Befestigung */ + { 12, 11, 13, -1 }, /* Turm */ + { 13, 12, 14, 0 }, /* Burg */ + { 14, 12, 15, 1 }, /* Festung */ + { 15, 13, 16, 2 } /* Zitadelle */ +}; + +static int +default_wage(const region * r, const faction * f, const race * rc, int in_turn) +{ + building *b = largestbuilding(r, &cmp_wage, false); + int esize = 0; + double wage; + static int ct_cache; + static const struct curse_type *drought_ct; + + if (ct_changed(&ct_cache)) { + drought_ct = ct_find("drought"); + } + if (b != NULL) { + /* TODO: this reveals imaginary castles */ + esize = buildingeffsize(b, false); + } + + if (f != NULL) { + int index = 0; + if (rc == get_race(RC_ORC) || rc == get_race(RC_SNOTLING)) { + index = 1; + } + wage = wagetable[esize][index]; + } + else { + if (is_mourning(r, in_turn)) { + wage = 10; + } + else if (fval(r->terrain, SEA_REGION)) { + wage = 11; + } + else { + wage = wagetable[esize][2]; + } + if (rule_blessed_harvest() == HARVEST_WORK) { + /* E1 rules */ + wage += curse_geteffect(get_curse(r->attribs, ct_find("blessedharvest"))); + } + } + + /* Artsculpture: Income +5 */ + for (b = r->buildings; b; b = b->next) { + if (is_building_type(b->type, "artsculpture")) { + wage += 5; + } + } + + if (r->attribs) { + attrib *a; + const struct curse_type *ctype; + /* Godcurse: Income -10 */ + ctype = ct_find("godcursezone"); + if (ctype && curse_active(get_curse(r->attribs, ctype))) { + wage = _max(0, wage - 10); + } + + /* Bei einer D�rre verdient man nur noch ein Viertel */ + if (drought_ct) { + curse *c = get_curse(r->attribs, drought_ct); + if (curse_active(c)) + wage /= curse_geteffect(c); + } + + a = a_find(r->attribs, &at_reduceproduction); + if (a) { + wage = (wage * a->data.sa[0]) / 100; + } + } + return (int)wage; +} + +static int +minimum_wage(const region * r, const faction * f, const race * rc, int in_turn) +{ + if (f && rc) { + return rc->maintenance; + } + return default_wage(r, f, rc, in_turn); +} + +/* Gibt Arbeitslohn f�r entsprechende Rasse zur�ck, oder f�r +* die Bauern wenn f == NULL. */ +int wage(const region * r, const faction * f, const race * rc, int in_turn) +{ + if (global.functions.wage) { + return global.functions.wage(r, f, rc, in_turn); + } + return default_wage(r, f, rc, in_turn); +} + +int cmp_wage(const struct building *b, const building * a) +{ + if (is_building_type(b->type, "castle")) { + if (!a) + return 1; + if (b->size > a->size) + return 1; + if (b->size == a->size) + return 0; + } + return -1; +} + +bool is_owner_building(const struct building * b) +{ + region *r = b->region; + if (b->type->taxes && r->land && r->land->ownership) { + unit *u = building_owner(b); + return u && u->faction == r->land->ownership->owner; + } + return false; +} + +int cmp_taxes(const building * b, const building * a) +{ + faction *f = region_get_owner(b->region); + if (b->type->taxes) { + unit *u = building_owner(b); + if (!u) { + return -1; + } + else if (a) { + int newsize = buildingeffsize(b, false); + double newtaxes = b->type->taxes(b, newsize); + int oldsize = buildingeffsize(a, false); + double oldtaxes = a->type->taxes(a, oldsize); + + if (newtaxes < oldtaxes) + return -1; + else if (newtaxes > oldtaxes) + return 1; + else if (b->size < a->size) + return -1; + else if (b->size > a->size) + return 1; + else { + if (u && u->faction == f) { + u = building_owner(a); + if (u && u->faction == f) + return -1; + return 1; + } + } + } + else { + return 1; + } + } + return -1; +} + +int cmp_current_owner(const building * b, const building * a) +{ + faction *f = region_get_owner(b->region); + + assert(rule_region_owners()); + if (f && b->type->taxes) { + unit *u = building_owner(b); + if (!u || u->faction != f) + return -1; + if (a) { + int newsize = buildingeffsize(b, false); + double newtaxes = b->type->taxes(b, newsize); + int oldsize = buildingeffsize(a, false); + double oldtaxes = a->type->taxes(a, oldsize); + + if (newtaxes > oldtaxes) { + return 1; + } + if (newtaxes < oldtaxes) { + return -1; + } + if (newsize != oldsize) { + return newsize - oldsize; + } + return (b->size - a->size); + } + else { + return 1; + } + } + return -1; +} + +void register_buildings(void) +{ + register_function((pf_generic)minimum_wage, "minimum_wage"); + register_function((pf_generic)building_protection, + "building_protection"); + register_function((pf_generic)init_smithy, "init_smithy"); + register_function((pf_generic)castle_name, "castle_name"); + register_function((pf_generic)castle_name_2, "castle_name_2"); + register_function((pf_generic)fort_name, "fort_name"); +} diff --git a/src/kernel/building.h b/src/kernel/building.h index fda4a4676..92b006b98 100644 --- a/src/kernel/building.h +++ b/src/kernel/building.h @@ -22,6 +22,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include +#include #ifdef __cplusplus extern "C" { #endif @@ -31,7 +32,6 @@ extern "C" { /* maintenance::flags */ #define MTF_NONE 0x00 #define MTF_VARIABLE 0x01 /* resource usage scales with size */ -#define MTF_VITAL 0x02 /* if resource missing, building may crash */ typedef struct maintenance { const struct resource_type *rtype; /* type of resource required */ @@ -53,7 +53,7 @@ extern "C" { typedef enum { DEFENSE_BONUS, - CLOSE_COMBAT_ATTACK_BONUS, + CLOSE_COMBAT_ATTACK_BONUS, // TODO: only DEFENSE_BONUS is in use? RANGED_ATTACK_BONUS, } building_bonus; @@ -61,8 +61,8 @@ extern "C" { char *_name; int flags; /* flags */ - int capacity; /* Kapazität pro Größenpunkt */ - int maxcapacity; /* Max. Kapazität */ + int capacity; /* Kapazit�t pro Gr��enpunkt */ + int maxcapacity; /* Max. Kapazit�t */ int maxsize; /* how big can it get, with all the extensions? */ int magres; /* how well it resists against spells */ int magresbonus; /* bonus it gives the target against spells */ @@ -75,7 +75,7 @@ extern "C" { const struct building * b, int size); void(*init) (struct building_type *); void(*age) (struct building *); - int(*protection) (struct building *, struct unit *, building_bonus); + int(*protection) (const struct building *, const struct unit *, building_bonus bonus); double(*taxes) (const struct building *, int size); struct attrib *attribs; } building_type; @@ -84,6 +84,7 @@ extern "C" { extern struct attrib_type at_building_action; building_type *bt_get_or_create(const char *name); + bool bt_changed(int *cache); const building_type *bt_find(const char *name); void free_buildingtypes(void); void register_buildings(void); @@ -131,7 +132,17 @@ extern "C" { int id, int size, struct order *ord); bool building_finished(const struct building *b); - /* Alte Gebäudetypen: */ + int wage(const struct region *r, const struct faction *f, + const struct race *rc, int in_turn); + + typedef int(*cmp_building_cb) (const struct building * b, + const struct building * a); + struct building *largestbuilding(const struct region *r, cmp_building_cb, + bool imaginary); + int cmp_wage(const struct building *b, const struct building *bother); + int cmp_taxes(const struct building *b, const struct building *bother); + int cmp_current_owner(const struct building *b, + const struct building *bother); /* old functions, still in build.c: */ int buildingeffsize(const building * b, int imaginary); @@ -163,6 +174,7 @@ extern "C" { bool buildingtype_exists(const struct region *r, const struct building_type *bt, bool working); bool building_is_active(const struct building *b); + bool is_building_type(const struct building_type *btype, const char *name); struct building *active_building(const struct unit *u, const struct building_type *btype); extern const char *buildingname(const struct building *b); diff --git a/src/kernel/building.test.c b/src/kernel/building.test.c index 1c5ff1fe2..d15c82c8e 100644 --- a/src/kernel/building.test.c +++ b/src/kernel/building.test.c @@ -17,16 +17,20 @@ static void test_register_building(CuTest * tc) { building_type *btype; + int cache = 0; test_cleanup(); btype = (building_type *)calloc(sizeof(building_type), 1); btype->_name = _strdup("herp"); + CuAssertIntEquals(tc, true, bt_changed(&cache)); + CuAssertIntEquals(tc, false, bt_changed(&cache)); bt_register(btype); + CuAssertIntEquals(tc, true, bt_changed(&cache)); CuAssertPtrNotNull(tc, bt_find("herp")); - // free(btype->_name); - // free(btype); + free_buildingtypes(); + CuAssertIntEquals(tc, true, bt_changed(&cache)); test_cleanup(); } @@ -401,8 +405,8 @@ static void test_buildingtype_exists(CuTest * tc) r = findregion(-1, 0); b = new_building(btype, r, default_locale); - b->size = 10; CuAssertPtrNotNull(tc, b); + b->size = 10; CuAssertTrue(tc, !buildingtype_exists(r, NULL, false)); CuAssertTrue(tc, !buildingtype_exists(r, btype2, false)); @@ -480,6 +484,15 @@ static void test_safe_building(CuTest *tc) { test_cleanup(); } +static void test_building_type(CuTest *tc) { + building_type *btype; + test_setup(); + btype = test_create_buildingtype("house"); + CuAssertIntEquals(tc, true, is_building_type(btype, "house")); + CuAssertIntEquals(tc, false, is_building_type(btype, "castle")); + test_cleanup(); +} + CuSuite *get_building_suite(void) { CuSuite *suite = CuSuiteNew(); @@ -494,6 +507,7 @@ CuSuite *get_building_suite(void) SUITE_ADD_TEST(suite, test_buildingowner_goes_to_other_after_leave); SUITE_ADD_TEST(suite, test_buildingowner_goes_to_same_faction_after_leave); SUITE_ADD_TEST(suite, test_buildingowner_goes_to_empty_unit_after_leave); + SUITE_ADD_TEST(suite, test_building_type); SUITE_ADD_TEST(suite, test_active_building); SUITE_ADD_TEST(suite, test_buildingtype_exists); SUITE_ADD_TEST(suite, test_safe_building); diff --git a/src/kernel/command.c b/src/kernel/command.c index 0642be060..912f21f7d 100644 --- a/src/kernel/command.c +++ b/src/kernel/command.c @@ -30,7 +30,7 @@ typedef struct command { parser fun; - void *nodes; + struct command *next; } command; void *stree_find(const syntaxtree * stree, const struct locale *lang) @@ -44,6 +44,11 @@ void *stree_find(const syntaxtree * stree, const struct locale *lang) } void stree_free(syntaxtree *stree) { + while (stree->cmds) { + command *next = stree->cmds->next; + free(stree->cmds); + stree->cmds = next; + } while (stree) { syntaxtree *snext = stree->next; freetokens(stree->root); @@ -61,27 +66,26 @@ syntaxtree *stree_create(void) stree->lang = lang; stree->next = sroot; stree->root = 0; + stree->cmds = 0; sroot = stree; lang = nextlocale(lang); } return sroot; } -void -add_command(void **keys, void *tnext, -const char *str, parser fun) -{ +void stree_add(struct syntaxtree *stree, const char *str, parser fun) { command *cmd = (command *)malloc(sizeof(command)); variant var; assert(str); cmd->fun = fun; - cmd->nodes = tnext; var.v = cmd; - addtoken(keys, str, var); + cmd->next = stree->cmds; + stree->cmds = cmd; + addtoken(&stree->root, str, var); } -static int do_command_i(const void *keys, struct unit *u, struct order *ord) +static int do_command_i(const struct tnode *keys, struct unit *u, struct order *ord) { char token[128]; const char *c; @@ -90,19 +94,15 @@ static int do_command_i(const void *keys, struct unit *u, struct order *ord) c = gettoken(token, sizeof(token)); if (findtoken(keys, c, &var) == E_TOK_SUCCESS) { command *cmd = (command *)var.v; - if (cmd->nodes && *c) { - assert(!cmd->fun); - return do_command_i(cmd->nodes, u, ord); - } - else if (cmd->fun) { - cmd->fun(cmd->nodes, u, ord); + if (cmd->fun) { + cmd->fun(0, u, ord); return E_TOK_SUCCESS; } } return E_TOK_NOMATCH; } -void do_command(const void *keys, struct unit *u, struct order *ord) +void do_command(const struct tnode *keys, struct unit *u, struct order *ord) { init_order(ord); if (do_command_i(keys, u, ord) != E_TOK_SUCCESS) { diff --git a/src/kernel/command.h b/src/kernel/command.h index 70b03a3a6..8fba94b7b 100644 --- a/src/kernel/command.h +++ b/src/kernel/command.h @@ -19,19 +19,21 @@ extern "C" { struct locale; struct order; struct unit; + struct tnode; + struct command; typedef struct syntaxtree { const struct locale *lang; - void *root; + struct tnode *root; struct syntaxtree *next; + struct command *cmds; } syntaxtree; typedef void(*parser) (const void *nodes, struct unit * u, struct order *); - void add_command(void **troot, void *tnext, - const char *str, parser fun); - void do_command(const void *troot, struct unit *u, struct order *); + void do_command(const struct tnode *troot, struct unit *u, struct order *); struct syntaxtree *stree_create(void); + void stree_add(struct syntaxtree *, const char *str, parser fun); void stree_free(struct syntaxtree *); void *stree_find(const struct syntaxtree *stree, const struct locale *lang); diff --git a/src/kernel/command.test.c b/src/kernel/command.test.c index edf521c81..f38c7e443 100644 --- a/src/kernel/command.test.c +++ b/src/kernel/command.test.c @@ -37,8 +37,8 @@ static void test_command(CuTest * tc) { CuAssertPtrEquals(tc, loc, (struct locale *)st->lang); CuAssertPtrEquals(tc, 0, st->root); CuAssertPtrEquals(tc, 0, st->next); - add_command(&st->root, 0, "two", parser_two); - add_command(&st->root, 0, "six", parser_six); + stree_add(st, "two", parser_two); + stree_add(st, "six", parser_six); CuAssertPtrNotNull(tc, st->root); CuAssertPtrEquals(tc, st->root, stree_find(st, loc)); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); @@ -54,4 +54,4 @@ CuSuite *get_command_suite(void) CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_command); return suite; -} \ No newline at end of file +} diff --git a/src/kernel/config.c b/src/kernel/config.c index cda449a23..f33303ead 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -19,9 +19,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -/* attributes includes */ -#include - /* kernel includes */ #include "alliance.h" #include "ally.h" @@ -31,6 +28,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "building.h" #include "calendar.h" #include "direction.h" +#include "equipment.h" #include "faction.h" #include "group.h" #include "item.h" @@ -69,7 +67,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include #include @@ -101,70 +98,8 @@ struct settings global = { }; bool lomem = false; -FILE *logfile; -bool battledebug = false; int turn = -1; -int NewbieImmunity(void) -{ - return config_get_int("NewbieImmunity", 0); -} - -bool IsImmune(const faction * f) -{ - return !fval(f, FFL_NPC) && f->age < NewbieImmunity(); -} - -bool ExpensiveMigrants(void) -{ - return config_get_int("study.expensivemigrants", 0) != 0; -} - -int LongHunger(const struct unit *u) -{ - if (u != NULL) { - if (!fval(u, UFL_HUNGER)) - return false; - if (u_race(u) == get_race(RC_DAEMON)) - return false; - } - return config_get_int("hunger.long", 0); -} - -int NMRTimeout(void) -{ - return config_get_int("nmr.timeout", 0); -} - -race_t old_race(const struct race * rc) -{ - race_t i; - for (i = 0; i != MAXRACES; ++i) { - if (get_race(i) == rc) return i; - } - return NORACE; -} - -helpmode helpmodes[] = { - { "all", HELP_ALL } - , - { "money", HELP_MONEY } - , - { "fight", HELP_FIGHT } - , - { "observe", HELP_OBSERVE } - , - { "give", HELP_GIVE } - , - { "guard", HELP_GUARD } - , - { "stealth", HELP_FSTEALTH } - , - { "travel", HELP_TRAVEL } - , - { NULL, 0 } -}; - const char *parameters[MAXPARAMS] = { "LOCALE", "ALLES", @@ -188,7 +123,7 @@ const char *parameters[MAXPARAMS] = { "TEMP", "FLIEHE", "GEBAEUDE", - "GIB", /* Für HELFE */ + "GIB", /* F�r HELFE */ "KAEMPFE", "DURCHREISE", "BEWACHE", @@ -212,43 +147,6 @@ const char *parameters[MAXPARAMS] = { "ALLIANZ" }; -const char *report_options[MAX_MSG] = { - "Kampf", - "Ereignisse", - "Bewegung", - "Einkommen", - "Handel", - "Produktion", - "Orkvermehrung", - "Zauber", - "", - "" -}; - -const char *message_levels[ML_MAX] = { - "Wichtig", - "Debug", - "Fehler", - "Warnungen", - "Infos" -}; - -const char *options[MAXOPTIONS] = { - "AUSWERTUNG", - "COMPUTER", - "ZUGVORLAGE", - NULL, - "STATISTIK", - "DEBUG", - "ZIPPED", - "ZEITUNG", /* Option hat Sonderbehandlung! */ - NULL, - "ADRESSEN", - "BZIP2", - "PUNKTE", - "SHOWSKCHANGE" -}; - FILE *debug; void @@ -282,18 +180,6 @@ parse(keyword_t kword, int(*dofun) (unit *, struct order *), bool thisorder) } } -const struct race *findrace(const char *s, const struct locale *lang) -{ - void **tokens = get_translations(lang, UT_RACES); - variant token; - - assert(lang); - if (tokens && findtoken(*tokens, s, &token) == E_TOK_SUCCESS) { - return (const struct race *)token.v; - } - return NULL; -} - int findoption(const char *s, const struct locale *lang) { void **tokens = get_translations(lang, UT_OPTIONS); @@ -364,60 +250,29 @@ unit *getnewunit(const region * r, const faction * f) return findnewunit(r, f, n); } -/* - Namen der Strukturen -------------------------------------- */ -char *untilde(char *ibuf) -{ - char *p = ibuf; - - while (*p) { - if (*p == '~') { - *p = ' '; - } - ++p; - } - return ibuf; -} - -building *largestbuilding(const region * r, cmp_building_cb cmp_gt, - bool imaginary) -{ - building *b, *best = NULL; - - for (b = rbuildings(r); b; b = b->next) { - if (cmp_gt(b, best) <= 0) - continue; - if (!imaginary) { - const attrib *a = a_find(b->attribs, &at_icastle); - if (a) - continue; - } - best = b; - } - return best; -} /* -- Erschaffung neuer Einheiten ------------------------------ */ static const char *forbidden[] = { "t", "te", "tem", "temp", NULL }; // PEASANT: "b", "ba", "bau", "baue", "p", "pe", "pea", "peas" +static int *forbidden_ids; int forbiddenid(int id) { - static int *forbid = NULL; static size_t len; size_t i; if (id <= 0) return 1; - if (!forbid) { + if (!forbidden_ids) { while (forbidden[len]) ++len; - forbid = calloc(len, sizeof(int)); + forbidden_ids = calloc(len, sizeof(int)); for (i = 0; i != len; ++i) { - forbid[i] = atoi36(forbidden[i]); + forbidden_ids[i] = atoi36(forbidden[i]); } } for (i = 0; i != len; ++i) - if (id == forbid[i]) + if (id == forbidden_ids[i]) return 1; return 0; } @@ -442,13 +297,6 @@ int newcontainerid(void) return random_no; } -int maxworkingpeasants(const struct region *r) -{ - int size = production(r); - int treespace = (rtrees(r, 2) + rtrees(r, 1) / 2) * TREESIZE; - return _max(size - treespace, _min(size / 10, 200)); -} - static const char * parameter_key(int i) { assert(i < MAXPARAMS && i >= 0); @@ -471,7 +319,7 @@ void init_terrains_translation(const struct locale *lang) { var.v = (void *)terrain; name = locale_string(lang, terrain->_name, false); if (name) { - addtoken(tokens, name, var); + addtoken((struct tnode **)tokens, name, var); } else { log_debug("no translation for terrain %s in locale %s", terrain->_name, locale_name(lang)); @@ -490,7 +338,7 @@ void init_options_translation(const struct locale * lang) { if (options[i]) { const char *name = locale_string(lang, options[i], false); if (name) { - addtoken(tokens, name, var); + addtoken((struct tnode **)tokens, name, var); } else { log_debug("no translation for OPTION %s in locale %s", options[i], locale_name(lang)); @@ -525,7 +373,7 @@ void init_locale(struct locale *lang) var.i = i; name = LOC(lang, mkname("school", tok)); if (name) { - addtoken(tokens, name, var); + addtoken((struct tnode **)tokens, name, var); } else { log_warning("no translation for magic school %s in locale %s", tok, locale_name(lang)); @@ -544,9 +392,9 @@ void init_locale(struct locale *lang) const char *name; var.v = (void *)rc; name = locale_string(lang, rc_name_s(rc, NAME_PLURAL), false); - if (name) addtoken(tokens, name, var); + if (name) addtoken((struct tnode **)tokens, name, var); name = locale_string(lang, rc_name_s(rc, NAME_SINGULAR), false); - if (name) addtoken(tokens, name, var); + if (name) addtoken((struct tnode **)tokens, name, var); } init_parameters(lang); @@ -688,7 +536,7 @@ static const char * relpath(char *buf, size_t sz, const char *path) { static const char *g_datadir; const char *datapath(void) { - static char zText[MAX_PATH]; // FIXME: static return value + static char zText[MAX_PATH]; if (g_datadir) return g_datadir; return relpath(zText, sizeof(zText), "data"); @@ -702,7 +550,7 @@ void set_datapath(const char *path) static const char *g_reportdir; const char *reportpath(void) { - static char zText[MAX_PATH]; // FIXME: static return value + static char zText[MAX_PATH]; if (g_reportdir) return g_reportdir; return relpath(zText, sizeof(zText), "reports"); @@ -729,7 +577,7 @@ int create_directories(void) { double get_param_flt(const struct param *p, const char *key, double def) { - const char *str = get_param(p, key); + const char *str = p ? get_param(p, key) : NULL; return str ? atof(str) : def; } @@ -738,268 +586,84 @@ void kernel_done(void) /* calling this function releases memory assigned to static variables, etc. * calling it is optional, e.g. a release server will most likely not do it. */ - translation_done(); - free_attribs(); -} - -#ifndef HAVE_STRDUP -char *_strdup(const char *s) -{ - return strcpy((char *)malloc(sizeof(char) * (strlen(s) + 1)), s); -} +#ifdef USE_LIBXML2 + xml_done(); #endif - -/* Lohn bei den einzelnen Burgstufen für Normale Typen, Orks, Bauern, - * Modifikation für Städter. */ - -static const int wagetable[7][4] = { - { 10, 10, 11, -7 }, /* Baustelle */ - { 10, 10, 11, -5 }, /* Handelsposten */ - { 11, 11, 12, -3 }, /* Befestigung */ - { 12, 11, 13, -1 }, /* Turm */ - { 13, 12, 14, 0 }, /* Burg */ - { 14, 12, 15, 1 }, /* Festung */ - { 15, 13, 16, 2 } /* Zitadelle */ -}; - -int cmp_wage(const struct building *b, const building * a) -{ - const struct building_type *bt_castle = bt_find("castle"); - if (b->type == bt_castle) { - if (!a) - return 1; - if (b->size > a->size) - return 1; - if (b->size == a->size) - return 0; - } - return -1; -} - -bool is_owner_building(const struct building * b) -{ - region *r = b->region; - if (b->type->taxes && r->land && r->land->ownership) { - unit *u = building_owner(b); - return u && u->faction == r->land->ownership->owner; - } - return false; -} - -int cmp_taxes(const building * b, const building * a) -{ - faction *f = region_get_owner(b->region); - if (b->type->taxes) { - unit *u = building_owner(b); - if (!u) { - return -1; - } - else if (a) { - int newsize = buildingeffsize(b, false); - double newtaxes = b->type->taxes(b, newsize); - int oldsize = buildingeffsize(a, false); - double oldtaxes = a->type->taxes(a, oldsize); - - if (newtaxes < oldtaxes) - return -1; - else if (newtaxes > oldtaxes) - return 1; - else if (b->size < a->size) - return -1; - else if (b->size > a->size) - return 1; - else { - if (u && u->faction == f) { - u = building_owner(a); - if (u && u->faction == f) - return -1; - return 1; - } - } - } - else { - return 1; - } - } - return -1; -} - -int cmp_current_owner(const building * b, const building * a) -{ - faction *f = region_get_owner(b->region); - - assert(rule_region_owners()); - if (f && b->type->taxes) { - unit *u = building_owner(b); - if (!u || u->faction != f) - return -1; - if (a) { - int newsize = buildingeffsize(b, false); - double newtaxes = b->type->taxes(b, newsize); - int oldsize = buildingeffsize(a, false); - double oldtaxes = a->type->taxes(a, oldsize); - - if (newtaxes != oldtaxes) - return (newtaxes > oldtaxes) ? 1 : -1; - if (newsize != oldsize) - return newsize - oldsize; - return (b->size - a->size); - } - else { - return 1; - } - } - return -1; + attrib_done(); + item_done(); + message_done(); + equipment_done(); + reports_done(); + curses_done(); + crmessage_done(); + translation_done(); } bool rule_stealth_other(void) { - int rule = config_get_int("stealth.faction.other", 1); + static int rule, config; + if (config_changed(&config)) { + rule = config_get_int("stealth.faction.other", 1); + } return rule != 0; } bool rule_stealth_anon(void) { - int rule = config_get_int("stealth.faction.anon", 1); + static int rule, config; + if (config_changed(&config)) { + rule = config_get_int("stealth.faction.anon", 1); + } return rule != 0; } bool rule_region_owners(void) { - int rule = config_get_int("rules.region_owners", 0); + static int rule, config; + if (config_changed(&config)) { + rule = config_get_int("rules.region_owners", 0); + } return rule != 0; } int rule_blessed_harvest(void) { - int rule = config_get_int("rules.blessed_harvest.flags", - HARVEST_WORK); - assert(rule >= 0); + static int rule, config; + if (config_changed(&config)) { + rule = config_get_int("rules.blessed_harvest.flags", HARVEST_WORK); + assert(rule >= 0); + } return rule; } int rule_alliance_limit(void) { - int rule = config_get_int("rules.limit.alliance", 0); + static int cache_token; + static int rule = 0; + + if (config_changed(&cache_token)) { + rule = config_get_int("rules.limit.alliance", 0); + } assert(rule >= 0); return rule; } int rule_faction_limit(void) { - int rule = config_get_int("rules.limit.faction", 0); + static int cache_token; + static int rule = 0; + if (config_changed(&cache_token)) { + rule = config_get_int("rules.limit.faction", 0); + } assert(rule >= 0); return rule; } -static int -default_wage(const region * r, const faction * f, const race * rc, int in_turn) -{ - building *b = largestbuilding(r, &cmp_wage, false); - int esize = 0; - curse *c; - double wage; - attrib *a; - const building_type *artsculpture_type = bt_find("artsculpture"); - static const curse_type *drought_ct, *blessedharvest_ct; - static bool init; - - if (!init) { - init = true; - drought_ct = ct_find("drought"); - blessedharvest_ct = ct_find("blessedharvest"); - } - - if (b != NULL) { - /* TODO: this reveals imaginary castles */ - esize = buildingeffsize(b, false); - } - - if (f != NULL) { - int index = 0; - if (rc == get_race(RC_ORC) || rc == get_race(RC_SNOTLING)) { - index = 1; - } - wage = wagetable[esize][index]; - } - else { - if (is_mourning(r, in_turn)) { - wage = 10; - } - else if (fval(r->terrain, SEA_REGION)) { - wage = 11; - } - else if (fval(r, RF_ORCIFIED)) { - wage = wagetable[esize][1]; - } - else { - wage = wagetable[esize][2]; - } - if (rule_blessed_harvest() == HARVEST_WORK) { - /* E1 rules */ - wage += curse_geteffect(get_curse(r->attribs, blessedharvest_ct)); - } - } - - /* Artsculpture: Income +5 */ - for (b = r->buildings; b; b = b->next) { - if (b->type == artsculpture_type) { - wage += 5; - } - } - - /* Godcurse: Income -10 */ - if (curse_active(get_curse(r->attribs, ct_find("godcursezone")))) { - wage = _max(0, wage - 10); - } - - /* Bei einer Dürre verdient man nur noch ein Viertel */ - if (drought_ct) { - c = get_curse(r->attribs, drought_ct); - if (curse_active(c)) - wage /= curse_geteffect(c); - } - - a = a_find(r->attribs, &at_reduceproduction); - if (a) - wage = (wage * a->data.sa[0]) / 100; - - return (int)wage; -} - -static int -minimum_wage(const region * r, const faction * f, const race * rc, int in_turn) -{ - if (f && rc) { - return rc->maintenance; - } - return default_wage(r, f, rc, in_turn); -} - -/* Gibt Arbeitslohn für entsprechende Rasse zurück, oder für -* die Bauern wenn f == NULL. */ -int wage(const region * r, const faction * f, const race * rc, int in_turn) -{ - if (global.functions.wage) { - return global.functions.wage(r, f, rc, in_turn); - } - return default_wage(r, f, rc, in_turn); -} - -int lovar(double xpct_x2) -{ - int n = (int)(xpct_x2 * 500) + 1; - if (n == 0) - return 0; - return (rng_int() % n + rng_int() % n) / 1000; -} - void kernel_init(void) { register_reports(); mt_clear(); translation_init(); - register_function((pf_generic)minimum_wage, "minimum_wage"); } static order * defaults[MAXLOCALES]; @@ -1026,36 +690,30 @@ order *default_order(const struct locale *lang) return result ? copy_order(result) : 0; } -int entertainmoney(const region * r) -{ - double n; - - if (is_cursed(r->attribs, C_DEPRESSION, 0)) { - return 0; - } - - n = rmoney(r) / ENTERTAINFRACTION; - - if (is_cursed(r->attribs, C_GENEROUS, 0)) { - n *= get_curseeffect(r->attribs, C_GENEROUS, 0); - } - - return (int)n; -} - int rule_give(void) { - return config_get_int("rules.give.flags", GIVE_DEFAULT); -} - -bool markets_module(void) -{ - return (bool)config_get_int("modules.markets", 0); + static int config; + static int rule; + if (config_changed(&config)) { + rule = config_get_int("rules.give.flags", GIVE_DEFAULT); + } + return rule; } static struct param *configuration; +static int config_cache_key = 1; + +bool config_changed(int *cache_key) { + assert(cache_key); + if (config_cache_key != *cache_key) { + *cache_key = config_cache_key; + return true; + } + return false; +} void config_set(const char *key, const char *value) { + ++config_cache_key; set_param(&configuration, key, value); } @@ -1078,6 +736,7 @@ bool config_token(const char *key, const char *tok) { void free_config(void) { global.functions.wage = NULL; free_params(&configuration); + ++config_cache_key; } /** releases all memory associated with the game state. @@ -1087,7 +746,6 @@ void free_config(void) { void free_gamedata(void) { int i; - free_donations(); for (i = 0; i != MAXLOCALES; ++i) { if (defaults[i]) { @@ -1095,21 +753,25 @@ void free_gamedata(void) defaults[i] = 0; } } + free(forbidden_ids); + forbidden_ids = NULL; + + free_donations(); free_factions(); free_units(); free_regions(); free_borders(); free_alliances(); + while (global.attribs) { + a_remove(&global.attribs, global.attribs); + } + while (planes) { plane *pl = planes; planes = planes->next; free_plane(pl); } - - while (global.attribs) { - a_remove(&global.attribs, global.attribs); - } } const char * game_name(void) { diff --git a/src/kernel/config.h b/src/kernel/config.h index 081a96e61..91d5d576f 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -24,22 +24,16 @@ extern "C" { #endif /* this should always be the first thing included after platform.h */ +#include #include "types.h" struct param; -#define DISPLAYSIZE 8192 /* max. Länge einer Beschreibung, incl trailing 0 */ +#define DISPLAYSIZE 8192 /* max. L�nge einer Beschreibung, incl trailing 0 */ #define ORDERSIZE (DISPLAYSIZE*2) /* max. length of an order */ -#define NAMESIZE 128 /* max. Länge eines Namens, incl trailing 0 */ -#define IDSIZE 16 /* max. Länge einer no (als String), incl trailing 0 */ -#define OBJECTIDSIZE (NAMESIZE+5+IDSIZE) /* max. Länge der Strings, die - * von struct unitname, etc. zurückgegeben werden. ohne die 0 */ - - /* ----------------- Befehle ----------------------------------- */ - -#define want(option) (1<flags & (i)) #define fset(u, i) ((u)->flags |= (i)) @@ -52,35 +46,15 @@ struct param; bool isparam(const char *s, const struct locale * lang, param_t param); param_t getparam(const struct locale *lang); -#define unitid(x) itoa36((x)->no) - -#define buildingid(x) itoa36((x)->no) -#define shipid(x) itoa36((x)->no) -#define factionid(x) itoa36((x)->no) -#define curseid(x) itoa36((x)->no) - const char * game_name(void); int game_id(void); - int lovar(double xpct_x2); /* returns a value between [0..xpct_2], generated with two dice */ - int distribute(int old, int new_value, int n); void init_locale(struct locale *lang); int forbiddenid(int id); int newcontainerid(void); - char *untilde(char *s); - - typedef int(*cmp_building_cb) (const struct building * b, - const struct building * a); - struct building *largestbuilding(const struct region *r, cmp_building_cb, - bool imaginary); - int cmp_wage(const struct building *b, const struct building *bother); - int cmp_taxes(const struct building *b, const struct building *bother); - int cmp_current_owner(const struct building *b, - const struct building *bother); - bool rule_region_owners(void); bool rule_stealth_other(void); // units can pretend to be another faction, TARNE PARTEI bool rule_stealth_anon(void); // units can anonymize their faction, TARNE PARTEI [NICHT] @@ -99,8 +73,6 @@ struct param; #define GIVE_DEFAULT (GIVE_SELF|GIVE_PEASANTS|GIVE_LUXURIES|GIVE_HERBS|GIVE_GOODS) int rule_give(void); - const struct race *findrace(const char *, const struct locale *); - /* grammatik-flags: */ #define GF_NONE 0 /* singular, ohne was dran */ @@ -111,34 +83,10 @@ struct param; #define GF_SPECIFIC 16 /* der, die, das vs. ein, eine */ #define GF_DETAILED 32 - /* mehr Informationen. z.b. straße zu 50% */ + /* mehr Informationen. z.b. stra�e zu 50% */ #define GF_PURE 64 /* untranslated */ -#define GUARD_NONE 0 -#define GUARD_TAX 1 - /* Verhindert Steuereintreiben */ -#define GUARD_MINING 2 - /* Verhindert Bergbau */ -#define GUARD_TREES 4 - /* Verhindert Waldarbeiten */ -#define GUARD_TRAVELTHRU 8 - /* Blockiert Durchreisende */ -#define GUARD_LANDING 16 - /* Verhindert Ausstieg + Weiterreise */ -#define GUARD_CREWS 32 - /* Verhindert Unterhaltung auf Schiffen */ -#define GUARD_RECRUIT 64 - /* Verhindert Rekrutieren */ -#define GUARD_PRODUCE 128 - /* Verhindert Abbau von Resourcen mit RTF_LIMITED */ -#define GUARD_ALL 0xFFFF - - int maxworkingpeasants(const struct region *r); - bool markets_module(void); - int wage(const struct region *r, const struct faction *f, - const struct race *rc, int in_turn); - const char *datapath(void); void set_datapath(const char *path); @@ -159,7 +107,6 @@ struct param; struct attrib *attribs; unsigned int data_turn; void *vm_state; - int data_version; /* TODO: eliminate in favor of gamedata.version */ struct _dictionary_ *inifile; struct global_functions { int(*wage) (const struct region * r, const struct faction * f, @@ -167,11 +114,6 @@ struct param; } functions; } settings; - typedef struct helpmode { - const char *name; - int status; - } helpmode; - void set_param(struct param **p, const char *key, const char *value); const char *get_param(const struct param *p, const char *key); int get_param_int(const struct param *p, const char *key, int def); @@ -184,34 +126,22 @@ struct param; int config_get_int(const char *key, int def); double config_get_flt(const char *key, double def); bool config_token(const char *key, const char *tok); + bool config_changed(int *cache_key); char * join_path(const char *p1, const char *p2, char *dst, size_t len); - bool ExpensiveMigrants(void); - int NMRTimeout(void); - int LongHunger(const struct unit *u); - int NewbieImmunity(void); - bool IsImmune(const struct faction *f); struct order *default_order(const struct locale *lang); - int entertainmoney(const struct region *r); void init_parameters(struct locale *lang); void free_gamedata(void); void free_config(void); - extern struct helpmode helpmodes[]; extern const char *parameters[]; - extern const char *localenames[]; extern settings global; - extern bool battledebug; - extern bool sqlpatch; extern bool lomem; /* save memory */ extern int turn; - extern bool getunitpeasants; - - extern const char *options[MAXOPTIONS]; /* report options */ #ifdef __cplusplus } diff --git a/src/kernel/config.test.c b/src/kernel/config.test.c index d5b46581c..405587443 100644 --- a/src/kernel/config.test.c +++ b/src/kernel/config.test.c @@ -21,7 +21,7 @@ static void test_read_unitid(CuTest *tc) { struct locale *lang; struct terrain_type *t_plain; - test_cleanup(); + test_setup(); lang = test_create_locale(); /* note that the english order is FIGHT, not COMBAT, so this is a poor example */ t_plain = test_create_terrain("plain", LAND_REGION); @@ -66,7 +66,7 @@ static void test_getunit(CuTest *tc) { struct locale *lang; struct terrain_type *t_plain; - test_cleanup(); + test_setup(); lang = test_create_locale(); /* note that the english order is FIGHT, not COMBAT, so this is a poor example */ t_plain = test_create_terrain("plain", LAND_REGION); @@ -122,7 +122,7 @@ static void test_getunit(CuTest *tc) { static void test_get_set_param(CuTest * tc) { struct param *par = 0; - test_cleanup(); + test_setup(); CuAssertStrEquals(tc, 0, get_param(par, "foo")); set_param(&par, "foo", "bar"); set_param(&par, "bar", "foo"); @@ -139,7 +139,7 @@ static void test_get_set_param(CuTest * tc) static void test_param_int(CuTest * tc) { struct param *par = 0; - test_cleanup(); + test_setup(); CuAssertIntEquals(tc, 13, get_param_int(par, "foo", 13)); set_param(&par, "foo", "23"); set_param(&par, "bar", "42"); @@ -152,7 +152,7 @@ static void test_param_int(CuTest * tc) static void test_param_flt(CuTest * tc) { struct param *par = 0; - test_cleanup(); + test_setup(); CuAssertDblEquals(tc, 13, get_param_flt(par, "foo", 13), 0.01); set_param(&par, "foo", "23.0"); set_param(&par, "bar", "42.0"); @@ -176,22 +176,67 @@ static void test_default_order(CuTest *tc) { order *ord; struct locale * loc; - test_cleanup(); + test_setup(); loc = test_create_locale(); ord = default_order(loc); CuAssertPtrEquals(tc, 0, ord); + free_order(ord); config_set("orders.default", "work"); ord = default_order(loc); CuAssertPtrNotNull(tc, ord); CuAssertIntEquals(tc, K_WORK, getkeyword(ord)); - CuAssertPtrEquals(tc, ord->data, default_order(loc)->data); + free_order(ord); test_cleanup(); } +static void test_config_cache(CuTest *tc) { + int key = 0; + + test_setup(); + CuAssertTrue(tc, config_changed(&key)); + config_set("hodor", "0"); + CuAssertTrue(tc, config_changed(&key)); + CuAssertTrue(tc, !config_changed(&key)); + free_config(); + CuAssertTrue(tc, config_changed(&key)); + test_cleanup(); +} + +static void test_rules(CuTest *tc) { + CuAssertIntEquals(tc, HARVEST_WORK, rule_blessed_harvest()); + config_set("rules.blessed_harvest.flags", "15"); + CuAssertIntEquals(tc, 15, rule_blessed_harvest()); + + CuAssertTrue(tc, !rule_region_owners()); + config_set("rules.region_owners", "1"); + CuAssertTrue(tc, rule_region_owners()); + + CuAssertTrue(tc, rule_stealth_anon()); + config_set("stealth.faction.anon", "0"); + CuAssertTrue(tc, !rule_stealth_anon()); + + CuAssertTrue(tc, rule_stealth_other()); + config_set("stealth.faction.other", "0"); + CuAssertTrue(tc, !rule_stealth_other()); + + CuAssertIntEquals(tc, GIVE_DEFAULT, rule_give()); + config_set("rules.give.flags", "15"); + CuAssertIntEquals(tc, 15, rule_give()); + + CuAssertIntEquals(tc, 0, rule_alliance_limit()); + config_set("rules.limit.alliance", "1"); + CuAssertIntEquals(tc, 1, rule_alliance_limit()); + + CuAssertIntEquals(tc, 0, rule_faction_limit()); + config_set("rules.limit.faction", "1000"); + CuAssertIntEquals(tc, 1000, rule_faction_limit()); +} + CuSuite *get_config_suite(void) { CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_config_cache); SUITE_ADD_TEST(suite, test_get_set_param); SUITE_ADD_TEST(suite, test_param_int); SUITE_ADD_TEST(suite, test_param_flt); @@ -199,5 +244,6 @@ CuSuite *get_config_suite(void) SUITE_ADD_TEST(suite, test_getunit); SUITE_ADD_TEST(suite, test_read_unitid); SUITE_ADD_TEST(suite, test_default_order); + SUITE_ADD_TEST(suite, test_rules); return suite; } diff --git a/src/kernel/connection.c b/src/kernel/connection.c index ef86f9a3a..6eccf1f0c 100644 --- a/src/kernel/connection.c +++ b/src/kernel/connection.c @@ -21,10 +21,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "connection.h" #include "region.h" -#include "save.h" #include "terrain.h" #include "unit.h" -#include "version.h" #include #include @@ -213,7 +211,7 @@ border_type *find_bordertype(const char *name) { border_type *bt = bordertypes; - while (bt && strcmp(bt->__name, name)) + while (bt && strcmp(bt->__name, name)!=0) bt = bt->next; return bt; } @@ -622,7 +620,6 @@ int read_borders(gamedata *data) assert(type || !"connection type not registered"); } - READ_INT(store, &bid); if (data->version < UIDHASH_VERSION) { int fx, fy, tx, ty; @@ -641,9 +638,7 @@ int read_borders(gamedata *data) to = findregionbyid(tid); } if (!to || !from) { - if (!to || !from) { - log_error("%s connection %d has missing regions", zText, bid); - } + log_error("%s connection %d has missing regions", zText, bid); if (type->read) { // skip ahead connection dummy; @@ -652,7 +647,7 @@ int read_borders(gamedata *data) continue; } - if (to == from && type && from) { + if (to == from && from) { direction_t dir = (direction_t)(rng_int() % MAXDIRECTIONS); region *r = rconnect(from, dir); log_error("[read_borders] invalid %s in %s\n", type->__name, regionname(from, NULL)); @@ -661,7 +656,7 @@ int read_borders(gamedata *data) } if (type->read) { connection *b = new_border(type, from, to); - nextborder--; /* new_border erhöht den Wert */ + nextborder--; /* new_border erh�ht den Wert */ b->id = bid; assert(bid <= nextborder); type->read(b, data); diff --git a/src/kernel/curse.c b/src/kernel/curse.c index d545bfd71..123f858f5 100644 --- a/src/kernel/curse.c +++ b/src/kernel/curse.c @@ -30,7 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "ship.h" #include "skill.h" #include "unit.h" -#include "version.h" /* util includes */ #include @@ -98,15 +97,6 @@ static void cunhash(curse * c) } } -curse *cfindhash(int i) -{ - curse *old; - - for (old = cursehash[i % MAXENTITYHASH]; old; old = old->nexthash) - if (old->no == i) - return old; - return NULL; -} /* ------------------------------------------------------------- */ /* at_curse */ void curse_init(attrib * a) @@ -301,6 +291,17 @@ attrib_type at_curse = { #define MAXCTHASH 128 static quicklist *cursetypes[MAXCTHASH]; +static int ct_changes = 1; + +bool ct_changed(int *cache) +{ + assert(cache); + if (*cache != ct_changes) { + *cache = ct_changes; + return true; + } + return false; +} void ct_register(const curse_type * ct) { @@ -308,6 +309,27 @@ void ct_register(const curse_type * ct) quicklist **ctlp = cursetypes + hash; ql_set_insert(ctlp, (void *)ct); + ++ct_changes; +} + +void ct_remove(const char *c) +{ + unsigned int hash = tolower(c[0]); + quicklist *ctl = cursetypes[hash]; + + if (ctl) { + int qi; + + for (qi = 0; ctl; ql_advance(&ctl, &qi, 1)) { + curse_type *type = (curse_type *)ql_get(ctl, qi); + + if (strcmp(c, type->cname) == 0) { + ql_delete(&ctl, qi); + ++ct_changes; + break; + } + } + } } const curse_type *ct_find(const char *c) @@ -327,7 +349,7 @@ const curse_type *ct_find(const char *c) } else { size_t k = _min(c_len, strlen(type->cname)); - if (!_memicmp(c, type->cname, k)) { + if (!memcmp(c, type->cname, k)) { return type; } } @@ -500,6 +522,24 @@ static void set_cursedmen(curse * c, int cursedmen) } } +static int newcurseid(void) { + int random_no; + int start_random_no; + random_no = 1 + (rng_int() % MAX_UNIT_NR); + start_random_no = random_no; + + while (findcurse(random_no)) { + random_no++; + if (random_no == MAX_UNIT_NR + 1) { + random_no = 1; + } + if (random_no == start_random_no) { + random_no = (int)MAX_UNIT_NR + 1; + } + } + return random_no; +} + /* ------------------------------------------------------------- */ /* Legt eine neue Verzauberung an. Sollte es schon einen Zauber * dieses Typs geben, gibt es den bestehenden zurück. @@ -521,7 +561,7 @@ static curse *make_curse(unit * mage, attrib ** ap, const curse_type * ct, c->effect = effect; c->magician = mage; - c->no = newunitid(); + c->no = newcurseid(); chash(c); switch (c->type->typ) { @@ -785,7 +825,7 @@ double destr_curse(curse * c, int cast_level, double force) c->type->change_vigour(c, -(cast_level + 1) / 2); } else { - c->vigour -= cast_level + 1 / 2; + c->vigour -= (cast_level + 1) / 2.0; } } } @@ -808,5 +848,7 @@ void curses_done(void) { int i; for (i = 0; i != MAXCTHASH; ++i) { ql_free(cursetypes[i]); + cursetypes[i] = 0; } + ++ct_changes; } diff --git a/src/kernel/curse.h b/src/kernel/curse.h index 534a936e3..29498f4d2 100644 --- a/src/kernel/curse.h +++ b/src/kernel/curse.h @@ -30,6 +30,8 @@ extern "C" { struct curse_type; struct gamedata; struct storage; + struct attrib; + struct faction; /* Sprueche in der struct region und auf Einheiten, Schiffen oder Burgen * (struct attribute) @@ -280,12 +282,12 @@ extern "C" { * */ struct curse *get_curse(struct attrib *ap, const curse_type * ctype); - int find_cursebyname(const char *c); const curse_type *ct_find(const char *c); + bool ct_changed(int *cache); void ct_register(const curse_type *); + void ct_remove(const char *c); void ct_checknames(void); - curse *cfindhash(int i); curse *findcurse(int curseid); void curse_init(struct attrib *a); @@ -305,7 +307,7 @@ extern "C" { const struct curse *c, int self); int curse_cansee(const struct curse *c, const struct faction *viewer, objtype_t typ, const void *obj, int self); #define is_cursed(a, id, id2) \ - curse_active(get_curse(a, ct_find(oldcursename(id)))) + (a && curse_active(get_curse(a, ct_find(oldcursename(id))))) #define get_curseeffect(a, id, id2) \ curse_geteffect(get_curse(a, ct_find(oldcursename(id)))) diff --git a/src/kernel/curse.test.c b/src/kernel/curse.test.c index 2be81b19c..0ca4510d9 100644 --- a/src/kernel/curse.test.c +++ b/src/kernel/curse.test.c @@ -4,8 +4,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -158,15 +158,73 @@ static void test_write_flag(CuTest *tc) { cleanup_curse(&fix); } +static void test_curse_cache(CuTest *tc) +{ + int cache = 0; + const curse_type ct_dummy = { "dummy", CURSETYP_NORM, 0, M_SUMEFFECT, NULL }; + test_setup(); + CuAssertIntEquals(tc, true, ct_changed(&cache)); + CuAssertIntEquals(tc, false, ct_changed(&cache)); + CuAssertPtrEquals(tc, NULL, (void *)ct_find(ct_dummy.cname)); + ct_register(&ct_dummy); + CuAssertIntEquals(tc, true, ct_changed(&cache)); + CuAssertPtrEquals(tc, (void *)&ct_dummy, (void *)ct_find(ct_dummy.cname)); + ct_remove(ct_dummy.cname); + CuAssertIntEquals(tc, true, ct_changed(&cache)); + CuAssertIntEquals(tc, false, ct_changed(&cache)); + CuAssertPtrEquals(tc, NULL, (void *)ct_find(ct_dummy.cname)); + test_cleanup(); +} + +static void test_curse_ids(CuTest *tc) { + const curse_type ct_dummy = { "dummy", CURSETYP_NORM, 0, M_SUMEFFECT, NULL }; + curse *c1, *c2; + attrib *a1 = 0, *a2 = 0; + + test_setup(); + rng_init(0); + c1 = create_curse(NULL, &a1, &ct_dummy, 1, 1, 1, 1); + rng_init(0); + c2 = create_curse(NULL, &a2, &ct_dummy, 1, 1, 1, 1); + CuAssertTrue(tc, c1->no != c2->no); + a_remove(&a1, a1); + a_remove(&a2, a2); + test_cleanup(); +} + +static void test_curse_flags(CuTest *tc) { + const curse_type ct_dummy = { "dummy", CURSETYP_NORM, 0, M_SUMEFFECT, NULL }; + curse *c1, *c2; + unit *u; + + test_setup(); + u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); + c1 = create_curse(u, &u->attribs, &ct_dummy, 1, 1, 1, 0); + CuAssertPtrEquals(tc, u, c1->magician); + CuAssertIntEquals(tc, 1, (int)c1->effect); + CuAssertIntEquals(tc, 1, (int)c1->vigour); + CuAssertIntEquals(tc, 1, c1->duration); + c2 = create_curse(u, &u->attribs, &ct_dummy, 1, 1, 1, 0); + CuAssertPtrEquals(tc, c1, c2); + CuAssertPtrEquals(tc, u, c1->magician); + CuAssertIntEquals(tc, 2, (int)c1->effect); + CuAssertIntEquals(tc, 1, (int)c1->vigour); + CuAssertIntEquals(tc, 1, c1->duration); + test_cleanup(); +} + CuSuite *get_curse_suite(void) { CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_curse); + SUITE_ADD_TEST(suite, test_curse_cache); SUITE_ADD_TEST(suite, test_magicstreet); SUITE_ADD_TEST(suite, test_magicstreet_warning); SUITE_ADD_TEST(suite, test_good_dreams); SUITE_ADD_TEST(suite, test_bad_dreams); SUITE_ADD_TEST(suite, test_memstream); SUITE_ADD_TEST(suite, test_write_flag); + SUITE_ADD_TEST(suite, test_curse_flags); + SUITE_ADD_TEST(suite, test_curse_ids); return suite; } diff --git a/src/kernel/equipment.c b/src/kernel/equipment.c index 1511e2865..8266ada9a 100644 --- a/src/kernel/equipment.c +++ b/src/kernel/equipment.c @@ -25,7 +25,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "unit.h" #include "faction.h" #include "race.h" -#include "spellbook.h" +#include "spell.h" /* util includes */ #include @@ -86,13 +86,20 @@ void equipment_setskill(equipment * eq, skill_t sk, const char *value) } } -void equipment_addspell(equipment * eq, struct spell * sp, int level) +typedef struct lazy_spell { + char *name; + struct spell *sp; + int level; +} lazy_spell; + +void equipment_addspell(equipment * eq, const char * name, int level) { if (eq) { - if (!eq->spellbook) { - eq->spellbook = create_spellbook(0); - } - spellbook_add(eq->spellbook, sp, level); + lazy_spell *ls = malloc(sizeof(lazy_spell)); + ls->sp = NULL; + ls->level = level; + ls->name = _strdup(name); + ql_push(&eq->spells, ls); } } @@ -148,13 +155,18 @@ void equip_unit_mask(struct unit *u, const struct equipment *eq, int mask) } if (mask & EQUIP_SPELLS) { - if (eq->spellbook) { - quicklist * ql = eq->spellbook->spells; + if (eq->spells) { + quicklist * ql = eq->spells; int qi; sc_mage * mage = get_mage(u); for (qi = 0; ql; ql_advance(&ql, &qi, 1)) { - spellbook_entry *sbe = (spellbook_entry *)ql_get(ql, qi); + lazy_spell *sbe = (lazy_spell *)ql_get(ql, qi); + if (!sbe->sp) { + sbe->sp = find_spell(sbe->name); + free(sbe->name); + sbe->name = NULL; + } unit_add_spell(u, mage, sbe->sp, sbe->level); } } @@ -223,3 +235,34 @@ void equip_items(struct item **items, const struct equipment *eq) } } } + +void free_ls(void *arg) { + lazy_spell *ls = (lazy_spell*)arg; + free(ls->name); + free(ls); +} + +void equipment_done(void) { + equipment **eqp = &equipment_sets; + while (*eqp) { + int i; + equipment *eq = *eqp; + *eqp = eq->next; + free(eq->name); + if (eq->spells) { + ql_foreach(eq->spells, free_ls); + ql_free(eq->spells); + } + while (eq->items) { + itemdata *next = eq->items->next; + free(eq->items->value); + free(eq->items); + eq->items = next; + } + // TODO: subsets, skills + for (i=0;i!=MAXSKILLS;++i) { + free(eq->skills[i]); + } + free(eq); + } +} diff --git a/src/kernel/equipment.h b/src/kernel/equipment.h index 0bda6dc7d..5c7b3407b 100644 --- a/src/kernel/equipment.h +++ b/src/kernel/equipment.h @@ -48,12 +48,14 @@ extern "C" { char *name; struct itemdata *items; char *skills[MAXSKILLS]; - struct spellbook *spellbook; + struct quicklist *spells; struct subset *subsets; struct equipment *next; void(*callback) (const struct equipment *, struct unit *); } equipment; + void equipment_done(void); + struct equipment *create_equipment(const char *eqname); struct equipment *get_equipment(const char *eqname); @@ -61,7 +63,7 @@ extern "C" { const struct item_type *itype, const char *value); void equipment_setskill(struct equipment *eq, skill_t sk, const char *value); - void equipment_addspell(struct equipment *eq, struct spell *sp, int level); + void equipment_addspell(struct equipment *eq, const char *name, int level); void equipment_setcallback(struct equipment *eq, void(*callback) (const struct equipment *, struct unit *)); diff --git a/src/kernel/equipment.test.c b/src/kernel/equipment.test.c index f0543ad8c..2911af1ea 100644 --- a/src/kernel/equipment.test.c +++ b/src/kernel/equipment.test.c @@ -20,7 +20,7 @@ void test_equipment(CuTest * tc) spell *sp; sc_mage * mage; - test_cleanup(); + test_setup(); test_create_race("human"); enable_skill(SK_MAGIC, true); it_horses = test_create_itemtype("horse"); @@ -34,9 +34,9 @@ void test_equipment(CuTest * tc) equipment_setitem(eq, it_horses, "1"); equipment_setskill(eq, SK_MAGIC, "5"); - equipment_addspell(eq, sp, 1); + equipment_addspell(eq, sp->sname, 1); - u = test_create_unit(test_create_faction(0), 0); + u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); equip_unit_mask(u, eq, EQUIP_ALL); CuAssertIntEquals(tc, 1, i_get(u->items, it_horses)); CuAssertIntEquals(tc, 5, get_level(u, SK_MAGIC)); @@ -45,6 +45,7 @@ void test_equipment(CuTest * tc) CuAssertPtrNotNull(tc, mage); CuAssertPtrNotNull(tc, mage->spellbook); CuAssertTrue(tc, u_hasspell(u, sp)); + test_cleanup(); } CuSuite *get_equipment_suite(void) diff --git a/src/kernel/faction.c b/src/kernel/faction.c index c1429f4f3..d332bf604 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -29,11 +29,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "plane.h" #include "race.h" #include "region.h" -#include "save.h" #include "spellbook.h" #include "terrain.h" #include "unit.h" -#include "version.h" /* util includes */ #include @@ -50,7 +48,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include @@ -262,6 +259,7 @@ faction *addfaction(const char *email, const char *password, f->magiegebiet = 0; f->locale = loc; f->subscription = subscription; + f->flags = FFL_ISNEW; f->options = want(O_REPORT) | want(O_ZUGVORLAGE) | want(O_COMPUTER) | want(O_COMPRESS) | @@ -275,11 +273,11 @@ faction *addfaction(const char *email, const char *password, addlist(&factions, f); fhash(f); - slprintf(buf, sizeof(buf), "%s %s", LOC(loc, "factiondefault"), factionid(f)); + slprintf(buf, sizeof(buf), "%s %s", LOC(loc, "factiondefault"), itoa36(f->no)); f->name = _strdup(buf); if (!f->race) { - log_warning("creating a faction that has no race", factionid(f)); + log_warning("creating a faction that has no race", itoa36(f->no)); } return f; @@ -301,7 +299,7 @@ unit *addplayer(region * r, faction * f) fset(u, UFL_ISNEW); if (f->race == get_race(RC_DAEMON)) { race_t urc; - race *rc; + const race *rc; do { urc = (race_t)(rng_int() % MAXRACES); rc = get_race(urc); @@ -336,8 +334,6 @@ void write_faction_reference(const faction * f, struct storage *store) WRITE_INT(store, f ? f->no : 0); } -static faction *dead_factions; - void free_flist(faction **fp) { faction * flist = *fp; while (flist) { @@ -349,10 +345,7 @@ void free_flist(faction **fp) { *fp = 0; } -void free_factions(void) { - free_flist(&factions); - free_flist(&dead_factions); -} +static faction *dead_factions; void destroyfaction(faction ** fp) { @@ -392,19 +385,14 @@ void destroyfaction(faction ** fp) const race *rc = u_race(u); int m = rmoney(r); + /* Personen gehen nur an die Bauern, wenn sie auch von dort + * stammen */ if ((rc->ec_flags & ECF_REC_ETHEREAL) == 0) { int p = rpeasants(u->region); int h = rhorses(u->region); item *itm; - /* Personen gehen nur an die Bauern, wenn sie auch von dort - * stammen */ - if (rc->ec_flags & ECF_REC_HORSES) { /* Zentauren an die Pferde */ - h += u->number; - } - else { /* Orks zählen nur zur Hälfte */ - p += (int)(u->number * rc->recruit_multi); - } + p += (int)(u->number * rc->recruit_multi); for (itm = u->items; itm; itm = itm->next) { if (itm->type->flags & ITF_ANIMAL) { h += itm->number; @@ -514,7 +502,6 @@ void renumber_faction(faction * f, int no) fset(f, FFL_NEWID); } -#ifdef SMART_INTERVALS void update_interval(struct faction *f, struct region *r) { if (r == NULL || f == NULL) @@ -526,7 +513,6 @@ void update_interval(struct faction *f, struct region *r) f->last = r; } } -#endif const char *faction_getname(const faction * self) { @@ -803,49 +789,27 @@ attrib_type at_maxmagicians = { int max_magicians(const faction * f) { - int m = config_get_int("rules.maxskills.magic", MAXMAGICIANS); - attrib *a; + static int rule, config, rc_cache; + static const race *rc_elf; + int m; - if ((a = a_find(f->attribs, &at_maxmagicians)) != NULL) { - m = a->data.i; + if (config_changed(&config)) { + rule = config_get_int("rules.maxskills.magic", MAXMAGICIANS); } - if (f->race == get_race(RC_ELF)) - ++m; - return m; -} - -#define DMAXHASH 7919 -typedef struct dead { - struct dead *nexthash; - faction *f; - int no; -} dead; - -static dead *deadhash[DMAXHASH]; - -void dhash(int no, faction * f) -{ - dead *hash = (dead *)calloc(1, sizeof(dead)); - dead *old = deadhash[no % DMAXHASH]; - hash->no = no; - hash->f = f; - deadhash[no % DMAXHASH] = hash; - hash->nexthash = old; -} - -faction *dfindhash(int no) -{ - dead *old; - - if (no < 0) - return 0; - - for (old = deadhash[no % DMAXHASH]; old; old = old->nexthash) { - if (old->no == no) { - return old->f; + m = rule; + if (f->attribs) { + attrib *a = a_find(f->attribs, &at_maxmagicians); + if (a) { + m = a->data.i; } } - return 0; + if (rc_changed(&rc_cache)) { + rc_elf = get_race(RC_ELF); + } + if (f->race == rc_elf) { + ++m; + } + return m; } int writepasswd(void) @@ -863,8 +827,8 @@ int writepasswd(void) log_info("writing passwords..."); for (f = factions; f; f = f->next) { - fprintf(F, "%s:%s:%s:%u\n", - factionid(f), f->email, f->_password, f->subscription); + fprintf(F, "%s:%s:%s:%d\n", + itoa36(f->no), f->email, f->_password, f->subscription); } fclose(F); return 0; @@ -872,3 +836,18 @@ int writepasswd(void) return 1; } +void free_factions(void) { +#ifdef DMAXHASH + int i; + for (i = 0; i != DMAXHASH; ++i) { + while (deadhash[i]) { + dead *d = deadhash[i]; + deadhash[i] = d->nexthash; + free(d); + } + } +#endif + free_flist(&factions); + free_flist(&dead_factions); +} + diff --git a/src/kernel/faction.h b/src/kernel/faction.h index 5f7e1f91f..82ae89ea4 100644 --- a/src/kernel/faction.h +++ b/src/kernel/faction.h @@ -33,36 +33,29 @@ extern "C" { struct gamedata; extern struct attrib_type at_maxmagicians; - /* SMART_INTERVALS: define to speed up finding the interval of regions that a - faction is in. defining this speeds up the turn by 30-40% */ -#define SMART_INTERVALS /* faction flags */ #define FFL_NEWID (1<<0) /* Die Partei hat bereits einmal ihre no gewechselt */ #define FFL_ISNEW (1<<1) -#define FFL_RESTART (1<<2) #define FFL_QUIT (1<<3) #define FFL_CURSED (1<<4) /* you're going to have a bad time */ #define FFL_DEFENDER (1<<10) #define FFL_SELECT (1<<18) /* ehemals f->dh, u->dh, r->dh, etc... */ #define FFL_NOAID (1<<21) /* Hilfsflag Kampf */ -#define FFL_MARK (1<<23) /* für markierende algorithmen, die das - * hinterher auch wieder löschen müssen! +#define FFL_MARK (1<<23) /* f�r markierende algorithmen, die das + * hinterher auch wieder l�schen m�ssen! * (FFL_SELECT muss man vorher initialisieren, - * FL_MARK hinterher löschen) */ + * FL_MARK hinterher l�schen) */ #define FFL_NOIDLEOUT (1<<24) /* Partei stirbt nicht an NMRs */ #define FFL_NPC (1<<25) /* eine Partei mit Monstern */ -#define FFL_DBENTRY (1<<28) /* Partei ist in Datenbank eingetragen */ -#define FFL_SAVEMASK (FFL_DEFENDER|FFL_NEWID|FFL_NPC|FFL_DBENTRY|FFL_NOIDLEOUT|FFL_CURSED) +#define FFL_SAVEMASK (FFL_DEFENDER|FFL_NEWID|FFL_NPC|FFL_NOIDLEOUT|FFL_CURSED) typedef struct faction { struct faction *next; struct faction *nexthash; -#ifdef SMART_INTERVALS struct region *first; struct region *last; -#endif int no; int subscription; int flags; @@ -102,13 +95,14 @@ extern "C" { struct message_list *msgs; } *battles; struct item *items; /* items this faction can claim */ - struct seen_region **seen; struct quicklist *seen_factions; bool _alive; /* enno: sollte ein flag werden */ } faction; extern struct faction *factions; +#define want(option) (1<locale); CuAssertIntEquals(tc, 1234, f->subscription); - CuAssertIntEquals(tc, 0, f->flags); + CuAssertIntEquals(tc, FFL_ISNEW, f->flags); CuAssertIntEquals(tc, 0, f->age); CuAssertTrue(tc, faction_alive(f)); CuAssertIntEquals(tc, M_GRAY, f->magiegebiet); diff --git a/src/kernel/group.c b/src/kernel/group.c index 19f816b13..8753531a3 100755 --- a/src/kernel/group.c +++ b/src/kernel/group.c @@ -23,9 +23,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* kernel includes */ #include "ally.h" #include "faction.h" -#include "save.h" #include "unit.h" -#include "version.h" /* attrib includes */ #include @@ -125,10 +123,14 @@ attrib_type at_group = { /* attribute for units assigned to a group */ void free_group(group * g) { - int index = g->gid % GMAXHASH; - group **g_ptr = ghash + index; - while (*g_ptr && (*g_ptr)->gid != g->gid) + int index; + group **g_ptr; + assert(g); + index = g->gid % GMAXHASH; + g_ptr = ghash + index; + while (*g_ptr && (*g_ptr)->gid != g->gid) { g_ptr = &(*g_ptr)->nexthash; + } assert(*g_ptr == g); *g_ptr = g->nexthash; diff --git a/src/kernel/group.test.c b/src/kernel/group.test.c index 7fa7fa234..78ee6b24f 100644 --- a/src/kernel/group.test.c +++ b/src/kernel/group.test.c @@ -7,7 +7,6 @@ #include "unit.h" #include "region.h" #include "save.h" -#include "version.h" #include #include @@ -83,7 +82,7 @@ static void test_group_readwrite(CuTest * tc) mstream_init(&data.strm); gamedata_init(&data, &store, RELEASE_VERSION); f = test_create_faction(0); - g = new_group(f, "NW", 42); + new_group(f, "NW", 42); g = new_group(f, "Egoisten", 43); key_set(&g->attribs, 44); al = ally_add(&g->allies, f); @@ -91,6 +90,7 @@ static void test_group_readwrite(CuTest * tc) write_groups(&store, f); WRITE_INT(&store, 47); + free_group(f->groups); free_group(g); f->groups = 0; data.strm.api->rewind(data.strm.handle); diff --git a/src/kernel/item.c b/src/kernel/item.c index 182e71fbe..53fff79ab 100644 --- a/src/kernel/item.c +++ b/src/kernel/item.c @@ -30,7 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "pool.h" #include "race.h" #include "region.h" -#include "save.h" #include "skill.h" #include "terrain.h" #include "unit.h" @@ -52,6 +51,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include +#include + /* libc includes */ #include #include @@ -238,7 +239,6 @@ item_type *it_get_or_create(resource_type *rtype) { item_type * itype; assert(rtype); itype = it_find(rtype->_name); - assert(!itype || !itype->rtype || itype->rtype == rtype); if (!itype) { itype = (item_type *)calloc(sizeof(item_type), 1); } @@ -491,7 +491,7 @@ item *i_change(item ** pi, const item_type * itype, int delta) item *i = *pi; i->number += delta; if (i->number < 0) { - log_error("serious accounting error. number of items is %d.\n", i->number); + log_error("serious accounting error. number of items is %d.", i->number); i->number = 0; } if (i->number == 0) { @@ -518,6 +518,11 @@ static item *icache; static int icache_size; #define ICACHE_MAX 100 +void item_done(void) { + i_freeall(&icache); + icache_size = 0; +} + void i_free(item * i) { if (icache_size >= ICACHE_MAX) { @@ -862,11 +867,9 @@ struct order *ord) else { const race *irace = u_irace(u); if (irace == u_race(u)) { - static const race *rcfailure; + const race *rcfailure = rc_find("smurf"); if (!rcfailure) { - rcfailure = rc_find("smurf"); - if (!rcfailure) - rcfailure = rc_find("toad"); + rcfailure = rc_find("toad"); } if (rcfailure) { trigger *trestore = trigger_changerace(u, u_race(u), irace); @@ -969,7 +972,7 @@ void init_resources(void) { resource_type *rtype; - rtype = rt_get_or_create(resourcenames[R_PERSON]); // lousy hack + rt_get_or_create(resourcenames[R_PERSON]); // lousy hack rtype = rt_get_or_create(resourcenames[R_PEASANT]); rtype->uchange = res_changepeasants; @@ -1187,6 +1190,46 @@ static item *default_spoil(const struct race *rc, int size) return itm; } +void read_items(struct storage *store, item ** ilist) +{ + for (;;) { + char ibuf[32]; + const item_type *itype; + int i; + READ_STR(store, ibuf, sizeof(ibuf)); + if (!strcmp("end", ibuf)) { + break; + } + itype = it_find(ibuf); + READ_INT(store, &i); + if (i <= 0) { + log_error("data contains an entry with %d %s", i, ibuf); + } + else { + if (itype && itype->rtype) { + i_change(ilist, itype, i); + } + else { + log_error("data contains unknown item type %s.", ibuf); + } + assert(itype && itype->rtype); + } + } +} + +void write_items(struct storage *store, item * ilist) +{ + item *itm; + for (itm = ilist; itm; itm = itm->next) { + assert(itm->number >= 0); + if (itm->number) { + WRITE_TOK(store, resourcename(itm->type->rtype, 0)); + WRITE_INT(store, itm->number); + } + } + WRITE_TOK(store, "end"); +} + static void free_itype(item_type *itype) { assert(itype); free(itype->construction); diff --git a/src/kernel/item.h b/src/kernel/item.h index fc3c2c909..c32f38057 100644 --- a/src/kernel/item.h +++ b/src/kernel/item.h @@ -35,6 +35,8 @@ extern "C" { struct troop; struct item; struct order; + struct storage; + struct gamedata; typedef struct item { struct item *next; @@ -59,6 +61,8 @@ extern "C" { #define NMF_PLURAL 0x01 #define NMF_APPEARANCE 0x02 + void item_done(void); + typedef int(*rtype_uchange) (struct unit * user, const struct resource_type * rtype, int delta); typedef int(*rtype_uget) (const struct unit * user, @@ -106,7 +110,6 @@ extern "C" { typedef struct resource_limit { rlimit_limit limit; rlimit_produce produce; - unsigned int guard; /* how to guard against theft */ int value; resource_mod *modifiers; } resource_limit; @@ -246,6 +249,9 @@ extern "C" { void i_freeall(item ** i); item *i_new(const item_type * it, int number); + void read_items(struct storage *store, struct item **it); + void write_items(struct storage *store, struct item *it); + /* convenience: */ item *i_change(item ** items, const item_type * it, int delta); int i_get(const item * i, const item_type * it); diff --git a/src/kernel/item.test.c b/src/kernel/item.test.c index 1c133b74f..231b45d00 100644 --- a/src/kernel/item.test.c +++ b/src/kernel/item.test.c @@ -6,6 +6,8 @@ #include #include #include +#include +#include #include #include @@ -45,8 +47,11 @@ static void test_resourcename_with_appearance(CuTest *tc) { static void test_uchange(CuTest * tc, unit * u, const resource_type * rtype) { int n; + struct log_t *log; + strlist *sl = 0; assert(rtype); + log = test_log_start(LOG_CPERROR, &sl); change_resource(u, rtype, 4); n = get_resource(u, rtype); CuAssertPtrNotNull(tc, rtype->uchange); @@ -54,25 +59,31 @@ static void test_uchange(CuTest * tc, unit * u, const resource_type * rtype) { CuAssertIntEquals(tc, n - 3, rtype->uchange(u, rtype, -3)); CuAssertIntEquals(tc, n - 3, get_resource(u, rtype)); CuAssertIntEquals(tc, 0, rtype->uchange(u, rtype, -n)); + CuAssertPtrNotNull(tc, sl); + CuAssertStrEquals(tc, "serious accounting error. number of items is %d.", sl->s); + CuAssertPtrEquals(tc, 0, sl->next); + test_log_stop(log, sl); } void test_change_item(CuTest * tc) { unit * u; - test_cleanup(); + test_setup(); + test_log_stderr(0); test_create_itemtype("iron"); init_resources(); - u = test_create_unit(test_create_faction(0), 0); + u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); test_uchange(tc, u, get_resourcetype(R_IRON)); + test_cleanup(); } void test_resource_type(CuTest * tc) { struct item_type *itype; - test_cleanup(); + test_setup(); CuAssertPtrEquals(tc, 0, rt_find("herpderp")); @@ -89,7 +100,7 @@ void test_finditemtype(CuTest * tc) const item_type *itype; struct locale * lang; - test_cleanup(); + test_setup(); lang = get_or_create_locale("de"); locale_setstring(lang, "horse", "Pferd"); @@ -103,7 +114,7 @@ void test_findresourcetype(CuTest * tc) const item_type *itype; struct locale * lang; - test_cleanup(); + test_setup(); lang = get_or_create_locale("de"); locale_setstring(lang, "horse", "Pferd"); @@ -124,7 +135,7 @@ static void test_fix_demand(CuTest *tc) { terrain_type *tplain; item_type *ltype; - test_cleanup(); + test_setup(); ltype = test_create_itemtype("balm"); ltype->rtype->flags |= (RTF_ITEM | RTF_POOLED); new_luxurytype(ltype, 0); @@ -145,7 +156,8 @@ static void test_fix_demand(CuTest *tc) { static void test_core_resources(CuTest *tc) { resource_type * rtype; - test_cleanup(); + + test_setup(); init_resources(); CuAssertPtrNotNull(tc, rtype = rt_find("money")); CuAssertPtrNotNull(tc, rtype->itype); diff --git a/src/kernel/jsonconf.c b/src/kernel/jsonconf.c index 721e6e60f..d12238566 100644 --- a/src/kernel/jsonconf.c +++ b/src/kernel/jsonconf.c @@ -106,7 +106,7 @@ static void json_maintenance_i(cJSON *json, maintenance *mt) { break; case cJSON_Array: if (strcmp(child->string, "flags") == 0) { - const char * flags[] = { "variable", "required", 0 }; + const char * flags[] = { "variable", 0 }; mt->flags = json_flags(child, flags); } else { @@ -481,6 +481,9 @@ static void json_race(cJSON *json, race *rc) { else if (strcmp(child->string, "capacity") == 0) { rc->capacity = child->valueint; } + else if (strcmp(child->string, "income") == 0) { + rc->income = child->valueint; + } else if (strcmp(child->string, "hp") == 0) { rc->hitpoints = child->valueint; } @@ -793,7 +796,7 @@ static void json_settings(cJSON *json) { else { char value[32]; if (child->type == cJSON_Number && child->valuedouble && child->valueintvaluedouble) { - _snprintf(value, sizeof(value), "%lf", child->valuedouble); + _snprintf(value, sizeof(value), "%f", child->valuedouble); } else { _snprintf(value, sizeof(value), "%d", child->valueint); diff --git a/src/kernel/jsonconf.test.c b/src/kernel/jsonconf.test.c index 858c811b9..76784ed56 100644 --- a/src/kernel/jsonconf.test.c +++ b/src/kernel/jsonconf.test.c @@ -22,6 +22,7 @@ #include #include #include +#include static const struct race * race_with_flag(const char * name) { char data[1024]; @@ -140,6 +141,7 @@ static void test_races(CuTest * tc) "\"maintenance\" : 2," "\"weight\" : 3," "\"capacity\" : 4," + "\"income\" : 30," "\"hp\" : 5," "\"ac\" : 6," "\"flags\" : [ \"npc\", \"walk\", \"undead\" ]" @@ -166,6 +168,7 @@ static void test_races(CuTest * tc) CuAssertIntEquals(tc, 2, rc->maintenance); CuAssertIntEquals(tc, 3, rc->weight); CuAssertIntEquals(tc, 4, rc->capacity); + CuAssertIntEquals(tc, 30, rc->income); CuAssertIntEquals(tc, 5, rc->hitpoints); CuAssertIntEquals(tc, 6, rc->armor); cJSON_Delete(json); @@ -318,7 +321,7 @@ static void test_spells(CuTest * tc) static const char * building_data = "{\"buildings\": { " "\"house\" : { " "\"maintenance\" : " -"{ \"type\" : \"iron\", \"amount\" : 1, \"flags\" : [ \"required\", \"variable\" ] }" +"{ \"type\" : \"iron\", \"amount\" : 1, \"flags\" : [ \"variable\" ] }" "," "\"construction\" : {" "\"maxsize\" : 20," @@ -362,7 +365,7 @@ static void test_buildings(CuTest * tc) CuAssertPtrNotNull(tc, bt->maintenance); CuAssertIntEquals(tc, 1, bt->maintenance[0].number); CuAssertPtrEquals(tc, (void *)get_resourcetype(R_IRON), (void *)bt->maintenance[0].rtype); - CuAssertIntEquals(tc, MTF_VARIABLE | MTF_VITAL, bt->maintenance[0].flags); + CuAssertIntEquals(tc, MTF_VARIABLE, bt->maintenance[0].flags); CuAssertIntEquals(tc, 0, bt->maintenance[1].number); CuAssertPtrNotNull(tc, bt->construction); @@ -445,7 +448,9 @@ static void test_configs(CuTest * tc) CuAssertPtrEquals(tc, 0, buildingtypes); json_config(json); CuAssertPtrNotNull(tc, buildingtypes); - unlink("test.json"); + if (unlink("test.json")!=0 && errno==ENOENT) { + errno = 0; + } cJSON_Delete(json); test_cleanup(); } diff --git a/src/kernel/messages.c b/src/kernel/messages.c index 330c2feeb..566e9bdef 100644 --- a/src/kernel/messages.c +++ b/src/kernel/messages.c @@ -92,10 +92,11 @@ struct message *msg_feedback(const struct unit *u, struct order *ord, if (!mtype) { log_warning("trying to create message of unknown type \"%s\"\n", name); if (!mt_find("missing_feedback")) { - mt_register(mt_new_va("missing_feedback", "unit:unit", "region:region", "command:order", "name:string", 0)); + mt_register(mt_new_va("missing_feedback", "unit:unit", + "region:region", "command:order", "name:string", 0)); } - return msg_message("missing_feedback", "unit region command name", u, - u->region, ord, name); + return msg_message("missing_feedback", "name unit region command", + name, u, u->region, ord); } var.v = (void *)u; diff --git a/src/kernel/messages.test.c b/src/kernel/messages.test.c index fc6079dfe..c391c8720 100644 --- a/src/kernel/messages.test.c +++ b/src/kernel/messages.test.c @@ -74,4 +74,5 @@ CuSuite *get_messages_suite(void) { SUITE_ADD_TEST(suite, test_merge_split); SUITE_ADD_TEST(suite, test_message); return suite; -} \ No newline at end of file +} + diff --git a/src/kernel/order.c b/src/kernel/order.c index f79b2dd68..3fd1dc92f 100644 --- a/src/kernel/order.c +++ b/src/kernel/order.c @@ -285,7 +285,7 @@ static order *create_order_i(keyword_t kwd, const char *sptr, bool persistent, order *ord = NULL; int lindex; - if ((int)kwd > 0 && keyword_disabled(kwd)) { + if (kwd == NOKEYWORD || keyword_disabled(kwd)) { log_error("trying to create an order for disabled keyword %s.", keyword(kwd)); return NULL; } @@ -407,8 +407,8 @@ order *parse_order(const char *s, const struct locale * lang) if (kwd != NOKEYWORD) { while (isxspace(*(unsigned char *)sptr)) ++sptr; s = sptr; + return create_order_i(kwd, s, persistent, lang); } - return create_order_i(kwd, s, persistent, lang); } return NULL; } diff --git a/src/kernel/order.h b/src/kernel/order.h index 8ad5592b7..69cf1ea33 100644 --- a/src/kernel/order.h +++ b/src/kernel/order.h @@ -12,12 +12,14 @@ #ifndef KRNL_ORDER_H #define KRNL_ORDER_H + +#include "keyword.h" +#include + #ifdef __cplusplus extern "C" { #endif -#include "keyword.h" - /* Encapsulation of an order * * This structure contains one order given by a unit. These used to be diff --git a/src/kernel/order.test.c b/src/kernel/order.test.c index 635e6e078..f5eb51c6f 100644 --- a/src/kernel/order.test.c +++ b/src/kernel/order.test.c @@ -1,5 +1,4 @@ #include -#include #include #include "order.h" diff --git a/src/kernel/plane.h b/src/kernel/plane.h index 85c38cf9f..d06495f34 100644 --- a/src/kernel/plane.h +++ b/src/kernel/plane.h @@ -43,7 +43,6 @@ extern "C" { #define PFL_FRIENDLY 4096 /* everyone is your ally */ #define PFL_NOORCGROWTH 8192 /* orcs don't grow */ #define PFL_NOMONSTERS 16384 /* no monster randenc */ -#define PFL_SEESPECIAL 32768 /* far seeing */ typedef struct plane { struct plane *next; diff --git a/src/kernel/pool.c b/src/kernel/pool.c index 6ceeda63d..5609d211f 100644 --- a/src/kernel/pool.c +++ b/src/kernel/pool.c @@ -179,7 +179,7 @@ int count) if (u != v && (v->items || rtype->uget)) { int mask; - if ((urace(v)->ec_flags & ECF_KEEP_ITEM)) + if ((u_race(v)->ec_flags & ECF_KEEP_ITEM)) continue; if (v->faction == f) { @@ -232,7 +232,7 @@ use_pooled(unit * u, const resource_type * rtype, unsigned int mode, int count) for (v = r->units; use > 0 && v != NULL; v = v->next) { if (u != v) { int mask; - if ((urace(v)->ec_flags & ECF_KEEP_ITEM)) + if ((u_race(v)->ec_flags & ECF_KEEP_ITEM)) continue; if (v->items == NULL && rtype->uget == NULL) continue; diff --git a/src/kernel/race.c b/src/kernel/race.c index 2c22f6c09..f28c5ed2f 100644 --- a/src/kernel/race.c +++ b/src/kernel/race.c @@ -34,12 +34,12 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "skill.h" #include "terrain.h" #include "unit.h" -#include "version.h" /* util includes */ #include #include #include +#include #include #include #include @@ -60,46 +60,87 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /** external variables **/ race *races; int num_races = 0; -static int cache_breaker; +static int rc_changes = 1; static const char *racenames[MAXRACES] = { "dwarf", "elf", NULL, "goblin", "human", "troll", "demon", "insect", "halfling", "cat", "aquarian", "orc", "snotling", "undead", "illusion", "youngdragon", "dragon", "wyrm", "ent", "catdragon", "dracoid", - "special", "spell", "irongolem", "stonegolem", "shadowdemon", + NULL, "spell", "irongolem", "stonegolem", "shadowdemon", "shadowmaster", "mountainguard", "alp", "toad", "braineater", "peasant", "wolf", NULL, NULL, NULL, NULL, "songdragon", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "seaserpent", - "shadowknight", "centaur", "skeleton", "skeletonlord", "zombie", - "juju-zombie", "ghoul", "ghast", "museumghost", "gnome", "template", + "shadowknight", NULL, "skeleton", "skeletonlord", "zombie", + "juju-zombie", "ghoul", "ghast", NULL, NULL, "template", "clone" }; -static race * race_cache[MAXRACES]; +const struct race *findrace(const char *s, const struct locale *lang) +{ + void **tokens = get_translations(lang, UT_RACES); + variant token; -struct race *get_race(race_t rt) { - static int cache = -1; + assert(lang); + if (tokens && findtoken(*tokens, s, &token) == E_TOK_SUCCESS) { + return (const struct race *)token.v; + } + return NULL; +} + +const struct race *get_race(race_t rt) { const char * name; - race * result = 0; assert(rt < MAXRACES); name = racenames[rt]; if (!name) { - return 0; + return NULL; } - if (cache_breaker != cache) { - cache = cache_breaker; - memset(race_cache, 0, sizeof(race_cache)); - return race_cache[rt] = rc_get_or_create(name); + return rc_find(name); +} + +typedef struct xref { + race_t id; + const race *rc; +} rc_xref; + +int cmp_xref(const void *a, const void *b) +{ + const rc_xref *l = (const rc_xref *)a; + const rc_xref *r = (const rc_xref *)b; + if (l->rcrc) return -1; + if (l->rc>r->rc) return 1; + return 0; +} + +static rc_xref *xrefs; +race_t old_race(const struct race * rc) +{ + static int cache; + int i, l, r; + + if (rc_changed(&cache)) { + if (!xrefs) { + xrefs = malloc(sizeof(rc_xref) * MAXRACES); + } + for (i = 0; i != MAXRACES; ++i) { + xrefs[i].rc = get_race(i); + xrefs[i].id = (race_t)i; + } + qsort(xrefs, MAXRACES, sizeof(rc_xref), cmp_xref); } - else { - result = race_cache[rt]; - if (!result) { - result = race_cache[rt] = rc_get_or_create(name); + l=0; r=MAXRACES-1; + while (l<=r) { + int m = (l+r)/2; + if (rcxrefs[m].rc) { + l = m+1; + } else { + return (race_t)xrefs[m].id; } } - return result; + return NORACE; } race_list *get_familiarraces(void) @@ -142,12 +183,15 @@ void free_races(void) { while (races) { race * rc = races->next; free_params(&races->parameters); + free(xrefs); + xrefs = 0; free(races->_name); free(races->def_damage); free(races); races = rc; } num_races = 0; + ++rc_changes; } static race *rc_find_i(const char *name) @@ -169,38 +213,53 @@ const race * rc_find(const char *name) { return rc_find_i(name); } -race *rc_get_or_create(const char *zName) +bool rc_changed(int *cache) { + assert(cache); + if (*cache != rc_changes) { + *cache = rc_changes; + return true; + } + return false; +} + +race *rc_create(const char *zName) { race *rc; int i; assert(zName); - rc = rc_find_i(zName); - if (!rc) { - rc = (race *)calloc(sizeof(race), 1); - rc->hitpoints = 1; - rc->weight = PERSON_WEIGHT; - rc->capacity = 540; - rc->recruit_multi = 1.0F; - rc->regaura = 1.0F; - rc->speed = 1.0F; - rc->battle_flags = 0; - if (strchr(zName, ' ') != NULL) { - log_error("race '%s' has an invalid name. remove spaces\n", zName); - assert(strchr(zName, ' ') == NULL); - } - rc->_name = _strdup(zName); - rc->precombatspell = NULL; - - rc->attack[0].type = AT_COMBATSPELL; - for (i = 1; i < RACE_ATTACKS; ++i) - rc->attack[i].type = AT_NONE; - rc->index = num_races++; - ++cache_breaker; - rc->next = races; - return races = rc; + rc = (race *)calloc(sizeof(race), 1); + rc->hitpoints = 1; + rc->weight = PERSON_WEIGHT; + rc->capacity = 540; + rc->income = 20; + rc->recruit_multi = 1.0F; + rc->regaura = 1.0F; + rc->speed = 1.0F; + rc->battle_flags = 0; + if (strchr(zName, ' ') != NULL) { + log_error("race '%s' has an invalid name. remove spaces\n", zName); + assert(strchr(zName, ' ') == NULL); } - return rc; + rc->_name = _strdup(zName); + rc->precombatspell = NULL; + + rc->attack[0].type = AT_COMBATSPELL; + for (i = 1; i < RACE_ATTACKS; ++i) + rc->attack[i].type = AT_NONE; + rc->index = num_races++; + ++rc_changes; + rc->next = races; + return races = rc; +} + +race *rc_get_or_create(const char *zName) +{ + race *rc; + + assert(zName); + rc = rc_find_i(zName); + return rc ? rc : rc_create(zName); } /** dragon movement **/ @@ -303,19 +362,17 @@ variant read_race_reference(struct storage *store) return result; } -/** Returns the English name of the race, which is what the database uses. -*/ -const char *dbrace(const struct race *rc) -{ - static char zText[32]; // FIXME: static return value - char *zPtr = zText; - - /* the english names are all in ASCII, so we don't need to worry about UTF8 */ - strlcpy(zText, (const char *)LOC(get_locale("en"), rc_name_s(rc, NAME_SINGULAR)), sizeof(zText)); - while (*zPtr) { - *zPtr = (char)(toupper(*zPtr)); - ++zPtr; - } - return zText; +void register_race_description_function(race_desc_func func, const char *name) { + register_function((pf_generic)func, name); } +void register_race_name_function(race_name_func func, const char *name) { + register_function((pf_generic)func, name); +} + +char * race_namegen(const struct race *rc, struct unit *u) { + if (rc->generate_name) { + rc->generate_name(u); + } + return NULL; +} diff --git a/src/kernel/race.h b/src/kernel/race.h index a106249f8..022d09c86 100644 --- a/src/kernel/race.h +++ b/src/kernel/race.h @@ -18,13 +18,14 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef H_KRNL_RACE_H #define H_KRNL_RACE_H +#include +#include "magic.h" /* wegen MAXMAGIETYP */ +#include "skill.h" + #ifdef __cplusplus extern "C" { #endif -#include "magic.h" /* wegen MAXMAGIETYP */ -#include "skill.h" - #define AT_NONE 0 #define AT_STANDARD 1 #define AT_DRAIN_EXP 2 @@ -44,43 +45,40 @@ extern "C" { struct param; struct spell; + struct locale; + + extern int num_races; typedef enum { RC_DWARF, /* 0 - Zwerg */ RC_ELF, RC_GOBLIN = 3, RC_HUMAN, - RC_TROLL, RC_DAEMON, RC_INSECT, RC_HALFLING, RC_CAT, - RC_AQUARIAN, RC_ORC, RC_SNOTLING, RC_UNDEAD, RC_ILLUSION, - RC_FIREDRAGON, RC_DRAGON, RC_WYRM, RC_TREEMAN, RC_BIRTHDAYDRAGON, - RC_DRACOID, - RC_SPECIAL, - RC_SPELL, + + RC_SPELL = 22, RC_IRONGOLEM, RC_STONEGOLEM, - RC_SHADOW, RC_SHADOWLORD, RC_IRONKEEPER, RC_ALP, RC_TOAD, - RC_HIRNTOETER, RC_PEASANT, RC_WOLF = 32, @@ -89,20 +87,15 @@ extern "C" { RC_SEASERPENT = 51, RC_SHADOWKNIGHT, - RC_CENTAUR, - RC_SKELETON, + RC_SKELETON = 54, RC_SKELETON_LORD, RC_ZOMBIE, RC_ZOMBIE_LORD, RC_GHOUL, RC_GHOUL_LORD, - - RC_MUS_SPIRIT, - RC_GNOME, - RC_TEMPLATE, + RC_TEMPLATE = 62, RC_CLONE, - MAXRACES, NORACE = -1 } race_t; @@ -117,20 +110,23 @@ extern "C" { int level; } att; - extern int num_races; + typedef const char *(*race_desc_func)(const struct race *rc, const struct locale *lang); + typedef void (*race_name_func)(struct unit *); typedef struct race { char *_name; float magres; + float healing; double maxaura; /* Faktor auf Maximale Aura */ double regaura; /* Faktor auf Regeneration */ - double recruit_multi; /* Faktor für Bauernverbrauch */ + double recruit_multi; /* Faktor f�r Bauernverbrauch */ int index; int recruitcost; int maintenance; int splitsize; int weight; int capacity; + int income; float speed; float aggression; /* chance that a monster will attack */ int hitpoints; @@ -138,8 +134,8 @@ extern "C" { int armor; int at_default; /* Angriffsskill Unbewaffnet (default: -2) */ int df_default; /* Verteidigungsskill Unbewaffnet (default: -2) */ - int at_bonus; /* Verändert den Angriffsskill (default: 0) */ - int df_bonus; /* Verändert den Verteidigungskill (default: 0) */ + int at_bonus; /* Ver�ndert den Angriffsskill (default: 0) */ + int df_bonus; /* Ver�ndert den Verteidigungskill (default: 0) */ struct param *parameters; // additional properties, for an example see natural_armor const struct spell *precombatspell; signed char *study_speed; /* study-speed-bonus in points/turn (0=30 Tage) */ @@ -149,8 +145,8 @@ extern "C" { struct att attack[RACE_ATTACKS]; signed char bonus[MAXSKILLS]; - const char *(*generate_name) (const struct unit *); - const char *(*describe) (const struct unit *, const struct locale *); + race_name_func generate_name; + race_desc_func describe; void(*age) (struct unit * u); bool(*move_allowed) (const struct region *, const struct region *); struct item *(*itemdrop) (const struct race *, int size); @@ -166,18 +162,21 @@ extern "C" { const struct race *data; } race_list; - extern void racelist_clear(struct race_list **rl); - extern void racelist_insert(struct race_list **rl, const struct race *r); + void racelist_clear(struct race_list **rl); + void racelist_insert(struct race_list **rl, const struct race *r); + const struct race *findrace(const char *, const struct locale *); struct race_list *get_familiarraces(void); struct race *races; - struct race *get_race(race_t rt); + const struct race *get_race(race_t rt); /** TODO: compatibility hacks: **/ race_t old_race(const struct race *); - extern race *rc_get_or_create(const char *name); - extern const race *rc_find(const char *); + race *rc_create(const char *zName); + race *rc_get_or_create(const char *name); + bool rc_changed(int *cache); + const race *rc_find(const char *); void free_races(void); typedef enum name_t { NAME_SINGULAR, NAME_PLURAL, NAME_DEFINITIVE, NAME_CATEGORY } name_t; @@ -194,20 +193,20 @@ extern "C" { #define RCF_LEARN (1<<6) /* Lernt automatisch wenn struct faction == 0 */ #define RCF_FLY (1<<7) /* kann fliegen */ #define RCF_SWIM (1<<8) /* kann schwimmen */ -#define RCF_WALK (1<<9) /* kann über Land gehen */ +#define RCF_WALK (1<<9) /* kann �ber Land gehen */ #define RCF_NOLEARN (1<<10) /* kann nicht normal lernen */ #define RCF_NOTEACH (1<<11) /* kann nicht lehren */ #define RCF_HORSE (1<<12) /* Einheit ist Pferd, sozusagen */ #define RCF_DESERT (1<<13) /* 5% Chance, das Einheit desertiert */ #define RCF_ILLUSIONARY (1<<14) /* (Illusion & Spell) Does not drop items. */ -#define RCF_ABSORBPEASANTS (1<<15) /* Tötet und absorbiert Bauern */ +#define RCF_ABSORBPEASANTS (1<<15) /* T�tet und absorbiert Bauern */ #define RCF_NOHEAL (1<<16) /* Einheit kann nicht geheilt werden */ #define RCF_NOWEAPONS (1<<17) /* Einheit kann keine Waffen benutzen */ #define RCF_SHAPESHIFT (1<<18) /* Kann TARNE RASSE benutzen. */ #define RCF_SHAPESHIFTANY (1<<19) /* Kann TARNE RASSE "string" benutzen. */ #define RCF_UNDEAD (1<<20) /* Undead. */ -#define RCF_DRAGON (1<<21) /* Drachenart (für Zauber) */ -#define RCF_COASTAL (1<<22) /* kann in Landregionen an der Küste sein */ +#define RCF_DRAGON (1<<21) /* Drachenart (f�r Zauber) */ +#define RCF_COASTAL (1<<22) /* kann in Landregionen an der K�ste sein */ #define RCF_UNARMEDGUARD (1<<23) /* kann ohne Waffen bewachen */ #define RCF_CANSAIL (1<<24) /* Einheit darf Schiffe betreten */ #define RCF_INVISIBLE (1<<25) /* not visible in any report */ @@ -217,33 +216,29 @@ extern "C" { #define RCF_ATTACK_MOVED (1<<29) /* may attack if it has moved */ /* Economic flags */ -#define ECF_KEEP_ITEM (1<<1) /* gibt Gegenstände weg */ -#define GIVEPERSON (1<<2) /* übergibt Personen */ -#define GIVEUNIT (1<<3) /* Einheiten an andere Partei übergeben */ -#define GETITEM (1<<4) /* nimmt Gegenstände an */ -#define ECF_REC_HORSES (1<<6) /* Rekrutiert aus Pferden */ +#define ECF_KEEP_ITEM (1<<1) /* gibt Gegenst�nde weg */ +#define GIVEPERSON (1<<2) /* �bergibt Personen */ +#define GIVEUNIT (1<<3) /* Einheiten an andere Partei �bergeben */ +#define GETITEM (1<<4) /* nimmt Gegenst�nde an */ #define ECF_REC_ETHEREAL (1<<7) /* Rekrutiert aus dem Nichts */ #define ECF_REC_UNLIMITED (1<<8) /* Rekrutiert ohne Limit */ /* Battle-Flags */ -#define BF_EQUIPMENT (1<<0) /* Kann Ausrüstung benutzen */ -#define BF_NOBLOCK (1<<1) /* Wird in die Rückzugsberechnung nicht einbezogen */ +#define BF_EQUIPMENT (1<<0) /* Kann Ausr�stung benutzen */ +#define BF_NOBLOCK (1<<1) /* Wird in die R�ckzugsberechnung nicht einbezogen */ #define BF_RES_PIERCE (1<<2) /* Halber Schaden durch PIERCE */ #define BF_RES_CUT (1<<3) /* Halber Schaden durch CUT */ #define BF_RES_BASH (1<<4) /* Halber Schaden durch BASH */ #define BF_INV_NONMAGIC (1<<5) /* Immun gegen nichtmagischen Schaden */ #define BF_NO_ATTACK (1<<6) /* Kann keine ATTACKIERE Befehle ausfuehren */ - int unit_old_max_hp(struct unit *u); const char *racename(const struct locale *lang, const struct unit *u, const race * rc); -#define omniscient(f) ((f)->race==get_race(RC_ILLUSION) || (f)->race==get_race(RC_TEMPLATE)) - -#define playerrace(rc) (!fval((rc), RCF_NPC)) -#define dragonrace(rc) ((rc) == get_race(RC_FIREDRAGON) || (rc) == get_race(RC_DRAGON) || (rc) == get_race(RC_WYRM) || (rc) == get_race(RC_BIRTHDAYDRAGON)) -#define humanoidrace(rc) (fval((rc), RCF_UNDEAD) || (rc)==get_race(RC_DRACOID) || playerrace(rc)) -#define illusionaryrace(rc) (fval(rc, RCF_ILLUSIONARY)) +#define playerrace(rc) (!((rc)->flags & RCF_NPC)) +#define dragonrace(rc) ((rc)->flags & RCF_DRAGON) +#define humanoidrace(rc) (((rc)->flags & RCF_UNDEAD) || (rc)==get_race(RC_DRACOID) || playerrace(rc)) +#define illusionaryrace(rc) ((rc)->flags & RCF_ILLUSIONARY) bool allowed_dragon(const struct region *src, const struct region *target); @@ -255,10 +250,9 @@ extern "C" { variant read_race_reference(struct storage *store); const char *raceprefix(const struct unit *u); - - void give_starting_equipment(const struct equipment *eq, - struct unit *u); - const char *dbrace(const struct race *rc); + void register_race_name_function(race_name_func, const char *); + void register_race_description_function(race_desc_func, const char *); + char * race_namegen(const struct race *rc, struct unit *u); #ifdef __cplusplus } diff --git a/src/kernel/race.test.c b/src/kernel/race.test.c index e8bbfcf29..663a538ee 100644 --- a/src/kernel/race.test.c +++ b/src/kernel/race.test.c @@ -9,7 +9,7 @@ static void test_rc_name(CuTest *tc) { struct race *rc; - test_cleanup(); + test_setup(); rc = test_create_race("human"); CuAssertStrEquals(tc, "race::human", rc_name_s(rc, NAME_SINGULAR)); CuAssertStrEquals(tc, "race::human_p", rc_name_s(rc, NAME_PLURAL)); @@ -20,7 +20,7 @@ static void test_rc_name(CuTest *tc) { static void test_rc_defaults(CuTest *tc) { struct race *rc; - test_cleanup(); + test_setup(); rc = rc_get_or_create("human"); CuAssertStrEquals(tc, "human", rc->_name); CuAssertDblEquals(tc, 0.0, rc->magres, 0.0); @@ -32,6 +32,7 @@ static void test_rc_defaults(CuTest *tc) { CuAssertIntEquals(tc, 0, rc->recruitcost); CuAssertIntEquals(tc, 0, rc->maintenance); CuAssertIntEquals(tc, 540, rc->capacity); + CuAssertIntEquals(tc, 20, rc->income); CuAssertIntEquals(tc, 1, rc->hitpoints); CuAssertIntEquals(tc, 0, rc->armor); CuAssertIntEquals(tc, 0, rc->at_bonus); @@ -43,15 +44,48 @@ static void test_rc_defaults(CuTest *tc) { static void test_rc_find(CuTest *tc) { race *rc; - test_cleanup(); + test_setup(); rc = test_create_race("hungryhippos"); CuAssertPtrEquals(tc, rc, (void *)rc_find("hungryhippos")); test_cleanup(); } +static void test_race_get(CuTest *tc) { + int cache = 0; + const race *rc; + test_setup(); + CuAssertTrue(tc, rc_changed(&cache)); + CuAssertTrue(tc, !rc_changed(&cache)); + rc = rc_get_or_create("elf"); + CuAssertPtrEquals(tc, (void *)rc, (void *)get_race(RC_ELF)); + CuAssertTrue(tc, rc_changed(&cache)); + CuAssertTrue(tc, !rc_changed(&cache)); + CuAssertPtrEquals(tc, (void *)rc, (void *)rc_find("elf")); + free_races(); + CuAssertTrue(tc, rc_changed(&cache)); + test_cleanup(); +} + +static void test_old_race(CuTest *tc) +{ + race * rc1, *rc2; + test_setup(); + test_create_race("dwarf"); + rc1 = test_create_race("elf"); + rc2 = test_create_race("onkel"); + CuAssertIntEquals(tc, RC_ELF, old_race(rc1)); + CuAssertIntEquals(tc, NORACE, old_race(rc2)); + rc2 = test_create_race("human"); + CuAssertIntEquals(tc, RC_ELF, old_race(rc1)); + CuAssertIntEquals(tc, RC_HUMAN, old_race(rc2)); + test_cleanup(); +} + CuSuite *get_race_suite(void) { CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_race_get); + SUITE_ADD_TEST(suite, test_old_race); SUITE_ADD_TEST(suite, test_rc_name); SUITE_ADD_TEST(suite, test_rc_defaults); SUITE_ADD_TEST(suite, test_rc_find); diff --git a/src/kernel/region.c b/src/kernel/region.c index 54e78ec06..d937f8b68 100644 --- a/src/kernel/region.c +++ b/src/kernel/region.c @@ -32,12 +32,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "plane.h" #include "region.h" #include "resources.h" -#include "save.h" #include "ship.h" #include "terrain.h" #include "terrainid.h" #include "unit.h" -#include "version.h" /* util includes */ #include @@ -136,6 +134,13 @@ const char *regionname(const region * r, const faction * f) return write_regionname(r, f, buf[index], sizeof(buf[index])); } +int region_maxworkers(const region *r) +{ + int size = production(r); + int treespace = (rtrees(r, 2) + rtrees(r, 1) / 2) * TREESIZE; + return _max(size - treespace, _min(size / 10, 200)); +} + int deathcount(const region * r) { attrib *a = a_find(r->attribs, &at_deathcount); @@ -146,23 +151,24 @@ int deathcount(const region * r) void deathcounts(region * r, int fallen) { - attrib *a; - static const curse_type *ctype = NULL; + attrib *a = NULL; if (fallen == 0) return; - if (!ctype) - ctype = ct_find("holyground"); - if (ctype && curse_active(get_curse(r->attribs, ctype))) - return; - - a = a_find(r->attribs, &at_deathcount); - if (!a) + if (r->attribs) { + const curse_type *ctype = ct_find("holyground"); + if (ctype && curse_active(get_curse(r->attribs, ctype))) + return; + a = a_find(r->attribs, &at_deathcount); + } + if (!a) { a = a_add(&r->attribs, a_new(&at_deathcount)); + } a->data.i += fallen; - if (a->data.i <= 0) + if (a->data.i <= 0) { a_remove(&r->attribs, a); + } } /* Moveblock wird zur Zeit nicht über Attribute, sondern ein Bitfeld @@ -697,13 +703,11 @@ void r_setdemand(region * r, const luxury_type * ltype, int value) d->value = value; } -const item_type *r_luxury(region * r) +const item_type *r_luxury(const region * r) { struct demand *dmd; if (r->land) { - if (!r->land->demands) { - fix_demand(r); - } + assert(r->land->demands || !"need to call fix_demands on a region"); for (dmd = r->land->demands; dmd; dmd = dmd->next) { if (dmd->value == 0) return dmd->type->itype; @@ -1011,6 +1015,20 @@ void setluxuries(region * r, const luxury_type * sale) } } +int fix_demand(region * rd) { + luxury_type * ltype; + int maxluxuries = get_maxluxuries(); + if (maxluxuries > 0) { + int sale = rng_int() % maxluxuries; + for (ltype = luxurytypes; sale != 0 && ltype; ltype = ltype->next) { + --sale; + } + setluxuries(rd, ltype); + return 0; + } + return -1; +} + void terraform_region(region * r, const terrain_type * terrain) { /* Resourcen, die nicht mehr vorkommen können, löschen */ @@ -1059,7 +1077,6 @@ void terraform_region(region * r, const terrain_type * terrain) rsetmoney(r, 0); freset(r, RF_ENCOUNTER); freset(r, RF_MALLORN); - /* Beschreibung und Namen löschen */ return; } @@ -1084,6 +1101,7 @@ void terraform_region(region * r, const terrain_type * terrain) r->land->ownership = NULL; region_set_morale(r, MORALE_DEFAULT, -1); region_setname(r, makename()); + fix_demand(r); for (d = 0; d != MAXDIRECTIONS; ++d) { region *nr = rconnect(r, d); if (nr && nr->land) { @@ -1196,7 +1214,7 @@ void terraform_region(region * r, const terrain_type * terrain) if (!fval(r, RF_CHAOTIC)) { int peasants; - peasants = (maxworkingpeasants(r) * (20 + dice_rand("6d10"))) / 100; + peasants = (region_maxworkers(r) * (20 + dice_rand("6d10"))) / 100; rsetpeasants(r, _max(100, peasants)); rsetmoney(r, rpeasants(r) * ((wage(r, NULL, NULL, INT_MAX) + 1) + rng_int() % 5)); diff --git a/src/kernel/region.h b/src/kernel/region.h index bbc5282b0..fcc5f08b0 100644 --- a/src/kernel/region.h +++ b/src/kernel/region.h @@ -44,7 +44,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define RF_ENCOUNTER (1<<9) /* persistent */ #define RF_MAPPER_HIGHLIGHT (1<<10) #define RF_LIGHTHOUSE (1<<11) /* this region may contain a lighthouse */ -#define RF_ORCIFIED (1<<12) /* persistent */ #define RF_MIGRATION (1<<13) #define RF_UNUSED_14 (1<<14) @@ -58,7 +57,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define RF_ALL 0xFFFFFF -#define RF_SAVEMASK (RF_CHAOTIC|RF_MALLORN|RF_BLOCKED|RF_ENCOUNTER|RF_ORCIFIED|RF_GUARDED) +#define RF_SAVEMASK (RF_CHAOTIC|RF_MALLORN|RF_BLOCKED|RF_ENCOUNTER|RF_GUARDED|RF_LIGHTHOUSE) struct message; struct message_list; struct rawmaterial; @@ -137,6 +136,9 @@ extern "C" { #ifdef FAST_CONNECT struct region *connect[MAXDIRECTIONS]; /* use rconnect(r, dir) to access */ #endif + struct { + seen_mode mode; + } seen; } region; extern struct region *regions; @@ -157,6 +159,7 @@ extern "C" { #define reg_hashkey(r) (r->index) + extern int fix_demand(struct region *r); int distance(const struct region *, const struct region *); int koor_distance(int ax, int ay, int bx, int by); struct region *findregion(int x, int y); @@ -261,6 +264,7 @@ extern "C" { const char *regionname(const struct region *r, const struct faction *f); + int region_maxworkers(const struct region *r); const char *region_getname(const struct region *self); void region_setname(struct region *self, const char *name); const char *region_getinfo(const struct region *self); @@ -271,7 +275,7 @@ extern "C" { int value); int owner_change(const region * r); bool is_mourning(const region * r, int in_turn); - const struct item_type *r_luxury(struct region *r); + const struct item_type *r_luxury(const struct region *r); void get_neighbours(const struct region *r, struct region **list); struct faction *update_owners(struct region *r); diff --git a/src/kernel/region.test.c b/src/kernel/region.test.c new file mode 100644 index 000000000..01ecae2a8 --- /dev/null +++ b/src/kernel/region.test.c @@ -0,0 +1,39 @@ +#include + +#include "region.h" +#include "terrain.h" +#include "item.h" + +#include +#include + +void test_terraform(CuTest *tc) { + region *r; + terrain_type *t_plain, *t_ocean; + item_type *itype; + + test_setup(); + itype = test_create_itemtype("ointment"); + itype->rtype->flags |= (RTF_ITEM | RTF_POOLED); + new_luxurytype(itype, 0); + + t_plain = test_create_terrain("plain", LAND_REGION); + t_ocean = test_create_terrain("ocean", SEA_REGION); + r = test_create_region(0, 0, t_ocean); + CuAssertPtrEquals(tc, 0, r->land); + terraform_region(r, t_plain); + CuAssertPtrNotNull(tc, r->land); + CuAssertPtrNotNull(tc, r->land->demands); + CuAssertPtrEquals(tc, itype, (void *)r->land->demands->type->itype); + CuAssertIntEquals(tc, 0, r->land->demands->type->price); + terraform_region(r, t_ocean); + CuAssertPtrEquals(tc, 0, r->land); + test_cleanup(); +} + +CuSuite *get_region_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_terraform); + return suite; +} diff --git a/src/kernel/resources.c b/src/kernel/resources.c index 658445c69..e064150e6 100644 --- a/src/kernel/resources.c +++ b/src/kernel/resources.c @@ -46,7 +46,7 @@ extern int dice_rand(const char *s); static void update_resource(struct rawmaterial *res, double modifier) { - double amount = 1 + (res->level - res->startlevel) * res->divisor / 100.0; + double amount = (res->level - res->startlevel) / 100.0 * res->divisor + 1; amount = ResourceFactor() * res->base * amount * modifier; if (amount < 1.0) res->amount = 1; diff --git a/src/kernel/save.c b/src/kernel/save.c index b3bdd2c17..2f157af41 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 1998-2015, Enno Rehling Katja Zedel @@ -18,10 +18,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include +#include #include "save.h" -#include - #include "alchemy.h" #include "alliance.h" #include "ally.h" @@ -47,7 +46,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "terrainid.h" /* only for conversion code */ #include "unit.h" #include "lighthouse.h" -#include "version.h" /* attributes includes */ #include @@ -95,6 +93,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* exported symbols symbols */ int firstx = 0, firsty = 0; + +// TODO: is this still important? int enc_gamedata = ENCODING_UTF8; /* local symbols */ @@ -172,9 +172,9 @@ static unit *unitorders(FILE * F, int enc, struct faction *f) if (s[0]) { if (s[0] != '@') { - char token[128]; + char token[64]; const char *stok = s; - stok = parse_token(&stok, token, 64); // FIXME: use sizeof, but parse_token overwrites the buffer + stok = parse_token(&stok, token, sizeof(token)); if (stok) { bool quit = false; @@ -209,12 +209,14 @@ static unit *unitorders(FILE * F, int enc, struct faction *f) if (*ordp) { ordp = &(*ordp)->next; } + else { + ADDMSG(&f->msgs, msg_message("parse_error", "unit command", u, s)); + } } } } else { - /* cmistake(?, buf, 160, MSG_EVENT); */ return NULL; } return u; @@ -296,7 +298,7 @@ int readorders(const char *filename) * vermerkt. */ case P_UNIT: - if (!f || !unitorders(F, enc_gamedata, f)) + if (!f || !unitorders(F, enc_gamedata, f)) { do { b = getbuf(F, enc_gamedata); if (!b) { @@ -307,7 +309,8 @@ int readorders(const char *filename) p = (s && s[0] != '@') ? findparam(s, lang) : NOPARAM; } while ((p != P_UNIT || !f) && p != P_FACTION && p != P_NEXT && p != P_GAMENAME); - break; + } + break; /* Falls in unitorders() abgebrochen wird, steht dort entweder eine neue * Partei, eine neue Einheit oder das File-Ende. Das switch() wird erneut @@ -376,49 +379,6 @@ race_t typus2race(unsigned char typus) return NORACE; } -void create_backup(char *file) -{ -#ifdef HAVE_LINK - char bfile[MAX_PATH]; - int c = 1; - - if (access(file, R_OK) == 0) - return; - do { - sprintf(bfile, "%s.backup%d", file, c); - c++; - } while (access(bfile, R_OK) == 0); - link(file, bfile); -#endif -} - -void read_items(struct storage *store, item ** ilist) -{ - for (;;) { - char ibuf[32]; - const item_type *itype; - int i; - READ_STR(store, ibuf, sizeof(ibuf)); - if (!strcmp("end", ibuf)) { - break; - } - itype = it_find(ibuf); - READ_INT(store, &i); - if (i <= 0) { - log_error("data contains an entry with %d %s", i, resourcename(itype->rtype, NMF_PLURAL)); - } - else { - if (itype && itype->rtype) { - i_change(ilist, itype, i); - } - else { - log_error("data contains unknown item type %s.", ibuf); - } - assert(itype && itype->rtype); - } - } -} - static void read_alliances(struct gamedata *data) { storage *store = data->store; @@ -551,19 +511,6 @@ void write_alliances(struct gamedata *data) WRITE_SECTION(data->store); } -void write_items(struct storage *store, item * ilist) -{ - item *itm; - for (itm = ilist; itm; itm = itm->next) { - assert(itm->number >= 0); - if (itm->number) { - WRITE_TOK(store, resourcename(itm->type->rtype, 0)); - WRITE_INT(store, itm->number); - } - } - WRITE_TOK(store, "end"); -} - static int resolve_owner(variant id, void *address) { region_owner *owner = (region_owner *)address; @@ -623,12 +570,14 @@ static void write_owner(struct gamedata *data, region_owner * owner) if (owner) { faction *f; WRITE_INT(data->store, owner->since_turn); - WRITE_INT(data->store, owner->morale_turn); - WRITE_INT(data->store, owner->flags); - f = owner->last_owner; - write_faction_reference((f && f->_alive) ? f : NULL, data->store); - f = owner->owner; - write_faction_reference((f && f->_alive) ? f : NULL, data->store); + if (owner->since_turn >= 0) { + WRITE_INT(data->store, owner->morale_turn); + WRITE_INT(data->store, owner->flags); + f = owner->last_owner; + write_faction_reference((f && f->_alive) ? f : NULL, data->store); + f = owner->owner; + write_faction_reference((f && f->_alive) ? f : NULL, data->store); + } } else { WRITE_INT(data->store, -1); @@ -666,39 +615,10 @@ writeorder(struct gamedata *data, const struct order *ord, WRITE_STR(data->store, obuf); } -int read_attribs(gamedata *data, attrib **alist, void *owner) { - int result; - if (data->version < ATHASH_VERSION) { - result = a_read_orig(data, alist, owner); - } - else { - result = a_read(data, alist, owner); - } - if (result == AT_READ_DEPR) { - /* handle deprecated attributes */ - attrib *a = *alist; - while (a) { - if (a->type->upgrade) { - a->type->upgrade(alist, a); - } - a = a->nexttype; - } - } - return result; -} - -void write_attribs(storage *store, attrib *alist, const void *owner) -{ -#if RELEASE_VERSION < ATHASH_VERSION - a_write_orig(store, alist, owner); -#else - a_write(store, alist, owner); -#endif -} - unit *read_unit(struct gamedata *data) { unit *u; + const race *rc; int number, n, p; order **orderp; char obuf[DISPLAYSIZE]; @@ -745,12 +665,18 @@ unit *read_unit(struct gamedata *data) } READ_STR(data->store, obuf, sizeof(obuf)); + if (unicode_utf8_trim(obuf)!=0) { + log_warning("trim unit %s name to '%s'", itoa36(u->no), obuf); + } u->_name = obuf[0] ? _strdup(obuf) : 0; if (lomem) { READ_STR(data->store, NULL, 0); } else { READ_STR(data->store, obuf, sizeof(obuf)); + if (unicode_utf8_trim(obuf)!=0) { + log_warning("trim unit %s info to '%s'", itoa36(u->no), obuf); + } u->display = obuf[0] ? _strdup(obuf) : 0; } READ_INT(data->store, &number); @@ -760,7 +686,9 @@ unit *read_unit(struct gamedata *data) u->age = (short)n; READ_TOK(data->store, rname, sizeof(rname)); - u_setrace(u, rc_find(rname)); + rc = rc_find(rname); + assert(rc); + u_setrace(u, rc); READ_TOK(data->store, rname, sizeof(rname)); if (rname[0] && skill_enabled(SK_STEALTH)) @@ -768,8 +696,8 @@ unit *read_unit(struct gamedata *data) else u->irace = NULL; - if (u_race(u)->describe) { - const char *rcdisp = u_race(u)->describe(u, u->faction->locale); + if (rc->describe) { + const char *rcdisp = rc->describe(rc, u->faction->locale); if (u->display && rcdisp) { /* see if the data file contains old descriptions */ if (strcmp(rcdisp, u->display) == 0) { @@ -982,6 +910,9 @@ static region *readregion(struct gamedata *data, int x, int y) else { char info[DISPLAYSIZE]; READ_STR(data->store, info, sizeof(info)); + if (unicode_utf8_trim(info)!=0) { + log_warning("trim region %d info to '%s'", uid, info); + }; region_setinfo(r, info); } @@ -999,6 +930,9 @@ static region *readregion(struct gamedata *data, int x, int y) if (fval(r->terrain, LAND_REGION)) { r->land = calloc(1, sizeof(land_region)); READ_STR(data->store, name, sizeof(name)); + if (unicode_utf8_trim(name)!=0) { + log_warning("trim region %d name to '%s'", uid, name); + }; r->land->name = _strdup(name); } if (r->land) { @@ -1094,6 +1028,9 @@ static region *readregion(struct gamedata *data, int x, int y) READ_INT(data->store, &n); r_setdemand(r, rtype->ltype, n); } + if (!r->land->demands) { + fix_demand(r); + } read_items(data->store, &r->land->items); if (data->version >= REGIONOWNER_VERSION) { READ_INT(data->store, &n); @@ -1105,6 +1042,17 @@ static region *readregion(struct gamedata *data, int x, int y) return r; } +region *read_region(gamedata *data) +{ + storage *store = data->store; + region *r; + int x, y; + READ_INT(store, &x); + READ_INT(store, &y); + r = readregion(data, x, y); + return r; +} + void writeregion(struct gamedata *data, const region * r) { assert(r); @@ -1169,6 +1117,14 @@ void writeregion(struct gamedata *data, const region * r) WRITE_SECTION(data->store); } +void write_region(gamedata *data, const region *r) +{ + storage *store = data->store; + WRITE_INT(store, r->x); + WRITE_INT(store, r->y); + writeregion(data, r); +} + static ally **addally(const faction * f, ally ** sfp, int aid, int state) { struct faction *af = findfaction(aid); @@ -1223,56 +1179,6 @@ int get_spell_level_faction(const spell * sp, void * cbdata) return 0; } -void read_spellbook(spellbook **bookp, gamedata *data, int(*get_level)(const spell * sp, void *), void * cbdata) -{ - for (;;) { - spell *sp = 0; - char spname[64]; - int level = 0; - - READ_TOK(data->store, spname, sizeof(spname)); - if (strcmp(spname, "end") == 0) - break; - if (bookp) { - sp = find_spell(spname); - if (!sp) { - log_error("read_spells: could not find spell '%s'", spname); - } - } - if (data->version >= SPELLBOOK_VERSION) { - READ_INT(data->store, &level); - } - if (sp) { - spellbook * sb = *bookp; - if (level <= 0 && get_level) { - level = get_level(sp, cbdata); - } - if (!sb) { - *bookp = create_spellbook(0); - sb = *bookp; - } - if (level > 0 && (data->version >= SPELLBOOK_VERSION || !spellbook_get(sb, sp))) { - spellbook_add(sb, sp, level); - } - } - } -} - -void write_spellbook(const struct spellbook *book, struct storage *store) -{ - quicklist *ql; - int qi; - - if (book) { - for (ql = book->spells, qi = 0; ql; ql_advance(&ql, &qi, 1)) { - spellbook_entry *sbe = (spellbook_entry *)ql_get(ql, qi); - WRITE_TOK(store, sbe->sp->sname); - WRITE_INT(store, sbe->level); - } - } - WRITE_TOK(store, "end"); -} - static char * getpasswd(int fno) { const char *prefix = itoa36(fno); size_t len = strlen(prefix); @@ -1324,11 +1230,7 @@ void _test_write_password(gamedata *data, const faction *f) { write_password(data, f); } -/** Reads a faction from a file. - * This function requires no context, can be called in any state. The - * faction may not already exist, however. - */ -faction *readfaction(struct gamedata * data) +faction *read_faction(struct gamedata * data) { ally **sfp; int planes, n; @@ -1343,9 +1245,10 @@ faction *readfaction(struct gamedata * data) f->no = n; } else { - f->allies = NULL; /* mem leak */ - while (f->attribs) + f->allies = NULL; /* FIXME: mem leak */ + while (f->attribs) { a_remove(&f->attribs, f->attribs); + } } READ_INT(data->store, &f->subscription); @@ -1379,11 +1282,17 @@ faction *readfaction(struct gamedata * data) } READ_STR(data->store, name, sizeof(name)); + if (unicode_utf8_trim(name)!=0) { + log_warning("trim faction %s name to '%s'", itoa36(f->no), name); + }; f->name = _strdup(name); READ_STR(data->store, name, sizeof(name)); + if (unicode_utf8_trim(name)!=0) { + log_warning("trim faction %s banner to '%s'", itoa36(f->no), name); + }; f->banner = _strdup(name); - log_debug(" - Lese Partei %s (%s)", f->name, factionid(f)); + log_debug(" - Lese Partei %s (%s)", f->name, itoa36(f->no)); READ_STR(data->store, name, sizeof(name)); if (set_email(&f->email, name) != 0) { @@ -1473,7 +1382,7 @@ faction *readfaction(struct gamedata * data) return f; } -void writefaction(struct gamedata *data, const faction * f) +void write_faction(struct gamedata *data, const faction * f) { ally *sf; ursprung *ur; @@ -1552,7 +1461,7 @@ static int cb_sb_maxlevel(spellbook_entry *sbe, void *cbdata) { return 0; } -int readgame(const char *filename, bool backup) +int readgame(const char *filename) { int n; char path[MAX_PATH]; @@ -1566,10 +1475,6 @@ int readgame(const char *filename, bool backup) log_debug("- reading game data from %s", filename); join_path(datapath(), filename, path, sizeof(path)); - if (backup) { - create_backup(path); - } - F = fopen(path, "rb"); if (!F) { perror(path); @@ -1599,17 +1504,131 @@ int readgame(const char *filename, bool backup) return n; } -int read_game(gamedata *data) { +void write_building(gamedata *data, const building *b) +{ + storage *store = data->store; + + write_building_reference(b, store); + WRITE_STR(store, b->name); + WRITE_STR(store, b->display ? b->display : ""); + WRITE_INT(store, b->size); + WRITE_TOK(store, b->type->_name); + write_attribs(store, b->attribs, b); +} + +struct building *read_building(gamedata *data) { char name[DISPLAYSIZE]; - int n, p, nread; + building *b; + storage * store = data->store; + + b = (building *)calloc(1, sizeof(building)); + READ_INT(store, &b->no); + bhash(b); + READ_STR(store, name, sizeof(name)); + if (unicode_utf8_trim(name)!=0) { + log_warning("trim building %s name to '%s'", itoa36(b->no), name); + } + b->name = _strdup(name); + if (lomem) { + READ_STR(store, NULL, 0); + } + else { + READ_STR(store, name, sizeof(name)); + if (unicode_utf8_trim(name)!=0) { + log_warning("trim building %s info to '%s'", itoa36(b->no), name); + } + b->display = _strdup(name); + } + READ_INT(store, &b->size); + READ_STR(store, name, sizeof(name)); + b->type = bt_find(name); + read_attribs(data, &b->attribs, b); + + // repairs, bug 2221: + if (b->type->maxsize>0 && b->size>b->type->maxsize) { + log_error("building too big: %s (%s size %d of %d), fixing.", buildingname(b), b->type->_name, b->size, b->type->maxsize); + b->size = b->type->maxsize; + } + return b; +} + +void write_ship(gamedata *data, const ship *sh) +{ + storage *store = data->store; + write_ship_reference(sh, store); + WRITE_STR(store, (const char *)sh->name); + WRITE_STR(store, sh->display ? (const char *)sh->display : ""); + WRITE_TOK(store, sh->type->_name); + WRITE_INT(store, sh->size); + WRITE_INT(store, sh->damage); + WRITE_INT(store, sh->flags & SFL_SAVEMASK); + assert((sh->type->flags & SFL_NOCOAST) == 0 || sh->coast == NODIRECTION); + WRITE_INT(store, sh->coast); + write_attribs(store, sh->attribs, sh); +} + +ship *read_ship(struct gamedata *data) +{ + char name[DISPLAYSIZE]; + ship *sh; + int n; + storage *store = data->store; + + sh = (ship *)calloc(1, sizeof(ship)); + READ_INT(store, &sh->no); + shash(sh); + READ_STR(store, name, sizeof(name)); + if (unicode_utf8_trim(name)!=0) { + log_warning("trim ship %s name to '%s'", itoa36(sh->no), name); + } + sh->name = _strdup(name); + if (lomem) { + READ_STR(store, NULL, 0); + } + else { + READ_STR(store, name, sizeof(name)); + if (unicode_utf8_trim(name)!=0) { + log_warning("trim ship %s info to '%s'", itoa36(sh->no), name); + } + sh->display = _strdup(name); + } + READ_STR(store, name, sizeof(name)); + sh->type = st_find(name); + if (sh->type == NULL) { + /* old datafiles */ + sh->type = st_find((const char *)LOC(default_locale, name)); + } + assert(sh->type || !"ship_type not registered!"); + + READ_INT(store, &sh->size); + READ_INT(store, &sh->damage); + if (data->version >= FOSS_VERSION) { + READ_INT(store, &sh->flags); + } + + /* Attribute rekursiv einlesen */ + + READ_INT(store, &n); + sh->coast = (direction_t)n; + if (sh->type->flags & SFL_NOCOAST) { + sh->coast = NODIRECTION; + } + read_attribs(data, &sh->attribs, sh); + return sh; +} + + +int read_game(gamedata *data) { + int p, nread; faction *f, **fp; region *r; - building *b, **bp; + building **bp; ship **shp; unit *u; int rmax = maxregions; - const struct building_type *bt_lighthouse = bt_find("lighthouse"); storage * store = data->store; + const struct building_type *bt_lighthouse = bt_find("lighthouse"); + if (data->version >= SAVEGAMEID_VERSION) { int gameid; @@ -1641,11 +1660,12 @@ int read_game(gamedata *data) { READ_INT(store, &nread); log_debug(" - Einzulesende Parteien: %d\n", nread); fp = &factions; - while (*fp) + while (*fp) { fp = &(*fp)->next; + } while (--nread >= 0) { - faction *f = readfaction(data); + faction *f = read_faction(data); *fp = f; fp = &f->next; @@ -1661,53 +1681,23 @@ int read_game(gamedata *data) { rmax = nread; } log_debug(" - Einzulesende Regionen: %d/%d\r", rmax, nread); + while (--nread >= 0) { unit **up; - int x, y; - READ_INT(store, &x); - READ_INT(store, &y); - if ((nread & 0x3FF) == 0) { /* das spart extrem Zeit */ - log_debug(" - Einzulesende Regionen: %d/%d * %d,%d \r", rmax, nread, x, y); - } - --rmax; - - r = readregion(data, x, y); + r = read_region(data); /* Burgen */ READ_INT(store, &p); bp = &r->buildings; while (--p >= 0) { - - b = (building *)calloc(1, sizeof(building)); - READ_INT(store, &b->no); - *bp = b; - bp = &b->next; - bhash(b); - READ_STR(store, name, sizeof(name)); - b->name = _strdup(name); - if (lomem) { - READ_STR(store, NULL, 0); - } - else { - READ_STR(store, name, sizeof(name)); - b->display = _strdup(name); - } - READ_INT(store, &b->size); - READ_STR(store, name, sizeof(name)); - b->type = bt_find(name); - b->region = r; - read_attribs(data, &b->attribs, b); + building *b = *bp = read_building(data); if (b->type == bt_lighthouse) { r->flags |= RF_LIGHTHOUSE; } - - // repairs, bug 2221: - if (b->type->maxsize>0 && b->size>b->type->maxsize) { - log_error("building too big: %s (%s size %d of %d), fixing.", buildingname(b), b->type->_name, b->size, b->type->maxsize); - b->size = b->type->maxsize; - } + b->region = r; + bp = &b->next; } /* Schiffe */ @@ -1715,43 +1705,9 @@ int read_game(gamedata *data) { shp = &r->ships; while (--p >= 0) { - ship *sh = (ship *)calloc(1, sizeof(ship)); + ship *sh = *shp = read_ship(data); sh->region = r; - READ_INT(store, &sh->no); - *shp = sh; shp = &sh->next; - shash(sh); - READ_STR(store, name, sizeof(name)); - sh->name = _strdup(name); - if (lomem) { - READ_STR(store, NULL, 0); - } - else { - READ_STR(store, name, sizeof(name)); - sh->display = _strdup(name); - } - READ_STR(store, name, sizeof(name)); - sh->type = st_find(name); - if (sh->type == NULL) { - /* old datafiles */ - sh->type = st_find((const char *)LOC(default_locale, name)); - } - assert(sh->type || !"ship_type not registered!"); - - READ_INT(store, &sh->size); - READ_INT(store, &sh->damage); - if (data->version >= FOSS_VERSION) { - READ_INT(store, &sh->flags); - } - - /* Attribute rekursiv einlesen */ - - READ_INT(store, &n); - sh->coast = (direction_t)n; - if (sh->type->flags & SFL_NOCOAST) { - sh->coast = NODIRECTION; - } - read_attribs(data, &sh->attribs, sh); } *shp = 0; @@ -1776,8 +1732,13 @@ int read_game(gamedata *data) { *up = u; up = &u->next; - update_interval(u->faction, u->region); + update_interval(u->faction, r); } + + if ((nread & 0x3FF) == 0) { /* das spart extrem Zeit */ + log_debug(" - Einzulesende Regionen: %d/%d * %d,%d \r", rmax, nread, r->x, r->y); + } + --rmax; } read_borders(data); @@ -1789,8 +1750,9 @@ int read_game(gamedata *data) { for (r = regions; r; r = r->next) { if (r->flags & RF_LIGHTHOUSE) { building *b; - for (b = r->buildings; b; b = b->next) + for (b = r->buildings; b; b = b->next) { update_lighthouse(b); + } } } log_debug("marking factions as alive."); @@ -1868,7 +1830,11 @@ int writegame(const char *filename) join_path(datapath(), filename, path, sizeof(path)); #ifdef HAVE_UNISTD_H /* make sure we don't overwrite an existing file (hard links) */ - unlink(path); + if (unlink(path)!=0) { + if (errno==ENOENT) { + errno = 0; + } + } #endif F = fopen(path, "wb"); if (!F) { @@ -1885,7 +1851,7 @@ int writegame(const char *filename) fstream_init(&strm, F); binstore_init(&store, &strm); - WRITE_INT(&store, VERSION_BUILD); + WRITE_INT(&store, version_no(eressea_version())); n = write_game(&gdata); binstore_done(&store); fstream_done(&strm); @@ -1922,7 +1888,7 @@ int write_game(gamedata *data) { if (fval(f, FFL_NPC)) { clear_npc_orders(f); } - writefaction(data, f); + write_faction(data, f); WRITE_SECTION(store); } @@ -1942,44 +1908,26 @@ int write_game(gamedata *data) { log_debug(" - Schreibe Regionen: %d", n); } WRITE_SECTION(store); - WRITE_INT(store, r->x); - WRITE_INT(store, r->y); - writeregion(data, r); + write_region(data, r); WRITE_INT(store, listlen(r->buildings)); WRITE_SECTION(store); for (b = r->buildings; b; b = b->next) { - write_building_reference(b, store); - WRITE_STR(store, b->name); - WRITE_STR(store, b->display ? b->display : ""); - WRITE_INT(store, b->size); - WRITE_TOK(store, b->type->_name); - WRITE_SECTION(store); - write_attribs(store, b->attribs, b); - WRITE_SECTION(store); + assert(b->region == r); + write_building(data, b); } WRITE_INT(store, listlen(r->ships)); WRITE_SECTION(store); for (sh = r->ships; sh; sh = sh->next) { assert(sh->region == r); - write_ship_reference(sh, store); - WRITE_STR(store, (const char *)sh->name); - WRITE_STR(store, sh->display ? (const char *)sh->display : ""); - WRITE_TOK(store, sh->type->_name); - WRITE_INT(store, sh->size); - WRITE_INT(store, sh->damage); - WRITE_INT(store, sh->flags & SFL_SAVEMASK); - assert((sh->type->flags & SFL_NOCOAST) == 0 || sh->coast == NODIRECTION); - WRITE_INT(store, sh->coast); - WRITE_SECTION(store); - write_attribs(store, sh->attribs, sh); - WRITE_SECTION(store); + write_ship(data, sh); } WRITE_INT(store, listlen(r->units)); WRITE_SECTION(store); for (u = r->units; u; u = u->next) { + assert(u->region == r); write_unit(data, u); } } @@ -1989,92 +1937,3 @@ int write_game(gamedata *data) { return 0; } - -int a_readint(attrib * a, void *owner, struct gamedata *data) -{ - /* assert(sizeof(int)==sizeof(a->data)); */ - READ_INT(data->store, &a->data.i); - return AT_READ_OK; -} - -void a_writeint(const attrib * a, const void *owner, struct storage *store) -{ - WRITE_INT(store, a->data.i); -} - -int a_readshorts(attrib * a, void *owner, struct gamedata *data) -{ - int n; - READ_INT(data->store, &n); - a->data.sa[0] = (short)n; - READ_INT(data->store, &n); - a->data.sa[1] = (short)n; - return AT_READ_OK; -} - -void a_writeshorts(const attrib * a, const void *owner, struct storage *store) -{ - WRITE_INT(store, a->data.sa[0]); - WRITE_INT(store, a->data.sa[1]); -} - -int a_readchars(attrib * a, void *owner, struct gamedata *data) -{ - int i; - for (i = 0; i != 4; ++i) { - int n; - READ_INT(data->store, &n); - a->data.ca[i] = (char)n; - } - return AT_READ_OK; -} - -void a_writechars(const attrib * a, const void *owner, struct storage *store) -{ - int i; - - for (i = 0; i != 4; ++i) { - WRITE_INT(store, a->data.ca[i]); - } -} - -int a_readvoid(attrib * a, void *owner, struct gamedata *data) -{ - return AT_READ_OK; -} - -void a_writevoid(const attrib * a, const void *owner, struct storage *store) -{ -} - -int a_readstring(attrib * a, void *owner, struct gamedata *data) -{ - char buf[DISPLAYSIZE]; - char * result = 0; - int e; - size_t len = 0; - do { - e = READ_STR(data->store, buf, sizeof(buf)); - if (result) { - result = realloc(result, len + DISPLAYSIZE - 1); - strcpy(result + len, buf); - len += DISPLAYSIZE - 1; - } - else { - result = _strdup(buf); - } - } while (e == ENOMEM); - a->data.v = result; - return AT_READ_OK; -} - -void a_writestring(const attrib * a, const void *owner, struct storage *store) -{ - assert(a->data.v); - WRITE_STR(store, (const char *)a->data.v); -} - -void a_finalizestring(attrib * a) -{ - free(a->data.v); -} diff --git a/src/kernel/save.h b/src/kernel/save.h index 3cd443926..be78b9c68 100644 --- a/src/kernel/save.h +++ b/src/kernel/save.h @@ -30,52 +30,40 @@ extern "C" { struct spell; struct spellbook; struct unit; + struct building; + struct faction; + struct region; + struct ship; struct gamedata; #define MAX_INPUT_SIZE DISPLAYSIZE*2 /* Nach MAX_INPUT_SIZE brechen wir das Einlesen der Zeile ab und nehmen an, * dass hier ein Fehler (fehlende ") vorliegt */ - extern int data_version; + // TODO: is this *really* still in use? extern int enc_gamedata; int readorders(const char *filename); int creategame(void); - int readgame(const char *filename, bool backup); + int readgame(const char *filename); int writegame(const char *filename); int current_turn(void); - void read_items(struct storage *store, struct item **it); - void write_items(struct storage *store, struct item *it); - - void read_spellbook(struct spellbook **bookp, struct gamedata *data, int(*get_level)(const struct spell * sp, void *), void * cbdata); - void write_spellbook(const struct spellbook *book, struct storage *store); - - void write_attribs(struct storage *store, struct attrib *alist, const void *owner); - int read_attribs(struct gamedata *store, struct attrib **alist, void *owner); - void write_unit(struct gamedata *data, const struct unit *u); struct unit *read_unit(struct gamedata *data); + + void write_faction(struct gamedata *data, const struct faction *f); + struct faction *read_faction(struct gamedata *data); - int a_readint(struct attrib *a, void *owner, struct gamedata *); - void a_writeint(const struct attrib *a, const void *owner, - struct storage *store); - int a_readshorts(struct attrib *a, void *owner, struct gamedata *); - void a_writeshorts(const struct attrib *a, const void *owner, - struct storage *store); - int a_readchars(struct attrib *a, void *owner, struct gamedata *); - void a_writechars(const struct attrib *a, const void *owner, - struct storage *store); - int a_readvoid(struct attrib *a, void *owner, struct gamedata *); - void a_writevoid(const struct attrib *a, const void *owner, - struct storage *); - int a_readstring(struct attrib *a, void *owner, struct gamedata *); - void a_writestring(const struct attrib *a, const void *owner, - struct storage *); - void a_finalizestring(struct attrib *a); + void write_region(struct gamedata *data, const struct region *r); + struct region *read_region(struct gamedata *data); - void create_backup(char *file); + void write_building(struct gamedata *data, const struct building *b); + struct building *read_building(struct gamedata *data); + + void write_ship(struct gamedata *data, const struct ship *sh); + struct ship *read_ship(struct gamedata *data); int write_game(struct gamedata *data); int read_game(struct gamedata *data); diff --git a/src/kernel/save.test.c b/src/kernel/save.test.c index e88cf7b2b..6a2758a1d 100644 --- a/src/kernel/save.test.c +++ b/src/kernel/save.test.c @@ -5,13 +5,15 @@ #include #include "save.h" +#include "version.h" +#include "building.h" +#include "ship.h" #include "unit.h" #include "group.h" #include "ally.h" #include "faction.h" #include "plane.h" #include "region.h" -#include "version.h" #include #include @@ -26,17 +28,17 @@ #include #include -#include - #include +#include +#include static void test_readwrite_data(CuTest * tc) { const char *filename = "test.dat"; char path[MAX_PATH]; - test_cleanup(); + test_setup(); CuAssertIntEquals(tc, 0, writegame(filename)); - CuAssertIntEquals(tc, 0, readgame(filename, false)); + CuAssertIntEquals(tc, 0, readgame(filename)); join_path(datapath(), filename, path, sizeof(path)); CuAssertIntEquals(tc, 0, remove(path)); test_cleanup(); @@ -51,12 +53,13 @@ static void test_readwrite_unit(CuTest * tc) struct faction *f; int fno; - test_cleanup(); + test_setup(); r = test_create_region(0, 0, 0); f = test_create_faction(0); fno = f->no; u = test_create_unit(f, r); - + unit_setname(u, " Hodor "); + CuAssertStrEquals(tc, " Hodor ", u->_name); mstream_init(&data.strm); gamedata_init(&data, &store, RELEASE_VERSION); write_unit(&data, u); @@ -64,15 +67,141 @@ static void test_readwrite_unit(CuTest * tc) data.strm.api->rewind(data.strm.handle); free_gamedata(); f = test_create_faction(0); + r = test_create_region(0, 0, 0); renumber_faction(f, fno); gamedata_init(&data, &store, RELEASE_VERSION); u = read_unit(&data); - mstream_done(&data.strm); - gamedata_done(&data); - CuAssertPtrNotNull(tc, u); CuAssertPtrEquals(tc, f, u->faction); + CuAssertStrEquals(tc, "Hodor", u->_name); CuAssertPtrEquals(tc, 0, u->region); + + mstream_done(&data.strm); + gamedata_done(&data); + move_unit(u, r, NULL); // this makes sure that u doesn't leak + test_cleanup(); +} + +static void test_readwrite_faction(CuTest * tc) +{ + gamedata data; + storage store; + faction *f; + + test_setup(); + f = test_create_faction(0); + free(f->name); + f->name = _strdup(" Hodor "); + CuAssertStrEquals(tc, " Hodor ", f->name); + mstream_init(&data.strm); + gamedata_init(&data, &store, RELEASE_VERSION); + write_faction(&data, f); + + data.strm.api->rewind(data.strm.handle); + free_gamedata(); + gamedata_init(&data, &store, RELEASE_VERSION); + f = read_faction(&data); + CuAssertPtrNotNull(tc, f); + CuAssertStrEquals(tc, "Hodor", f->name); + CuAssertPtrEquals(tc, 0, f->units); + factions = f; + + mstream_done(&data.strm); + gamedata_done(&data); + test_cleanup(); +} + +static void test_readwrite_region(CuTest * tc) +{ + gamedata data; + storage store; + region *r; + + test_setup(); + r = test_create_region(0, 0, 0); + free(r->land->name); + r->land->name = _strdup(" Hodor "); + CuAssertStrEquals(tc, " Hodor ", r->land->name); + mstream_init(&data.strm); + gamedata_init(&data, &store, RELEASE_VERSION); + write_region(&data, r); + + data.strm.api->rewind(data.strm.handle); + free_gamedata(); + gamedata_init(&data, &store, RELEASE_VERSION); + r = read_region(&data); + CuAssertPtrNotNull(tc, r); + CuAssertStrEquals(tc, "Hodor", r->land->name); + regions = r; + + mstream_done(&data.strm); + gamedata_done(&data); + test_cleanup(); +} + +static void test_readwrite_building(CuTest * tc) +{ + gamedata data; + storage store; + building *b; + region *r; + + test_setup(); + r = test_create_region(0, 0, 0); + b = test_create_building(r, 0); + free(b->name); + b->name = _strdup(" Hodor "); + CuAssertStrEquals(tc, " Hodor ", b->name); + mstream_init(&data.strm); + gamedata_init(&data, &store, RELEASE_VERSION); + write_building(&data, b); + + data.strm.api->rewind(data.strm.handle); + free_gamedata(); + r = test_create_region(0, 0, 0); + gamedata_init(&data, &store, RELEASE_VERSION); + b = read_building(&data); + CuAssertPtrNotNull(tc, b); + CuAssertStrEquals(tc, "Hodor", b->name); + CuAssertPtrEquals(tc, 0, b->region); + b->region = r; + r->buildings = b; + + mstream_done(&data.strm); + gamedata_done(&data); + test_cleanup(); +} + +static void test_readwrite_ship(CuTest * tc) +{ + gamedata data; + storage store; + ship *sh; + region *r; + + test_setup(); + r = test_create_region(0, 0, 0); + sh = test_create_ship(r, 0); + free(sh->name); + sh->name = _strdup(" Hodor "); + CuAssertStrEquals(tc, " Hodor ", sh->name); + mstream_init(&data.strm); + gamedata_init(&data, &store, RELEASE_VERSION); + write_ship(&data, sh); + + data.strm.api->rewind(data.strm.handle); + free_gamedata(); + r = test_create_region(0, 0, 0); + gamedata_init(&data, &store, RELEASE_VERSION); + sh = read_ship(&data); + CuAssertPtrNotNull(tc, sh); + CuAssertStrEquals(tc, "Hodor", sh->name); + CuAssertPtrEquals(tc, 0, sh->region); + sh->region = r; + r->ships = sh; + + mstream_done(&data.strm); + gamedata_done(&data); test_cleanup(); } @@ -81,7 +210,7 @@ static void test_readwrite_attrib(CuTest *tc) { storage store; attrib *a = NULL; - test_cleanup(); + test_setup(); key_set(&a, 41); key_set(&a, 42); mstream_init(&data.strm); @@ -155,14 +284,14 @@ static void test_readwrite_dead_faction_regionowner(CuTest *tc) { gamedata data; storage store; + test_setup(); mstream_init(&data.strm); gamedata_init(&data, &store, RELEASE_VERSION); - test_cleanup(); config_set("rules.region_owners", "1"); f = test_create_faction(0); test_create_unit(f, r = test_create_region(0, 0, 0)); - region_set_owner(r, f, turn); + region_set_owner(r, f, 0); destroyfaction(&factions); CuAssertTrue(tc, !f->_alive); remove_empty_units(); @@ -260,6 +389,7 @@ static void test_read_password(CuTest *tc) { storage store; faction *f; + test_setup(); f = test_create_faction(0); faction_setpassword(f, password_encode("secret", PASSWORD_DEFAULT)); mstream_init(&data.strm); @@ -270,6 +400,7 @@ static void test_read_password(CuTest *tc) { mstream_done(&data.strm); gamedata_done(&data); CuAssertTrue(tc, checkpasswd(f, "secret")); + test_cleanup(); } static void test_read_password_external(CuTest *tc) { @@ -279,7 +410,10 @@ static void test_read_password_external(CuTest *tc) { faction *f; FILE * F; - remove(pwfile); + test_setup(); + if (remove(pwfile) != 0) { + errno = 0; + } f = test_create_faction(0); faction_setpassword(f, password_encode("secret", PASSWORD_DEFAULT)); CuAssertPtrNotNull(tc, f->_password); @@ -305,6 +439,13 @@ static void test_read_password_external(CuTest *tc) { mstream_done(&data.strm); gamedata_done(&data); CuAssertIntEquals(tc, 0, remove(pwfile)); + test_cleanup(); +} + +static void test_version_no(CuTest *tc) { + CuAssertIntEquals(tc, 0, version_no("0.0.0-devel")); + CuAssertIntEquals(tc, 0x10000, version_no("1.0.0-test")); + CuAssertIntEquals(tc, 0x10203, version_no("1.2.3-what.is.42")); } CuSuite *get_save_suite(void) @@ -313,11 +454,17 @@ CuSuite *get_save_suite(void) SUITE_ADD_TEST(suite, test_readwrite_attrib); SUITE_ADD_TEST(suite, test_readwrite_data); SUITE_ADD_TEST(suite, test_readwrite_unit); + SUITE_ADD_TEST(suite, test_readwrite_faction); + SUITE_ADD_TEST(suite, test_readwrite_region); + SUITE_ADD_TEST(suite, test_readwrite_building); + SUITE_ADD_TEST(suite, test_readwrite_ship); SUITE_ADD_TEST(suite, test_readwrite_dead_faction_createunit); SUITE_ADD_TEST(suite, test_readwrite_dead_faction_changefaction); SUITE_ADD_TEST(suite, test_readwrite_dead_faction_regionowner); SUITE_ADD_TEST(suite, test_readwrite_dead_faction_group); SUITE_ADD_TEST(suite, test_read_password); SUITE_ADD_TEST(suite, test_read_password_external); + SUITE_ADD_TEST(suite, test_version_no); + return suite; } diff --git a/src/kernel/ship.c b/src/kernel/ship.c index b10af5aeb..6898630ff 100644 --- a/src/kernel/ship.c +++ b/src/kernel/ship.c @@ -78,7 +78,7 @@ const ship_type *findshiptype(const char *name, const struct locale *lang) variant var2; const char *n = LOC(lang, stype->_name); var2.v = (void *)stype; - addtoken(&sn->names, n, var2); + addtoken((struct tnode **)&sn->names, n, var2); } snames = sn; } @@ -201,7 +201,7 @@ ship *new_ship(const ship_type * stype, region * r, const struct locale *lang) sname = parameters[P_SHIP]; } assert(sname); - slprintf(buffer, sizeof(buffer), "%s %s", sname, shipid(sh)); + slprintf(buffer, sizeof(buffer), "%s %s", sname, itoa36(sh->no)); sh->name = _strdup(buffer); shash(sh); if (r) { @@ -297,12 +297,9 @@ int crew_skill(const ship *sh) { int shipspeed(const ship * sh, const unit * u) { - int k = sh->type->range; - static const struct curse_type *stormwind_ct, *nodrift_ct; - static bool init; attrib *a; struct curse *c; - int bonus; + int k, bonus; assert(sh); if (!u) u = ship_owner(sh); @@ -312,19 +309,18 @@ int shipspeed(const ship * sh, const unit * u) assert(sh->type->construction); assert(sh->type->construction->improvement == NULL); /* sonst ist construction::size nicht ship_type::maxsize */ - if (!init) { - init = true; - stormwind_ct = ct_find("stormwind"); - nodrift_ct = ct_find("nodrift"); - } + k = sh->type->range; if (sh->size != sh->type->construction->maxsize) return 0; - if (curse_active(get_curse(sh->attribs, stormwind_ct))) - k *= 2; - if (curse_active(get_curse(sh->attribs, nodrift_ct))) - k += 1; - + if (sh->attribs) { + if (curse_active(get_curse(sh->attribs, ct_find("stormwind")))) { + k *= 2; + } + if (curse_active(get_curse(sh->attribs, ct_find("nodrift")))) { + k += 1; + } + } if (u->faction->race == u_race(u)) { /* race bonus for this faction? */ if (fval(u_race(u), RCF_SHIPSPEED)) { @@ -333,7 +329,7 @@ int shipspeed(const ship * sh, const unit * u) } bonus = ShipSpeedBonus(u); - if (bonus > 0 && sh->type->range_max>sh->type->range) { + if (bonus > 0 && sh->type->range_max > sh->type->range) { int crew = crew_skill(sh); int crew_bonus = (crew / sh->type->sumskill / 2) - 1; if (crew_bonus > 0) { @@ -358,7 +354,7 @@ int shipspeed(const ship * sh, const unit * u) c = c->nexthash; } - if (sh->damage>0) { + if (sh->damage > 0) { int size = sh->size * DAMAGE_SCALE; k *= (size - sh->damage); k = (k + size - 1) / size; @@ -421,7 +417,7 @@ static unit * ship_owner_ex(const ship * sh, const struct faction * last_owner) { unit *u, *heir = 0; - /* Eigentümer tot oder kein Eigentümer vorhanden. Erste lebende Einheit + /* Eigent�mer tot oder kein Eigent�mer vorhanden. Erste lebende Einheit * nehmen. */ for (u = sh->region->units; u; u = u->next) { if (u->ship == sh) { diff --git a/src/kernel/ship.h b/src/kernel/ship.h index 73b8a9718..964ee2124 100644 --- a/src/kernel/ship.h +++ b/src/kernel/ship.h @@ -18,13 +18,16 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef H_KRNL_SHIP #define H_KRNL_SHIP -#ifdef __cplusplus -extern "C" { -#endif #include "types.h" #include "direction.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + #define DAMAGE_SCALE 100 /* multiplier for sh->damage */ /* ship_type::flags */ @@ -51,8 +54,8 @@ extern "C" { int minskill; /* min. skill to sail this (crew) */ int sumskill; /* min. sum of crew+captain */ - int at_bonus; /* Verändert den Angriffsskill (default: 0) */ - int df_bonus; /* Verändert den Verteidigungskill (default: 0) */ + int at_bonus; /* Ver�ndert den Angriffsskill (default: 0) */ + int df_bonus; /* Ver�ndert den Verteidigungskill (default: 0) */ float tac_bonus; struct terrain_type ** coasts; /* coast that this ship can land on */ @@ -70,12 +73,12 @@ extern "C" { #define NOSHIP NULL -#define SF_DRIFTED 1<<0 -#define SF_MOVED 1<<1 -#define SF_DAMAGED 1<<2 /* for use in combat */ -#define SF_SELECT 1<<3 /* previously FL_DH */ -#define SF_FISHING 1<<4 /* was on an ocean, can fish */ -#define SF_FLYING 1<<5 /* the ship can fly */ +#define SF_DRIFTED (1<<0) +#define SF_MOVED (1<<1) +#define SF_DAMAGED (1<<2) /* for use in combat */ +#define SF_SELECT (1<<3) /* previously FL_DH */ +#define SF_FISHING (1<<4) /* was on an ocean, can fish */ +#define SF_FLYING (1<<5) /* the ship can fly */ #define SFL_SAVEMASK (SF_FLYING) #define INCOME_FISHING 10 diff --git a/src/kernel/skills.c b/src/kernel/skills.c index 171d42dd0..488800115 100644 --- a/src/kernel/skills.c +++ b/src/kernel/skills.c @@ -21,7 +21,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "skill.h" #include "curse.h" -#include "item.h" #include "race.h" #include "region.h" #include "terrain.h" @@ -104,16 +103,22 @@ int value, int flags) int skill_mod(const race * rc, skill_t sk, const struct terrain_type *terrain) { int result = 0; + static int rc_cache; + static const race *rc_dwarf, *rc_insect; + if (rc_changed(&rc_cache)) { + rc_dwarf = get_race(RC_DWARF); + rc_insect = get_race(RC_INSECT); + } result = rc->bonus[sk]; - if (rc == get_race(RC_DWARF)) { + if (rc == rc_dwarf) { if (sk == SK_TACTICS) { if (terrain == newterrain(T_MOUNTAIN) || fval(terrain, ARCTIC_REGION)) ++result; } } - else if (rc == get_race(RC_INSECT)) { + else if (rc == rc_insect) { if (terrain == newterrain(T_MOUNTAIN) || fval(terrain, ARCTIC_REGION)) --result; else if (terrain == newterrain(T_DESERT) || terrain == newterrain(T_SWAMP)) @@ -123,61 +128,28 @@ int skill_mod(const race * rc, skill_t sk, const struct terrain_type *terrain) return result; } -#define RCMODMAXHASH 31 -#ifdef FASTER_SKILLMOD -static struct skillmods { - struct skillmods *next; - const struct race *race; - struct modifiers { - int value[MAXSKILLS]; - } mod[MAXTERRAINS]; -} *modhash[RCMODMAXHASH]; - -static struct skillmods *init_skills(const race * rc) -{ - terrain_t t; - struct skillmods *mods = - (struct skillmods *)calloc(1, sizeof(struct skillmods)); - mods->race = rc; - - for (t = 0; t != MAXTERRAINS; ++t) { - skill_t sk; - for (sk = 0; sk != MAXSKILLS; ++sk) { - mods->mod[t].value[sk] = skill_mod(rc, sk, newterrain(t)); - } - } - return mods; -} -#endif - int rc_skillmod(const struct race *rc, const region * r, skill_t sk) { int mods = 0; - if (!skill_enabled(sk)) { return 0; } -#ifdef FASTER_SKILLMOD - unsigned int index = hashstring(rc->_name) % RCMODMAXHASH; - struct skillmods **imods = &modhash[index]; - while (*imods && (*imods)->race != rc) { - imods = &(*imods)->next; - } - if (*imods == NULL) { - *imods = init_skills(rc); - } - mods = (*imods)->mod[rterrain(r)].value[sk]; -#else if (r) { mods = skill_mod(rc, sk, r->terrain); } -#endif - if (rc == get_race(RC_ELF) && r && r_isforest(r)) { - if (sk == SK_PERCEPTION || sk == SK_STEALTH) { - ++mods; + if (r && r_isforest(r)) { + static int rc_cache; + static const race * rc_elf; + if (rc_changed(&rc_cache)) { + rc_elf = get_race(RC_ELF); } - else if (sk == SK_TACTICS) { - mods += 2; + if (rc == rc_elf) { + if (sk == SK_PERCEPTION || sk == SK_STEALTH) { + ++mods; + } + else if (sk == SK_TACTICS) { + mods += 2; + } } } return mods; @@ -211,9 +183,13 @@ void sk_set(skill * sv, int level) sv->level = level; } -static int rule_random_progress(void) +static bool rule_random_progress(void) { - return config_get_int("study.random_progress", 1); + static int rule, config; + if (config_changed(&config)) { + rule = config_get_int("study.random_progress", 1); + } + return rule != 0; } int skill_weeks(int level) diff --git a/src/kernel/spell.c b/src/kernel/spell.c index ec651bd79..8e14ec2c0 100644 --- a/src/kernel/spell.c +++ b/src/kernel/spell.c @@ -71,7 +71,7 @@ spell * create_spell(const char * name, unsigned int id) assert(len + sizeof(sp) < sizeof(buffer)); if (cb_find_str(&cb_spells, name)) { - log_error("create_spell: duplicate name '%s'\n", name); + log_error("create_spell: duplicate name '%s'", name); return 0; } sp = (spell *)calloc(1, sizeof(spell)); diff --git a/src/kernel/spell.test.c b/src/kernel/spell.test.c index 0c0beb6ce..f61c0fffe 100644 --- a/src/kernel/spell.test.c +++ b/src/kernel/spell.test.c @@ -1,9 +1,12 @@ #include -#include #include -#include +#include +#include +#include + +#include #include #include @@ -13,39 +16,58 @@ static void test_create_a_spell(CuTest * tc) { spell * sp; - test_cleanup(); + test_setup(); CuAssertPtrEquals(tc, 0, spells); CuAssertPtrEquals(tc, 0, find_spell("testspell")); sp = create_spell("testspell", 0); CuAssertPtrEquals(tc, sp, find_spell("testspell")); CuAssertPtrNotNull(tc, spells); + test_cleanup(); } static void test_create_duplicate_spell(CuTest * tc) { spell *sp; - /* FIXME: this test emits ERROR messages (duplicate spells), inject a logger to verify that */ + struct log_t *log; + strlist *sl = 0; + + test_setup(); + test_log_stderr(0); + log = test_log_start(LOG_CPERROR, &sl); - test_cleanup(); CuAssertPtrEquals(tc, 0, find_spell("testspell")); sp = create_spell("testspell", 0); CuAssertPtrEquals(tc, 0, create_spell("testspell", 0)); + CuAssertPtrNotNull(tc, sl); + CuAssertStrEquals(tc, "create_spell: duplicate name '%s'", sl->s); + CuAssertPtrEquals(tc, 0, sl->next); CuAssertPtrEquals(tc, sp, find_spell("testspell")); + test_log_stop(log, sl); + test_cleanup(); } static void test_create_spell_with_id(CuTest * tc) { spell *sp; - /* FIXME: this test emits ERROR messages (duplicate spells), inject a logger to verify that */ + struct log_t *log; + strlist *sl = 0; + + test_setup(); + test_log_stderr(0); + log = test_log_start(LOG_CPERROR, &sl); - test_cleanup(); CuAssertPtrEquals(tc, 0, find_spellbyid(42)); sp = create_spell("testspell", 42); CuAssertPtrEquals(tc, sp, find_spellbyid(42)); CuAssertPtrEquals(tc, 0, create_spell("testspell", 47)); CuAssertPtrEquals(tc, 0, find_spellbyid(47)); + CuAssertPtrNotNull(tc, sl); + CuAssertStrEquals(tc, "create_spell: duplicate name '%s'", sl->s); + CuAssertPtrEquals(tc, 0, sl->next); + test_log_stop(log, sl); + test_cleanup(); } CuSuite *get_spell_suite(void) diff --git a/src/kernel/spellbook.c b/src/kernel/spellbook.c index 96410170b..da8fcd563 100644 --- a/src/kernel/spellbook.c +++ b/src/kernel/spellbook.c @@ -3,9 +3,12 @@ #include #include #include +#include #include "spellbook.h" +#include + #include #include #include @@ -18,6 +21,56 @@ spellbook * create_spellbook(const char * name) return result; } +void read_spellbook(spellbook **bookp, gamedata *data, int(*get_level)(const spell * sp, void *), void * cbdata) +{ + for (;;) { + spell *sp = 0; + char spname[64]; + int level = 0; + + READ_TOK(data->store, spname, sizeof(spname)); + if (strcmp(spname, "end") == 0) + break; + if (bookp) { + sp = find_spell(spname); + if (!sp) { + log_error("read_spells: could not find spell '%s'", spname); + } + } + if (data->version >= SPELLBOOK_VERSION) { + READ_INT(data->store, &level); + } + if (sp) { + spellbook * sb = *bookp; + if (level <= 0 && get_level) { + level = get_level(sp, cbdata); + } + if (!sb) { + *bookp = create_spellbook(0); + sb = *bookp; + } + if (level > 0 && (data->version >= SPELLBOOK_VERSION || !spellbook_get(sb, sp))) { + spellbook_add(sb, sp, level); + } + } + } +} + +void write_spellbook(const struct spellbook *book, struct storage *store) +{ + quicklist *ql; + int qi; + + if (book) { + for (ql = book->spells, qi = 0; ql; ql_advance(&ql, &qi, 1)) { + spellbook_entry *sbe = (spellbook_entry *)ql_get(ql, qi); + WRITE_TOK(store, sbe->sp->sname); + WRITE_INT(store, sbe->level); + } + } + WRITE_TOK(store, "end"); +} + void spellbook_add(spellbook *sb, struct spell * sp, int level) { spellbook_entry * sbe; diff --git a/src/kernel/spellbook.h b/src/kernel/spellbook.h index d0e25da23..84ec0ce5f 100644 --- a/src/kernel/spellbook.h +++ b/src/kernel/spellbook.h @@ -24,6 +24,8 @@ extern "C" { #endif struct spell; + struct storage; + struct gamedata; struct quicklist; typedef struct spellbook_entry { @@ -39,6 +41,9 @@ extern "C" { spellbook * create_spellbook(const char * name); + void read_spellbook(struct spellbook **bookp, struct gamedata *data, int(*get_level)(const struct spell * sp, void *), void * cbdata); + void write_spellbook(const struct spellbook *book, struct storage *store); + void spellbook_add(spellbook *sbp, struct spell * sp, int level); int spellbook_foreach(spellbook *sb, int(*callback)(spellbook_entry *, void *), void * data); void spellbook_clear(spellbook *sb); diff --git a/src/kernel/types.h b/src/kernel/types.h index 632dad425..da4fefecf 100644 --- a/src/kernel/types.h +++ b/src/kernel/types.h @@ -19,14 +19,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef ERESSEA_TYPES_H #define ERESSEA_TYPES_H -/* - * Features enabled: - * If you are lacking the settings.h, create a new file common/settings.h, - * and write #include (or whatever settings you want - * your game to use) in there. - * !!! DO NOT COMMIT THE SETTINGS.H FILE TO CVS !!! - * settings.h should always be the first thing you include (after platform.h). - */ #include #include @@ -73,6 +65,17 @@ typedef struct ursprung { int x, y; } ursprung; +/* seen_mode: visibility in the report */ +typedef enum { + seen_none, + seen_neighbour, + seen_lighthouse, + seen_travel, + seen_far, + seen_unit, + seen_battle +} seen_mode; + /* ------------------ Status von Einheiten --------------------- */ typedef unsigned char status_t; @@ -133,7 +136,7 @@ typedef enum { P_TREES, P_ALLIANCE, MAXPARAMS, - NOPARAM = -1 + NOPARAM } param_t; typedef enum { /* Fehler und Meldungen im Report */ diff --git a/src/kernel/unit.c b/src/kernel/unit.c index 455c789ac..4aff7d118 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -34,7 +34,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "region.h" #include "spell.h" #include "spellbook.h" -#include "save.h" #include "ship.h" #include "skill.h" #include "terrain.h" @@ -366,6 +365,51 @@ int gift_items(unit * u, int flags) static unit *deleted_units = NULL; +#define DMAXHASH 7919 +#undef DMAXHASH // TODO: makes dfindhash slow! +#ifdef DMAXHASH +typedef struct dead { + struct dead *nexthash; + faction *f; + int no; +} dead; + +static dead *deadhash[DMAXHASH]; + +static void dhash(int no, faction * f) +{ + dead *hash = (dead *)calloc(1, sizeof(dead)); + dead *old = deadhash[no % DMAXHASH]; + hash->no = no; + hash->f = f; + deadhash[no % DMAXHASH] = hash; + hash->nexthash = old; +} + +faction *dfindhash(int no) +{ + dead *old; + + if (no < 0) + return 0; + + for (old = deadhash[no % DMAXHASH]; old; old = old->nexthash) { + if (old->no == no) { + return old->f; + } + } + return 0; +} +#else +struct faction *dfindhash(int no) { + unit *u = deleted_units; + while (u && u->no != no) { + u = u->next; + } + return u ? u->faction : NULL; +} +#endif + int remove_unit(unit ** ulist, unit * u) { int result; @@ -379,8 +423,9 @@ int remove_unit(unit ** ulist, unit * u) return -1; } - if (u->number) + if (u->number) { set_number(u, 0); + } leave(u, true); u->region = NULL; @@ -393,11 +438,25 @@ int remove_unit(unit ** ulist, unit * u) *ulist = u->next; } + if (u->faction && u->faction->units == u) { + u->faction->units = u->nextF; + } + if (u->prevF) { + u->prevF->nextF = u->nextF; + } + if (u->nextF) { + u->nextF->prevF = u->prevF; + } + u->nextF = 0; + u->prevF = 0; + u->next = deleted_units; deleted_units = u; +#ifdef DMAXHASH dhash(u->no, u->faction); +#endif + // u_setfaction(u, NULL); - u_setfaction(u, NULL); u->region = NULL; return 0; @@ -435,6 +494,10 @@ attrib_type at_alias = { NO_READ }; +/** remember old unit.no (for the creport, mostly) + * if alias is positive, then this unit was a TEMP + * if alias is negative, then this unit has been RENUMBERed + */ int ualias(const unit * u) { attrib *a = a_find(u->attribs, &at_alias); @@ -470,7 +533,7 @@ const char *u_description(const unit * u, const struct locale *lang) return u->display; } else if (u_race(u)->describe) { - return u_race(u)->describe(u, lang); + return u_race(u)->describe(u->_race, lang); } return NULL; } @@ -823,15 +886,16 @@ void leave_building(unit * u) bool can_leave(unit * u) { - int rule_leave; + static int config; + static bool rule_leave; if (!u->building) { return true; } - - rule_leave = config_get_int("rules.move.owner_leave", 0); - - if (rule_leave != 0 && u->building && u == building_owner(u->building)) { + if (config_changed(&config)) { + rule_leave = config_get_int("rules.move.owner_leave", 0) != 0; + } + if (rule_leave && u->building && u == building_owner(u->building)) { return false; } return true; @@ -853,26 +917,20 @@ bool leave(unit * u, bool force) return true; } -const struct race *urace(const struct unit *u) -{ - return u->_race; -} - bool can_survive(const unit * u, const region * r) { if ((fval(r->terrain, WALK_INTO) && (u_race(u)->flags & RCF_WALK)) || (fval(r->terrain, SWIM_INTO) && (u_race(u)->flags & RCF_SWIM)) || (fval(r->terrain, FLY_INTO) && (u_race(u)->flags & RCF_FLY))) { - static const curse_type *ctype = NULL; if (has_horses(u) && !fval(r->terrain, WALK_INTO)) return false; - if (!ctype) - ctype = ct_find("holyground"); - if (fval(u_race(u), RCF_UNDEAD) && curse_active(get_curse(r->attribs, ctype))) - return false; - + if (r->attribs) { + const curse_type *ctype = ct_find("holyground"); + if (fval(u_race(u), RCF_UNDEAD) && curse_active(get_curse(r->attribs, ctype))) + return false; + } return true; } return false; @@ -888,7 +946,7 @@ void move_unit(unit * u, region * r, unit ** ulist) if (!ulist) ulist = (&r->units); if (u->region) { - setguard(u, GUARD_NONE); + setguard(u, false); fset(u, UFL_MOVED); if (u->ship || u->building) { /* can_leave must be checked in travel_i */ @@ -905,9 +963,7 @@ void move_unit(unit * u, region * r, unit ** ulist) addlist(ulist, u); } -#ifdef SMART_INTERVALS update_interval(u->faction, r); -#endif u->region = r; } @@ -1026,15 +1082,9 @@ void transfermen(unit * u, unit * dst, int n) else if (r->land) { if ((u_race(u)->ec_flags & ECF_REC_ETHEREAL) == 0) { const race *rc = u_race(u); - if (rc->ec_flags & ECF_REC_HORSES) { /* Zentauren an die Pferde */ - int h = rhorses(r) + n; - rsethorses(r, h); - } - else { - int p = rpeasants(r); - p += (int)(n * rc->recruit_multi); - rsetpeasants(r, p); - } + int p = rpeasants(r); + p += (int)(n * rc->recruit_multi); + rsetpeasants(r, p); } } } @@ -1114,7 +1164,6 @@ void u_setfaction(unit * u, faction * f) } } -/* vorsicht Sprueche koennen u->number == RS_FARVISION haben! */ void set_number(unit * u, int count) { assert(count >= 0); @@ -1217,54 +1266,55 @@ static int item_modification(const unit * u, skill_t sk, int val) static int att_modification(const unit * u, skill_t sk) { double result = 0; - static bool init = false; // TODO: static variables are bad global state - static const curse_type *skillmod_ct, *gbdream_ct, *worse_ct; - curse *c; - if (!init) { - init = true; - skillmod_ct = ct_find("skillmod"); - gbdream_ct = ct_find("gbdream"); - worse_ct = ct_find("worse"); - } - - c = get_curse(u->attribs, worse_ct); - if (c != NULL) - result += curse_geteffect(c); - if (skillmod_ct) { - attrib *a = a_find(u->attribs, &at_curse); - while (a && a->type == &at_curse) { - curse *c = (curse *)a->data.v; - if (c->type == skillmod_ct && c->data.i == sk) { - result += curse_geteffect(c); - break; + if (u->attribs) { + curse *c; + static int cache; + static const curse_type *skillmod_ct, *worse_ct; + if (ct_changed(&cache)) { + skillmod_ct = ct_find("skillmod"); + worse_ct = ct_find("worse"); + } + c = get_curse(u->attribs, worse_ct); + if (c != NULL) + result += curse_geteffect(c); + if (skillmod_ct) { + attrib *a = a_find(u->attribs, &at_curse); + while (a && a->type == &at_curse) { + curse *c = (curse *)a->data.v; + if (c->type == skillmod_ct && c->data.i == sk) { + result += curse_geteffect(c); + break; + } + a = a->next; } - a = a->next; } } - /* TODO hier kann nicht mit get/iscursed gearbeitet werden, da nur der * jeweils erste vom Typ C_GBDREAM zurueckgegen wird, wir aber alle * durchsuchen und aufaddieren muessen */ - if (gbdream_ct && u->region) { - int bonus = 0, malus = 0; - attrib *a = a_find(u->region->attribs, &at_curse); - while (a && a->type == &at_curse) { - curse *c = (curse *)a->data.v; + if (u->region && u->region->attribs) { + const curse_type *gbdream_ct = ct_find("gbdream"); + if (gbdream_ct) { + int bonus = 0, malus = 0; + attrib *a = a_find(u->region->attribs, &at_curse); + while (a && a->type == &at_curse) { + curse *c = (curse *)a->data.v; - if (curse_active(c) && c->type == gbdream_ct) { - int effect = curse_geteffect_int(c); - bool allied = alliedunit(c->magician, u->faction, HELP_GUARD); - if (allied) { - if (effect > bonus) bonus = effect; - } - else { - if (effect < malus) malus = effect; + if (curse_active(c) && c->type == gbdream_ct) { + int effect = curse_geteffect_int(c); + bool allied = alliedunit(c->magician, u->faction, HELP_GUARD); + if (allied) { + if (effect > bonus) bonus = effect; + } + else { + if (effect < malus) malus = effect; + } } + a = a->next; } - a = a->next; + result = result + bonus + malus; } - result = result + bonus + malus; } return (int)result; @@ -1379,6 +1429,26 @@ void free_unit(unit * u) } } +static int newunitid(void) +{ + int random_unit_no; + int start_random_no; + random_unit_no = 1 + (rng_int() % MAX_UNIT_NR); + start_random_no = random_unit_no; + + while (ufindhash(random_unit_no) || dfindhash(random_unit_no) + || forbiddenid(random_unit_no)) { + random_unit_no++; + if (random_unit_no == MAX_UNIT_NR + 1) { + random_unit_no = 1; + } + if (random_unit_no == start_random_no) { + random_unit_no = (int)MAX_UNIT_NR + 1; + } + } + return random_unit_no; +} + static void createunitid(unit * u, int id) { if (id <= 0 || id > MAX_UNIT_NR || ufindhash(id) || dfindhash(id) @@ -1393,15 +1463,12 @@ void default_name(const unit *u, char name[], int len) { const char * result; const struct locale * lang = u->faction ? u->faction->locale : default_locale; if (lang) { - static const char * prefix[MAXLOCALES]; - int i = locale_index(lang); - /*if (!prefix[i]) {*/ - prefix[i] = LOC(lang, "unitdefault"); - if (!prefix[i]) { - prefix[i] = parameters[P_UNIT]; + const char * prefix; + prefix = LOC(lang, "unitdefault"); + if (!prefix) { + prefix= parameters[P_UNIT]; } - /*}*/ - result = prefix[i]; + result = prefix; } else { result = parameters[P_UNIT]; @@ -1414,9 +1481,10 @@ void default_name(const unit *u, char name[], int len) { void name_unit(unit * u) { if (u_race(u)->generate_name) { - const char *gen_name = u_race(u)->generate_name(u); + char *gen_name = race_namegen(u_race(u), u); if (gen_name) { - unit_setname(u, gen_name); + free(u->_name); + u->_name = gen_name; } else { unit_setname(u, racename(u->faction->locale, u, u_race(u))); @@ -1643,6 +1711,7 @@ int unit_getcapacity(const unit * u) } void renumber_unit(unit *u, int no) { + if (no == 0) no = newunitid(); uunhash(u); if (!ualias(u)) { attrib *a = a_add(&u->attribs, a_new(&at_alias)); @@ -1665,19 +1734,25 @@ int unit_max_hp(const unit * u) { int h; double p; - static const curse_type *heal_ct = NULL; - int rule_stamina = config_get_int("rules.stamina", STAMINA_AFFECTS_HP); + static int config; + static int rule_stamina; h = u_race(u)->hitpoints; + if (config_changed(&config)) { + rule_stamina = config_get_int("rules.stamina", STAMINA_AFFECTS_HP); + } if (rule_stamina & 1) { p = pow(effskill(u, SK_STAMINA, u->region) / 2.0, 1.5) * 0.2; h += (int)(h * p + 0.5); } /* der healing curse veraendert die maximalen hp */ - if (u->region) { - if (heal_ct == NULL) + if (u->region && u->region->attribs) { + static int cache; + static const curse_type *heal_ct; + if (ct_changed(&cache)) { heal_ct = ct_find("healingzone"); + } if (heal_ct) { curse *c = get_curse(u->region->attribs, heal_ct); if (c) { @@ -1867,28 +1942,6 @@ bool unit_can_study(const unit *u) { return !((u_race(u)->flags & RCF_NOLEARN) || fval(u, UFL_WERE)); } -/* ID's für Einheiten und Zauber */ -int newunitid(void) -{ - int random_unit_no; - int start_random_no; - random_unit_no = 1 + (rng_int() % MAX_UNIT_NR); - start_random_no = random_unit_no; - - while (ufindhash(random_unit_no) || dfindhash(random_unit_no) - || cfindhash(random_unit_no) - || forbiddenid(random_unit_no)) { - random_unit_no++; - if (random_unit_no == MAX_UNIT_NR + 1) { - random_unit_no = 1; - } - if (random_unit_no == start_random_no) { - random_unit_no = (int)MAX_UNIT_NR + 1; - } - } - return random_unit_no; -} - static int read_newunitid(const faction * f, const region * r) { int n; diff --git a/src/kernel/unit.h b/src/kernel/unit.h index 2a74e4fbb..e846ca1f4 100644 --- a/src/kernel/unit.h +++ b/src/kernel/unit.h @@ -22,6 +22,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "types.h" #include "skills.h" +#include + #ifdef __cplusplus extern "C" { #endif @@ -36,7 +38,6 @@ extern "C" { #define UFL_LONGACTION (1<<2) /* 4 */ #define UFL_OWNER (1<<3) /* 8 */ #define UFL_ANON_FACTION (1<<4) /* 16 */ -#define UFL_DISBELIEVES (1<<5) /* 32 */ #define UFL_WARMTH (1<<6) /* 64 */ #define UFL_HERO (1<<7) #define UFL_MOVED (1<<8) @@ -142,8 +143,6 @@ extern "C" { struct unit *utarget(const struct unit *u); void usettarget(struct unit *u, const struct unit *b); - extern const struct race *urace(const struct unit *u); - const char *uprivate(const struct unit *u); void usetprivate(struct unit *u, const char *c); @@ -174,6 +173,9 @@ extern "C" { const struct region *r, bool noitem); int remove_unit(struct unit **ulist, struct unit *u); + /* looking up dead units' factions: */ + struct faction *dfindhash(int no); + #define GIFT_SELF 1<<0 #define GIFT_FRIENDS 1<<1 #define GIFT_PEASANTS 1<<2 @@ -256,7 +258,6 @@ extern "C" { #define GET_PEASANTS 2 int getunit(const struct region * r, const struct faction * f, struct unit **uresult); - int newunitid(void); int read_unitid(const struct faction *f, const struct region *r); void setstatus(struct unit *u, int status); diff --git a/src/kernel/unit.test.c b/src/kernel/unit.test.c index dc0484bf7..c4b1f46ed 100644 --- a/src/kernel/unit.test.c +++ b/src/kernel/unit.test.c @@ -8,9 +8,10 @@ #include #include #include +#include #include #include -#include +#include #include #include #include @@ -50,14 +51,16 @@ static void test_remove_empty_units_in_region(CuTest *tc) { test_create_world(); u = test_create_unit(test_create_faction(test_create_race("human")), findregion(0, 0)); + u = test_create_unit(u->faction, u->region); + CuAssertPtrNotNull(tc, u->nextF); uid = u->no; remove_empty_units_in_region(u->region); CuAssertPtrNotNull(tc, findunit(uid)); u->number = 0; remove_empty_units_in_region(u->region); CuAssertPtrEquals(tc, 0, findunit(uid)); + CuAssertPtrEquals(tc, 0, u->nextF); CuAssertPtrEquals(tc, 0, u->region); - CuAssertPtrEquals(tc, 0, u->faction); test_cleanup(); } @@ -100,7 +103,7 @@ static void test_remove_units_ignores_spells(CuTest *tc) { test_cleanup(); test_create_world(); - u = create_unit(findregion(0, 0), test_create_faction(test_create_race("human")), 1, get_race(RC_SPELL), 0, 0, 0); + u = create_unit(findregion(0, 0), test_create_faction(test_create_race("human")), 1, test_create_race("spell"), 0, 0, 0); uid = u->no; u->number = 0; u->age = 1; @@ -387,13 +390,93 @@ static void test_limited_skills(CuTest *tc) { test_cleanup(); } +static void test_unit_description(CuTest *tc) { + race *rc; + unit *u; + test_setup(); + rc = test_create_race("hodor"); + u = test_create_unit(test_create_faction(rc), test_create_region(0,0,0)); + CuAssertPtrEquals(tc, 0, u->display); + CuAssertStrEquals(tc, 0, u_description(u, u->faction->locale)); + u->display = _strdup("Hodor"); + CuAssertStrEquals(tc, "Hodor", u_description(u, NULL)); + CuAssertStrEquals(tc, "Hodor", u_description(u, u->faction->locale)); + test_cleanup(); +} + +static void test_remove_unit(CuTest *tc) { + region *r; + unit *u1, *u2; + faction *f; + int uno; + const resource_type *rtype; + + test_setup(); + init_resources(); + rtype = get_resourcetype(R_SILVER); + r = test_create_region(0, 0, 0); + f = test_create_faction(0); + u2 = test_create_unit(f, r); + u1 = test_create_unit(f, r); + CuAssertPtrEquals(tc, u1, f->units); + CuAssertPtrEquals(tc, u2, u1->nextF); + CuAssertPtrEquals(tc, u1, u2->prevF); + CuAssertPtrEquals(tc, 0, u2->nextF); + uno = u1->no; + region_setresource(r, rtype, 0); + i_change(&u1->items, rtype->itype, 100); + remove_unit(&r->units, u1); + CuAssertIntEquals(tc, 0, u1->number); + CuAssertPtrEquals(tc, 0, u1->region); + // money is given to a survivor: + CuAssertPtrEquals(tc, 0, u1->items); + CuAssertIntEquals(tc, 0, region_getresource(r, rtype)); + CuAssertIntEquals(tc, 100, i_get(u2->items, rtype->itype)); + + // unit is removed from f->units: + CuAssertPtrEquals(tc, 0, u1->nextF); + CuAssertPtrEquals(tc, u2, f->units); + CuAssertPtrEquals(tc, 0, u2->nextF); + CuAssertPtrEquals(tc, 0, u2->prevF); + // unit is no longer in r->units: + CuAssertPtrEquals(tc, u2, r->units); + CuAssertPtrEquals(tc, 0, u2->next); + + // unit is in deleted_units: + CuAssertPtrEquals(tc, 0, findunit(uno)); + CuAssertPtrEquals(tc, f, dfindhash(uno)); + + remove_unit(&r->units, u2); + // no survivor, give money to peasants: + CuAssertIntEquals(tc, 100, region_getresource(r, rtype)); + // there are now no more units: + CuAssertPtrEquals(tc, 0, r->units); + CuAssertPtrEquals(tc, 0, f->units); + test_cleanup(); +} + +static void test_renumber_unit(CuTest *tc) { + unit *u1, *u2; + test_setup(); + u1 = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); + u2 = test_create_unit(u1->faction, u1->region); + rng_init(0); + renumber_unit(u1, 0); + rng_init(0); + renumber_unit(u2, 0); + CuAssertTrue(tc, u1->no != u2->no); + test_cleanup(); +} + CuSuite *get_unit_suite(void) { CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_scale_number); + SUITE_ADD_TEST(suite, test_unit_description); SUITE_ADD_TEST(suite, test_unit_name); SUITE_ADD_TEST(suite, test_unit_name_from_race); SUITE_ADD_TEST(suite, test_update_monster_name); + SUITE_ADD_TEST(suite, test_remove_unit); SUITE_ADD_TEST(suite, test_remove_empty_units); SUITE_ADD_TEST(suite, test_remove_units_ignores_spells); SUITE_ADD_TEST(suite, test_remove_units_without_faction); @@ -407,5 +490,6 @@ CuSuite *get_unit_suite(void) SUITE_ADD_TEST(suite, test_age_familiar); SUITE_ADD_TEST(suite, test_inside_building); SUITE_ADD_TEST(suite, test_limited_skills); + SUITE_ADD_TEST(suite, test_renumber_unit); return suite; } diff --git a/src/kernel/version.c b/src/kernel/version.c new file mode 100644 index 000000000..6de6ddb40 --- /dev/null +++ b/src/kernel/version.c @@ -0,0 +1,19 @@ +#include +#include "version.h" + +#include + +#ifndef ERESSEA_VERSION +// the version number, if it was not passed to make with -D +#define ERESSEA_VERSION "3.10.0-devel" +#endif + +const char *eressea_version(void) { + return ERESSEA_VERSION; +} + +int version_no(const char *str) { + int maj = 0, min = 0, bld = 0; + sscanf(str, "%d.%d.%d", &maj, &min, &bld); + return (maj << 16) | (min << 8) | bld; +} diff --git a/src/kernel/version.h b/src/kernel/version.h index 4aab16f5f..c268e7bac 100644 --- a/src/kernel/version.h +++ b/src/kernel/version.h @@ -1,47 +1,17 @@ +#pragma once /* +-------------------+ | | Enno Rehling | Eressea PBEM host | Katja Zedel - | (c) 1998 - 2007 | Christian Schlittchen - | | + | (c) 1998 - 2016 | Christian Schlittchen + | | https://github.com/eressea/server +-------------------+ - - This program may not be used, modified or distributed - without prior permission by the authors of Eressea. - */ -#define INTPAK_VERSION 329 /* in binary, ints can get packed. starting with E2/572 */ -#define NOZEROIDS_VERSION 330 /* 2008-05-16 zero is not a valid ID for anything (including factions) */ -#define NOBORDERATTRIBS_VERSION 331 /* 2008-05-17 connection::attribs has been moved to userdata */ -#define UIDHASH_VERSION 332 /* 2008-05-22 borders use the region.uid to store */ -#define REGIONOWNER_VERSION 333 /* 2009-05-14 regions have owners and morale */ -#define ALLIANCELEADER_VERSION 333 /* alliances have a leader */ -#define CURSEFLOAT_VERSION 334 /* all curse-effects are float */ -#define MOURNING_VERSION 335 /* mourning peasants */ -#define FOSS_VERSION 336 /* the open source release */ -#define OWNER_2_VERSION 337 /* region owners contain an alliance */ -#define FIX_WATCHERS_VERSION 338 /* fixed storage of watchers */ -#define UNIQUE_SPELLS_VERSION 339 /* turn 775, spell names are now unique globally, not just per school */ -#define SPELLBOOK_VERSION 340 /* turn 775, full spellbooks are stored for factions */ -#define NOOVERRIDE_VERSION 341 /* turn 775, full spellbooks are stored for factions */ -#define INTFLAGS_VERSION 342 /* turn 876, FFL_NPC is now bit 25, flags is an int */ -#define SAVEGAMEID_VERSION 343 /* instead of XMLNAME, save the game.id parameter from the config */ -#define BUILDNO_VERSION 344 /* storing the build number in the save */ -#define AUTO_RACENAME_VERSION 345 /* NPC units with name==NULL will automatically get their race for a name */ -#define JSON_REPORT_VERSION 346 /* bit 3 in f->options flags the json report */ -#define EXPLICIT_CURSE_ISNEW_VERSION 347 /* CURSE_ISNEW is not reset in read/write, but in age() */ -#define SPELL_LEVEL_VERSION 348 /* f->max_spelllevel gets stored, not calculated */ -#define OWNER_3_VERSION 349 /* regions store last owner, not last alliance */ -#define ATTRIBOWNER_VERSION 351 /* all attrib_type functions know who owns the attribute */ -#define BADCRYPT_VERSION 351 /* passwords are broken, 969.dat only. */ -#define NOCRYPT_VERSION 352 /* passwords are plaintext again */ -#define ATHASH_VERSION 353 /* attribute-type hash, not name */ -#define NOWATCH_VERSION 354 /* plane->watchers is gone */ -/* unfinished: */ -#define CRYPT_VERSION 400 /* passwords are encrypted */ -#define RELEASE_VERSION NOWATCH_VERSION /* current datafile */ -#define MIN_VERSION INTPAK_VERSION /* minimal datafile we support */ -#define MAX_VERSION RELEASE_VERSION /* change this if we can need to read the future datafile, and we can do so */ +#ifndef H_KERNEL_VERSION +#define H_KERNEL_VERSION -#define STREAM_VERSION 2 /* internal encoding of binary files */ +const char *eressea_version(void); +int version_no(const char *str); + +#endif diff --git a/src/kernel/xmlreader.c b/src/kernel/xmlreader.c index da8014d67..640a28940 100644 --- a/src/kernel/xmlreader.c +++ b/src/kernel/xmlreader.c @@ -15,6 +15,7 @@ without prior permission by the authors of Eressea. #include "xmlreader.h" #include "building.h" +#include "guard.h" #include "equipment.h" #include "item.h" #include "keyword.h" @@ -33,6 +34,7 @@ without prior permission by the authors of Eressea. #include "vortex.h" #include +#include /* util includes */ #include @@ -305,7 +307,7 @@ static int parse_buildings(xmlDocPtr doc) btype->age = (void(*)(struct building *))fun; } else if (strcmp((const char *)propValue, "protection") == 0) { - btype->protection = (int(*)(struct building *, struct unit *, building_bonus))fun; + btype->protection = (int(*)(const struct building *, const struct unit *, building_bonus))fun; } else if (strcmp((const char *)propValue, "taxes") == 0) { btype->taxes = (double(*)(const struct building *, int))fun; @@ -338,9 +340,6 @@ static int parse_buildings(xmlDocPtr doc) if (xml_bvalue(node, "variable", false)) mt->flags |= MTF_VARIABLE; - if (xml_bvalue(node, "vital", false)) - mt->flags |= MTF_VITAL; - } xmlXPathFreeObject(result); @@ -471,6 +470,8 @@ static int parse_calendar(xmlDocPtr doc) } xmlXPathFreeObject(xpathMonths); xmlXPathFreeObject(xpathSeasons); + xmlFree(newyear); + newyear = NULL; } xmlXPathFreeObject(xpathCalendars); xmlXPathFreeContext(xpath); @@ -1052,24 +1053,6 @@ static int parse_resources(xmlDocPtr doc) } xmlXPathFreeObject(result); - result = xmlXPathEvalExpression(BAD_CAST "guard", xpath); - if (result->nodesetval != NULL) - for (k = 0; k != result->nodesetval->nodeNr; ++k) { - xmlNodePtr node = result->nodesetval->nodeTab[k]; - xmlChar *propFlag = xmlGetProp(node, BAD_CAST "flag"); - - if (propFlag != NULL) { - if (strcmp((const char *)propFlag, "logging") == 0) { - rdata->guard |= GUARD_TREES; - } - else if (strcmp((const char *)propFlag, "mining") == 0) { - rdata->guard |= GUARD_MINING; - } - xmlFree(propFlag); - } - } - xmlXPathFreeObject(result); - /* reading eressea/resources/resource/resourcelimit/function */ result = xmlXPathEvalExpression(BAD_CAST "function", xpath); if (result->nodesetval != NULL) @@ -1188,22 +1171,18 @@ static void add_spells(equipment * eq, xmlNodeSetPtr nsetItems) for (i = 0; i != nsetItems->nodeNr; ++i) { xmlNodePtr node = nsetItems->nodeTab[i]; xmlChar *propValue; - struct spell *sp; + int level; + const char *name; propValue = xmlGetProp(node, BAD_CAST "name"); assert(propValue != NULL); - sp = find_spell((const char *)propValue); - if (!sp) { - log_error("no spell '%s' for equipment-set '%s'\n", (const char *)propValue, eq->name); + name = (const char *)propValue; + level = xml_ivalue(node, "level", 0); + if (level > 0) { + equipment_addspell(eq, name, level); } else { - int level = xml_ivalue(node, "level", 0); - if (level > 0) { - equipment_addspell(eq, sp, level); - } - else { - log_error("spell '%s' for equipment-set '%s' has no level\n", sp->sname, eq->name); - } + log_error("spell '%s' for equipment-set '%s' has no level\n", name, eq->name); } xmlFree(propValue); } @@ -1328,7 +1307,7 @@ static int parse_equipment(xmlDocPtr doc) xmlXPathFreeObject(xpathResult); xpathResult = xmlXPathEvalExpression(BAD_CAST "spell", xpath); - assert(!eq->spellbook); + assert(!eq->spells); add_spells(eq, xpathResult->nodesetval); xmlXPathFreeObject(xpathResult); @@ -1603,6 +1582,14 @@ static void parse_param(struct param **params, xmlNodePtr node) static void parse_ai(race * rc, xmlNodePtr node) { + int n; + + n = xml_ivalue(node, "scare", 0); + if (n>0) { + attrib *a = a_new(&at_scare); + a->data.i = n; + a_add(&rc->attribs, a); + } rc->splitsize = xml_ivalue(node, "splitsize", 0); rc->aggression = (float)xml_fvalue(node, "aggression", 0.04); if (xml_bvalue(node, "killpeasants", false)) @@ -1645,12 +1632,14 @@ static int parse_races(xmlDocPtr doc) xmlFree(propValue); rc->magres = (float)xml_fvalue(node, "magres", rc->magres); + rc->healing = (float)xml_fvalue(node, "healing", rc->healing); rc->maxaura = (float)xml_fvalue(node, "maxaura", rc->maxaura); rc->regaura = (float)xml_fvalue(node, "regaura", rc->regaura); rc->recruitcost = xml_ivalue(node, "recruitcost", rc->recruitcost); rc->maintenance = xml_ivalue(node, "maintenance", rc->maintenance); rc->weight = xml_ivalue(node, "weight", rc->weight); rc->capacity = xml_ivalue(node, "capacity", rc->capacity); + rc->income = xml_ivalue(node, "income", rc->income); rc->speed = (float)xml_fvalue(node, "speed", rc->speed); rc->hitpoints = xml_ivalue(node, "hp", rc->hitpoints); rc->armor = (char)xml_ivalue(node, "ac", rc->armor); @@ -1661,8 +1650,10 @@ static int parse_races(xmlDocPtr doc) rc->at_bonus = (char)xml_ivalue(node, "attackmodifier", rc->at_bonus); rc->df_bonus = (char)xml_ivalue(node, "defensemodifier", rc->df_bonus); - if (!xml_bvalue(node, "playerrace", false)) + if (!xml_bvalue(node, "playerrace", false)) { + assert(rc->recruitcost == 0); rc->flags |= RCF_NPC; + } if (xml_bvalue(node, "scarepeasants", false)) rc->flags |= RCF_SCAREPEASANTS; if (!xml_bvalue(node, "cansteal", true)) @@ -1722,8 +1713,6 @@ static int parse_races(xmlDocPtr doc) rc->ec_flags |= GIVEUNIT; if (xml_bvalue(node, "getitem", false)) rc->ec_flags |= GETITEM; - if (xml_bvalue(node, "recruithorses", false)) - rc->ec_flags |= ECF_REC_HORSES; if (xml_bvalue(node, "recruitethereal", false)) rc->ec_flags |= ECF_REC_ETHEREAL; if (xml_bvalue(node, "recruitunlimited", false)) @@ -1797,11 +1786,10 @@ static int parse_races(xmlDocPtr doc) } assert(propValue != NULL); if (strcmp((const char *)propValue, "name") == 0) { - rc->generate_name = (const char *(*)(const struct unit *))fun; + rc->generate_name = (race_name_func)fun; } else if (strcmp((const char *)propValue, "describe") == 0) { - rc->describe = - (const char *(*)(const struct unit *, const struct locale *))fun; + rc->describe = (race_desc_func)fun; } else if (strcmp((const char *)propValue, "age") == 0) { rc->age = (void(*)(struct unit *))fun; diff --git a/src/keyword.c b/src/keyword.c index 0bd699836..199811669 100644 --- a/src/keyword.c +++ b/src/keyword.c @@ -14,6 +14,9 @@ const char * keyword(keyword_t kwd) { static char result[32]; // FIXME: static return value + if (kwd==NOKEYWORD) { + return NULL; + } if (!result[0]) { strcpy(result, "keyword::"); } diff --git a/src/keyword.h b/src/keyword.h index 9d5e20f64..e60d0731f 100644 --- a/src/keyword.h +++ b/src/keyword.h @@ -70,7 +70,7 @@ extern "C" K_PAY, K_LOOT, MAXKEYWORDS, - NOKEYWORD = -1 + NOKEYWORD } keyword_t; extern const char *keywords[MAXKEYWORDS]; diff --git a/src/keyword.test.c b/src/keyword.test.c index 903eb0c13..75c31904a 100644 --- a/src/keyword.test.c +++ b/src/keyword.test.c @@ -11,11 +11,13 @@ static void test_init_keywords(CuTest *tc) { struct locale *lang; - test_cleanup(); + test_setup(); lang = get_or_create_locale("en"); locale_setstring(lang, "keyword::move", "MOVE"); init_keywords(lang); CuAssertIntEquals(tc, K_MOVE, get_keyword("move", lang)); + CuAssertStrEquals(tc, "keyword::move", keyword(K_MOVE)); + CuAssertPtrEquals(tc, NULL, (void *)keyword(NOKEYWORD)); test_cleanup(); } diff --git a/src/laws.c b/src/laws.c old mode 100755 new mode 100644 index 3129bd16b..3fe53237e --- a/src/laws.c +++ b/src/laws.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 1998-2014, Enno Rehling Katja Zedel #include #include -#include #include #include #include @@ -78,17 +79,17 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include +#include #include #include -#include #include #include #include -#include -#include +#include #include +#include #include /* libc includes */ #include @@ -116,6 +117,32 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* - exported global symbols ----------------------------------- */ +int NewbieImmunity(void) +{ + return config_get_int("NewbieImmunity", 0); +} + +bool IsImmune(const faction * f) +{ + return !fval(f, FFL_NPC) && f->age < NewbieImmunity(); +} + +int NMRTimeout(void) +{ + return config_get_int("nmr.timeout", 0); +} + +bool LongHunger(const struct unit *u) +{ + if (u != NULL) { + if (!fval(u, UFL_HUNGER)) + return false; + if (u_race(u) == get_race(RC_DAEMON)) + return false; + } + return config_get_int("hunger.long", 0) != 0; +} + static bool RemoveNMRNewbie(void) { int value = config_get_int("nmr.removenewbie", 0); @@ -124,7 +151,13 @@ static bool RemoveNMRNewbie(void) static void age_unit(region * r, unit * u) { - if (u_race(u) == get_race(RC_SPELL)) { + static int rc_cache; + static const race *rc_spell; + + if (rc_changed(&rc_cache)) { + rc_spell = get_race(RC_SPELL); + } + if (u_race(u) == rc_spell) { if (--u->age <= 0) { remove_unit(&r->units, u); } @@ -215,7 +248,7 @@ static void live(region * r) static void calculate_emigration(region * r) { int i; - int maxp = maxworkingpeasants(r); + int maxp = region_maxworkers(r); int rp = rpeasants(r); int max_immigrants = MAX_IMMIGRATION(maxp - rp); @@ -230,7 +263,7 @@ static void calculate_emigration(region * r) if (rc != NULL && fval(rc->terrain, LAND_REGION)) { int rp2 = rpeasants(rc); - int maxp2 = maxworkingpeasants(rc); + int maxp2 = region_maxworkers(rc); int max_emigration = MAX_EMIGRATION(rp2 - maxp2); if (max_emigration > 0) { @@ -413,7 +446,7 @@ static void horses(region * r) direction_t n; /* Logistisches Wachstum, Optimum bei halbem Maximalbesatz. */ - maxhorses = maxworkingpeasants(r) / 10; + maxhorses = region_maxworkers(r) / 10; maxhorses = _max(0, maxhorses); horses = rhorses(r); if (horses > 0) { @@ -615,7 +648,7 @@ growing_trees(region * r, const int current_season, const int last_weeks_season) * verfügbaren Fläche ab. In Gletschern gibt es weniger * Möglichkeiten als in Ebenen. */ sprout = 0; - seedchance = (1000 * maxworkingpeasants(r2)) / r2->terrain->size; + seedchance = (1000.0 * region_maxworkers(r2)) / r2->terrain->size; for (i = 0; i < seeds / MAXDIRECTIONS; i++) { if (rng_int() % 10000 < seedchance) sprout++; @@ -714,7 +747,7 @@ void immigration(void) if (repopulate) { int peasants = rpeasants(r); int income = wage(r, NULL, NULL, turn) - maintenance_cost(NULL) + 1; - if (income >= 0 && r->land && (peasants < repopulate) && maxworkingpeasants(r) >(peasants + 30) * 2) { + if (income >= 0 && r->land && (peasants < repopulate) && region_maxworkers(r) >(peasants + 30) * 2) { int badunit = 0; unit *u; for (u = r->units; u; u = u->next) { @@ -776,6 +809,8 @@ void demographics(void) region *r; static int last_weeks_season = -1; static int current_season = -1; + int plant_rules = config_get_int("rules.grow.formula", 2); + const struct building_type *bt_harbour = bt_find("harbour"); if (current_season < 0) { gamedate date; @@ -793,11 +828,10 @@ void demographics(void) /* die Nachfrage nach Produkten steigt. */ struct demand *dmd; if (r->land) { - int plant_rules = config_get_int("rules.grow.formula", 2); for (dmd = r->land->demands; dmd; dmd = dmd->next) { if (dmd->value > 0 && dmd->value < MAXDEMAND) { float rise = DMRISE; - if (buildingtype_exists(r, bt_find("harbour"), true)) + if (buildingtype_exists(r, bt_harbour, true)) rise = DMRISEHAFEN; if (rng_double() < rise) ++dmd->value; @@ -809,7 +843,7 @@ void demographics(void) calculate_emigration(r); peasants(r); if (r->age > 20) { - double mwp = _max(maxworkingpeasants(r), 1); + double mwp = _max(region_maxworkers(r), 1); double prob = pow(rpeasants(r) / (mwp * wage(r, NULL, NULL, turn) * 0.13), 4.0) * PLAGUE_CHANCE; @@ -963,7 +997,7 @@ int quit_cmd(unit * u, struct order *ord) char buffer[64]; write_order(ord, buffer, sizeof(buffer)); cmistake(u, ord, 86, MSG_EVENT); - log_warning("QUIT with illegal password for faction %s: %s\n", factionid(f), buffer); + log_warning("QUIT with illegal password for faction %s: %s\n", itoa36(f->no), buffer); } return 0; } @@ -1235,7 +1269,6 @@ static void remove_idle_players(void) } else { if (fval(f, FFL_NOIDLEOUT)) { f->lastorders = turn; - fp = &f->next; } else if (turn != f->lastorders) { char info[256]; @@ -1438,8 +1471,8 @@ static void init_prefixnames(void) LOC(lang, mkname("prefix", race_prefixes[key])); if (findtoken(in->names, pname, &var) == E_TOK_NOMATCH || var.i != key) { var.i = key; - addtoken(&in->names, pname, var); - addtoken(&in->names, LOC(lang, mkname("prefix", + addtoken((struct tnode **)&in->names, pname, var); + addtoken((struct tnode **)&in->names, LOC(lang, mkname("prefix", race_prefixes[key])), var); } } @@ -1619,6 +1652,7 @@ bool renamed_building(const building * b) static int rename_cmd(unit * u, order * ord, char **s, const char *s2) { + char name[NAMESIZE]; assert(s2); if (!s2[0]) { cmistake(u, ord, 84, MSG_EVENT); @@ -1627,12 +1661,11 @@ static int rename_cmd(unit * u, order * ord, char **s, const char *s2) /* TODO: Validate to make sure people don't have illegal characters in * names, phishing-style? () come to mind. */ + strlcpy(name, s2, sizeof(name)); + unicode_utf8_trim(name); free(*s); - *s = _strdup(s2); - if (strlen(s2) >= NAMESIZE) { - (*s)[NAMESIZE] = 0; - } + *s = _strdup(name); return 0; } @@ -2548,7 +2581,7 @@ int guard_off_cmd(unit * u, struct order *ord) init_order(ord); if (getparam(u->faction->locale) == P_NOT) { - setguard(u, GUARD_NONE); + setguard(u, false); } return 0; } @@ -2663,20 +2696,6 @@ int combatspell_cmd(unit * u, struct order *ord) return 0; } -guard_t can_start_guarding(const unit * u) -{ - if (u->status >= ST_FLEE || fval(u, UFL_FLEEING)) - return E_GUARD_FLEEING; - /* Monster der Monsterpartei dürfen immer bewachen */ - if (is_monsters(u->faction) || fval(u_race(u), RCF_UNARMEDGUARD)) - return E_GUARD_OK; - if (!armedmen(u, true)) - return E_GUARD_UNARMED; - if (IsImmune(u->faction)) - return E_GUARD_NEWBIE; - return E_GUARD_OK; -} - int guard_on_cmd(unit * u, struct order *ord) { assert(getkeyword(ord) == K_GUARD); @@ -2704,7 +2723,7 @@ int guard_on_cmd(unit * u, struct order *ord) else { int err = can_start_guarding(u); if (err == E_GUARD_OK) { - guard(u, GUARD_ALL); + setguard(u, true); } else if (err == E_GUARD_UNARMED) { ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "unit_unarmed", "")); @@ -2749,74 +2768,6 @@ void sinkships(struct region * r) } } -static attrib_type at_number = { - "faction_renum", - NULL, NULL, NULL, NULL, NULL, NULL, - ATF_UNIQUE -}; - -void renumber_factions(void) -/* gibt parteien neue nummern */ -{ - struct renum { - struct renum *next; - int want; - faction *faction; - attrib *attrib; - } *renum = NULL, *rp; - faction *f; - for (f = factions; f; f = f->next) { - attrib *a = a_find(f->attribs, &at_number); - int want; - struct renum **rn; - faction *old; - - if (!a) - continue; - want = a->data.i; - if (fval(f, FFL_NEWID)) { - ADDMSG(&f->msgs, msg_message("renumber_twice", "id", want)); - continue; - } - old = findfaction(want); - if (old) { - a_remove(&f->attribs, a); - ADDMSG(&f->msgs, msg_message("renumber_inuse", "id", want)); - continue; - } - if (!faction_id_is_unused(want)) { - a_remove(&f->attribs, a); - ADDMSG(&f->msgs, msg_message("renumber_inuse", "id", want)); - continue; - } - for (rn = &renum; *rn; rn = &(*rn)->next) { - if ((*rn)->want >= want) - break; - } - if (*rn && (*rn)->want == want) { - ADDMSG(&f->msgs, msg_message("renumber_inuse", "id", want)); - } - else { - struct renum *r = calloc(sizeof(struct renum), 1); - r->next = *rn; - r->attrib = a; - r->faction = f; - r->want = want; - *rn = r; - } - } - for (rp = renum; rp; rp = rp->next) { - f = rp->faction; - a_remove(&f->attribs, rp->attrib); - renumber_faction(f, rp->want); - } - while (renum) { - rp = renum->next; - free(renum); - renum = rp; - } -} - void restack_units(void) { region *r; @@ -2904,121 +2855,6 @@ void restack_units(void) } } -int renumber_cmd(unit * u, order * ord) -{ - char token[128]; - const char *s; - int i; - faction *f = u->faction; - - init_order(ord); - s = gettoken(token, sizeof(token)); - switch (findparam_ex(s, u->faction->locale)) { - - case P_FACTION: - s = gettoken(token, sizeof(token)); - if (s && *s) { - int id = atoi36((const char *)s); - attrib *a = a_find(f->attribs, &at_number); - if (!a) - a = a_add(&f->attribs, a_new(&at_number)); - a->data.i = id; - } - break; - - case P_UNIT: - s = gettoken(token, sizeof(token)); - if (s == NULL || *s == 0) { - i = newunitid(); - } - else { - i = atoi36((const char *)s); - if (i <= 0 || i > MAX_UNIT_NR) { - cmistake(u, ord, 114, MSG_EVENT); - break; - } - - if (forbiddenid(i)) { - cmistake(u, ord, 116, MSG_EVENT); - break; - } - - if (findunitg(i, u->region)) { - cmistake(u, ord, 115, MSG_EVENT); - break; - } - } - renumber_unit(u, i); - break; - - case P_SHIP: - if (!u->ship) { - cmistake(u, ord, 144, MSG_EVENT); - break; - } - if (ship_owner(u->ship) != u) { - cmistake(u, ord, 146, MSG_EVENT); - break; - } - if (u->ship->coast != NODIRECTION) { - cmistake(u, ord, 116, MSG_EVENT); - break; - } - s = gettoken(token, sizeof(token)); - if (s == NULL || *s == 0) { - i = newcontainerid(); - } - else { - i = atoi36((const char *)s); - if (i <= 0 || i > MAX_CONTAINER_NR) { - cmistake(u, ord, 114, MSG_EVENT); - break; - } - if (findship(i) || findbuilding(i)) { - cmistake(u, ord, 115, MSG_EVENT); - break; - } - } - sunhash(u->ship); - u->ship->no = i; - shash(u->ship); - break; - case P_BUILDING: - case P_GEBAEUDE: - if (!u->building) { - cmistake(u, ord, 145, MSG_EVENT); - break; - } - if (building_owner(u->building) != u) { - cmistake(u, ord, 148, MSG_EVENT); - break; - } - s = gettoken(token, sizeof(token)); - if (*s == 0) { - i = newcontainerid(); - } - else { - i = atoi36((const char *)s); - if (i <= 0 || i > MAX_CONTAINER_NR) { - cmistake(u, ord, 114, MSG_EVENT); - break; - } - if (findship(i) || findbuilding(i)) { - cmistake(u, ord, 115, MSG_EVENT); - break; - } - } - bunhash(u->building); - u->building->no = i; - bhash(u->building); - break; - - default: - cmistake(u, ord, 239, MSG_EVENT); - } - return 0; -} - /* blesses stone circles create an astral protection in the astral region * above the shield, which prevents chaos suction and other spells. * The shield is created when a magician enters the blessed stone circle, @@ -3082,10 +2918,7 @@ static void age_stonecircle(building *b) { static building *age_building(building * b) { - const struct building_type *bt_blessed; - - bt_blessed = bt_find("blessedstonecircle"); - if (bt_blessed && b->type == bt_blessed) { + if (is_building_type(b->type, "blessedstonecircle")) { age_stonecircle(b); } a_age(&b->attribs, b); @@ -3161,9 +2994,9 @@ static void ageing(void) for (up = &r->units; *up;) { unit *u = *up; a_age(&u->attribs, u); - if (u == *up) + if (u == *up) handle_event(u->attribs, "timer", u); - if (u == *up) + if (u == *up) //-V581 up = &(*up)->next; } @@ -3173,7 +3006,7 @@ static void ageing(void) a_age(&s->attribs, s); if (s == *sp) handle_event(s->attribs, "timer", s); - if (s == *sp) + if (s == *sp) //-V581 sp = &(*sp)->next; } @@ -3465,37 +3298,38 @@ static int use_item(unit * u, const item_type * itype, int amount, struct order static double heal_factor(const unit * u) { - double elf_regen; - - switch (old_race(u_race(u))) { - case RC_TROLL: - case RC_DAEMON: - return 1.5; - case RC_GOBLIN: - return 2.0; - case RC_ELF: - elf_regen = get_param_flt(u_race(u)->parameters, "regen.forest", 1.0F); - if (elf_regen != 1.0 && r_isforest(u->region)) { + const race * rc = u_race(u); + if (rc->healing>0) { + return rc->healing; + } + if (r_isforest(u->region)) { + static int rc_cache; + static const race *rc_elf; + if (rc_changed(&rc_cache)) { + rc_elf = get_race(RC_ELF); + } + if (rc==rc_elf) { + static int config; + static double elf_regen = 1.0; + if (config_changed(&config)) { + elf_regen = get_param_flt(u_race(u)->parameters, "regen.forest", 1.0F); + } return elf_regen; } - return 1.0; - default: - return 1.0; } + return 1.0; } void monthly_healing(void) { region *r; - static const curse_type *heal_ct = NULL; - if (heal_ct == NULL) - heal_ct = ct_find("healingzone"); + const curse_type *heal_ct = ct_find("healingzone"); for (r = regions; r; r = r->next) { unit *u; double healingcurse = 0; - if (heal_ct != NULL) { + if (r->attribs && heal_ct) { /* bonus zurücksetzen */ curse *c = get_curse(r->attribs, heal_ct); if (c != NULL) { @@ -3705,7 +3539,7 @@ int use_cmd(unit * u, struct order *ord) cmistake(u, ord, 43, MSG_PRODUCE); return err; } - n = atoi((const char *)t); + n = atoip((const char *)t); if (n == 0) { if (isparam(t, u->faction->locale, P_ANY)) { /* BENUTZE ALLES Yanxspirit */ @@ -3801,7 +3635,7 @@ int pay_cmd(unit * u, struct order *ord) static int reserve_i(unit * u, struct order *ord, int flags) { char token[128]; - if (u->number > 0 && (urace(u)->ec_flags & GETITEM)) { + if (u->number > 0 && (u_race(u)->ec_flags & GETITEM)) { int use, count, para; const item_type *itype; const char *s; @@ -3853,7 +3687,7 @@ int claim_cmd(unit * u, struct order *ord) t = gettoken(token, sizeof(token)); if (t) { - n = atoi((const char *)t); + n = atoip((const char *)t); if (n == 0) { n = 1; } @@ -4110,7 +3944,7 @@ int armedmen(const unit * u, bool siege_weapons) { item *itm; int n = 0; - if (!(urace(u)->flags & RCF_NOWEAPONS)) { + if (!(u_race(u)->flags & RCF_NOWEAPONS)) { if (effskill(u, SK_WEAPONLESS, 0) >= 1) { /* kann ohne waffen bewachen: fuer drachen */ n = u->number; @@ -4125,7 +3959,7 @@ int armedmen(const unit * u, bool siege_weapons) if (effskill(u, wtype->skill, 0) >= wtype->minskill) n += itm->number; /* if (effskill(u, wtype->skill) >= wtype->minskill) n += itm->number; */ - if (n > u->number) + if (n >= u->number) break; } n = _min(n, u->number); @@ -4182,7 +4016,7 @@ int siege_cmd(unit * u, order * ord) return 80; } - if (!is_guard(u, GUARD_TRAVELTHRU)) { + if (!is_guard(u)) { /* abbruch, wenn die einheit nicht vorher die region bewacht - als * warnung fuer alle anderen! */ cmistake(u, ord, 81, MSG_EVENT); @@ -4496,7 +4330,7 @@ cansee(const faction * f, const region * r, const unit * u, int modifier) return false; /* simple visibility, just gotta have a unit in the region to see 'em */ - if (is_guard(u, GUARD_ALL) != 0 || usiege(u) || u->building || u->ship) { + if (is_guard(u) || usiege(u) || u->building || u->ship) { return true; } @@ -4535,7 +4369,7 @@ bool cansee_unit(const unit * u, const unit * target, int modifier) else { int n, rings, o; - if (is_guard(target, GUARD_ALL) != 0 || usiege(target) || target->building + if (is_guard(target) || usiege(target) || target->building || target->ship) { return true; } @@ -4579,7 +4413,7 @@ cansee_durchgezogen(const faction * f, const region * r, const unit * u, else { int rings; - if (is_guard(u, GUARD_ALL) != 0 || usiege(u) || u->building || u->ship) { + if (is_guard(u) || usiege(u) || u->building || u->ship) { return true; } diff --git a/src/laws.h b/src/laws.h index 6c8633536..0adb010d2 100755 --- a/src/laws.h +++ b/src/laws.h @@ -20,7 +20,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define H_GC_LAWS #include -#include "guard.h" #ifdef __cplusplus extern "C" { @@ -60,7 +59,6 @@ extern "C" { void defaultorders(void); void quit(void); void monthly_healing(void); - void renumber_factions(void); void restack_units(void); void update_long_order(struct unit *u); void sinkships(struct region * r); @@ -84,7 +82,6 @@ extern "C" { int leave_cmd(struct unit *u, struct order *ord); int pay_cmd(struct unit *u, struct order *ord); int promotion_cmd(struct unit *u, struct order *ord); - int renumber_cmd(struct unit *u, struct order *ord); int combatspell_cmd(struct unit *u, struct order *ord); int contact_cmd(struct unit *u, struct order *ord); int guard_on_cmd(struct unit *u, struct order *ord); @@ -111,8 +108,11 @@ extern "C" { #define FORCE_LEAVE_POSTCOMBAT 1 #define FORCE_LEAVE_ALL 2 bool rule_force_leave(int flag); + bool LongHunger(const struct unit *u); + int NMRTimeout(void); + int NewbieImmunity(void); + bool IsImmune(const struct faction *f); bool help_enter(struct unit *uo, struct unit *u); - guard_t can_start_guarding(const struct unit * u); #ifdef __cplusplus } diff --git a/src/laws.test.c b/src/laws.test.c index 32144fc4d..69e9f5e04 100644 --- a/src/laws.test.c +++ b/src/laws.test.c @@ -1,6 +1,7 @@ #include #include "laws.h" #include "battle.h" +#include "guard.h" #include "monster.h" #include @@ -522,7 +523,7 @@ static void test_pay_cmd_other_building(CuTest *tc) { building *b; char cmd[32]; - test_cleanup(); + test_setup(); setup_pay_cmd(&fix); f = fix.u1->faction; b = test_create_building(fix.u1->region, bt_get_or_create("lighthouse")); @@ -1023,7 +1024,7 @@ static void test_ally_cmd_errors(CuTest *tc) { int fid; order *ord; - test_cleanup(); + test_setup(); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); fid = u->faction->no + 1; CuAssertPtrEquals(tc, 0, findfaction(fid)); @@ -1036,12 +1037,50 @@ static void test_ally_cmd_errors(CuTest *tc) { test_cleanup(); } +static void test_name_cmd(CuTest *tc) { + unit *u; + faction *f; + order *ord; + + test_setup(); + u = test_create_unit(f = test_create_faction(0), test_create_region(0, 0, 0)); + + ord = create_order(K_NAME, f->locale, "%s ' Ho\tdor '", LOC(f->locale, parameters[P_UNIT])); + name_cmd(u, ord); + CuAssertStrEquals(tc, "Hodor", u->_name); + free_order(ord); + + ord = create_order(K_NAME, f->locale, "%s ' Ho\tdor '", LOC(f->locale, parameters[P_FACTION])); + name_cmd(u, ord); + CuAssertStrEquals(tc, "Hodor", f->name); + free_order(ord); + + ord = create_order(K_NAME, f->locale, "%s ' Ho\tdor '", LOC(f->locale, parameters[P_SHIP])); + u->ship = test_create_ship(u->region, 0); + name_cmd(u, ord); + CuAssertStrEquals(tc, "Hodor", u->ship->name); + free_order(ord); + + ord = create_order(K_NAME, f->locale, "%s ' Ho\tdor '", LOC(f->locale, parameters[P_BUILDING])); + u->building = test_create_building(u->region, 0); + name_cmd(u, ord); + CuAssertStrEquals(tc, "Hodor", u->building->name); + free_order(ord); + + ord = create_order(K_NAME, f->locale, "%s ' Ho\tdor '", LOC(f->locale, parameters[P_REGION])); + name_cmd(u, ord); + CuAssertStrEquals(tc, "Hodor", u->region->land->name); + free_order(ord); + + test_cleanup(); +} + static void test_ally_cmd(CuTest *tc) { unit *u; faction * f; order *ord; - test_cleanup(); + test_setup(); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); f = test_create_faction(0); @@ -1402,11 +1441,48 @@ static void test_demon_hunger(CuTest * tc) test_cleanup(); } +static void test_armedmen(CuTest *tc) { + // TODO: test RCF_NOWEAPONS and SK_WEAPONLESS + unit *u; + item_type *it_sword; + weapon_type *wtype; + test_setup(); + u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); + it_sword = test_create_itemtype("sword"); + wtype = new_weapontype(it_sword, 0, 0.5, 0, 0, 0, 0, SK_MELEE, 1); + CuAssertIntEquals(tc, 0, armedmen(u, false)); + CuAssertIntEquals(tc, 0, armedmen(u, true)); + set_level(u, SK_MELEE, 1); + CuAssertIntEquals(tc, 0, armedmen(u, false)); + i_change(&u->items, it_sword, 1); + CuAssertIntEquals(tc, 1, armedmen(u, false)); + i_change(&u->items, it_sword, 1); + CuAssertIntEquals(tc, 1, armedmen(u, false)); + scale_number(u, 2); + set_level(u, SK_MELEE, 1); + CuAssertIntEquals(tc, 2, armedmen(u, false)); + set_level(u, SK_MELEE, 0); + CuAssertIntEquals(tc, 0, armedmen(u, false)); + set_level(u, SK_MELEE, 1); + i_change(&u->items, it_sword, -1); + CuAssertIntEquals(tc, 1, armedmen(u, false)); + wtype->minskill = 2; + CuAssertIntEquals(tc, 0, armedmen(u, false)); + set_level(u, SK_MELEE, 2); + CuAssertIntEquals(tc, 1, armedmen(u, false)); + CuAssertIntEquals(tc, 1, armedmen(u, true)); + wtype->flags |= WTF_SIEGE; + CuAssertIntEquals(tc, 0, armedmen(u, false)); + CuAssertIntEquals(tc, 1, armedmen(u, true)); + test_cleanup(); +} + CuSuite *get_laws_suite(void) { CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_nmr_warnings); SUITE_ADD_TEST(suite, test_ally_cmd); + SUITE_ADD_TEST(suite, test_name_cmd); SUITE_ADD_TEST(suite, test_ally_cmd_errors); SUITE_ADD_TEST(suite, test_long_order_normal); SUITE_ADD_TEST(suite, test_long_order_none); @@ -1464,6 +1540,7 @@ CuSuite *get_laws_suite(void) SUITE_ADD_TEST(suite, test_show_race); SUITE_ADD_TEST(suite, test_immigration); SUITE_ADD_TEST(suite, test_demon_hunger); + SUITE_ADD_TEST(suite, test_armedmen); return suite; } diff --git a/src/lighthouse.c b/src/lighthouse.c index 6192db142..d962b9b76 100644 --- a/src/lighthouse.c +++ b/src/lighthouse.c @@ -8,14 +8,15 @@ #include #include #include +#include #include #include #include -static attrib_type at_lighthouse = { +const attrib_type at_lighthouse = { "lighthouse" - /* Rest ist NULL; temporäres, nicht alterndes Attribut */ + /* Rest ist NULL; tempor�res, nicht alterndes Attribut */ }; /* update_lighthouse: call this function whenever the size of a lighthouse changes @@ -25,38 +26,37 @@ static attrib_type at_lighthouse = { */ void update_lighthouse(building * lh) { - const struct building_type *bt_lighthouse = bt_find("lighthouse"); - if (bt_lighthouse && lh->type == bt_lighthouse) { + if (is_building_type(lh->type, "lighthouse")) { region *r = lh->region; - int d = (int)log10(lh->size) + 1; - int x; + r->flags |= RF_LIGHTHOUSE; if (lh->size > 0) { - r->flags |= RF_LIGHTHOUSE; - } + int d = (int)log10(lh->size) + 1; + int x; + for (x = -d; x <= d; ++x) { + int y; + for (y = -d; y <= d; ++y) { + attrib *a; + region *r2; + int px = r->x + x, py = r->y + y; - for (x = -d; x <= d; ++x) { - int y; - for (y = -d; y <= d; ++y) { - attrib *a; - region *r2; - int px = r->x + x, py = r->y + y; - pnormalize(&px, &py, rplane(r)); - r2 = findregion(px, py); - if (!r2 || !fval(r2->terrain, SEA_REGION)) - continue; - if (distance(r, r2) > d) - continue; - a = a_find(r2->attribs, &at_lighthouse); - while (a && a->type == &at_lighthouse) { - building *b = (building *)a->data.v; - if (b == lh) - break; - a = a->next; - } - if (!a) { - a = a_add(&r2->attribs, a_new(&at_lighthouse)); - a->data.v = (void *)lh; + pnormalize(&px, &py, rplane(r)); + r2 = findregion(px, py); + if (!r2 || !fval(r2->terrain, SEA_REGION)) + continue; + if (distance(r, r2) > d) + continue; + a = a_find(r2->attribs, &at_lighthouse); + while (a && a->type == &at_lighthouse) { + building *b = (building *)a->data.v; + if (b == lh) + break; + a = a->next; + } + if (!a) { + a = a_add(&r2->attribs, a_new(&at_lighthouse)); + a->data.v = (void *)lh; + } } } } @@ -72,15 +72,16 @@ int lighthouse_range(const building * b, const faction * f) if (skill_enabled(SK_PERCEPTION)) { region *r = b->region; int c = 0; - unit *u; + int cap = buildingcapacity(b); + unit *u, *uown = building_owner(b); + for (u = r->units; u; u = u->next) { - if (u->building == b || u == building_owner(b)) { - if (u->building == b) { - c += u->number; - } - if (c > buildingcapacity(b)) + if (u->building == b || u == uown) { + c += u->number; + if (c > cap) { break; - if (f == NULL || u->faction == f) { + } + else if (f == NULL || u->faction == f) { int sk = effskill(u, SK_PERCEPTION, 0) / 3; d = _max(d, sk); d = _min(maxd, d); @@ -111,7 +112,7 @@ bool check_leuchtturm(region * r, faction * f) a = a->next) { building *b = (building *)a->data.v; - assert(b->type == bt_find("lighthouse")); + assert(is_building_type(b->type, "lighthouse")); if (fval(b, BLD_MAINTAINED) && b->size >= 10) { int maxd = (int)log10(b->size) + 1; @@ -126,7 +127,7 @@ bool check_leuchtturm(region * r, faction * f) c += u->number; if (c > buildingcapacity(b)) break; - if (f == NULL || u->faction == f) { + if (u->faction == f) { if (!d) d = distance(r, r2); if (maxd < d) diff --git a/src/lighthouse.h b/src/lighthouse.h index b31c520cb..518b05b5a 100644 --- a/src/lighthouse.h +++ b/src/lighthouse.h @@ -27,6 +27,9 @@ extern "C" { struct faction; struct region; struct building; + struct attrib; + + extern const struct attrib_type at_lighthouse; /* leuchtturm */ bool check_leuchtturm(struct region *r, struct faction *f); void update_lighthouse(struct building *lh); diff --git a/src/lighthouse.test.c b/src/lighthouse.test.c new file mode 100644 index 000000000..e06941bc1 --- /dev/null +++ b/src/lighthouse.test.c @@ -0,0 +1,100 @@ +#include + +#include "lighthouse.h" + +#include +#include +#include +#include +#include +#include +#include + + +#include +#include "tests.h" + +static void test_lighthouse_range(CuTest * tc) +{ + unit *u1, *u2; + region *r; + building *b; + + test_setup(); + r = test_create_region(0, 0, 0); + test_create_region(1, 0, 0); + u1 = test_create_unit(test_create_faction(0), r); + u2 = test_create_unit(test_create_faction(0), r); + b = test_create_building(r, test_create_buildingtype("lighthouse")); + CuAssertIntEquals(tc, 0, lighthouse_range(b, NULL)); + CuAssertIntEquals(tc, 0, lighthouse_range(b, u1->faction)); + b->size = 10; + CuAssertIntEquals(tc, 0, lighthouse_range(b, NULL)); + u1->building = b; + u2->building = b; + u1->number = 10; + set_level(u1, SK_PERCEPTION, 3); + set_level(u2, SK_PERCEPTION, 3); + CuAssertIntEquals(tc, 0, lighthouse_range(b, NULL)); + b->flags |= BLD_MAINTAINED; + CuAssertIntEquals(tc, 1, lighthouse_range(b, NULL)); + set_level(u1, SK_PERCEPTION, 6); + CuAssertIntEquals(tc, 2, lighthouse_range(b, u1->faction)); + CuAssertIntEquals(tc, 0, lighthouse_range(b, u2->faction)); + b->size = 100; + update_lighthouse(b); + CuAssertIntEquals(tc, 2, lighthouse_range(b, NULL)); + set_level(u1, SK_PERCEPTION, 9); + CuAssertIntEquals(tc, 3, lighthouse_range(b, NULL)); + CuAssertIntEquals(tc, 3, lighthouse_range(b, u1->faction)); + CuAssertIntEquals(tc, 1, lighthouse_range(b, u2->faction)); + CuAssertIntEquals(tc, 0, lighthouse_range(b, test_create_faction(0))); + test_cleanup(); +} + +static void test_lighthouse_update(CuTest * tc) +{ + region *r1, *r2, *r3; + building *b; + const struct terrain_type *t_ocean, *t_plain; + + test_setup(); + t_ocean = test_create_terrain("ocean", SEA_REGION); + t_plain = test_create_terrain("plain", LAND_REGION); + r1 = test_create_region(0, 0, t_plain); + r2 = test_create_region(1, 0, t_ocean); + r3 = test_create_region(2, 0, t_ocean); + b = test_create_building(r1, test_create_buildingtype("lighthouse")); + CuAssertIntEquals(tc, RF_LIGHTHOUSE, r1->flags&RF_LIGHTHOUSE); + CuAssertPtrEquals(tc, NULL, r1->attribs); + CuAssertPtrEquals(tc, NULL, r2->attribs); + CuAssertPtrEquals(tc, NULL, r3->attribs); + + r1->flags = 0; + b->size = 1; + update_lighthouse(b); + CuAssertIntEquals(tc, RF_LIGHTHOUSE, r1->flags&RF_LIGHTHOUSE); + CuAssertPtrNotNull(tc, r2->attribs); + CuAssertPtrEquals(tc, (void *)&at_lighthouse, (void *)r2->attribs->type); + CuAssertPtrEquals(tc, NULL, r1->attribs); + CuAssertPtrEquals(tc, NULL, r3->attribs); + + a_removeall(&r2->attribs, NULL); + r1->flags = 0; + b->size = 10; + update_lighthouse(b); + CuAssertIntEquals(tc, RF_LIGHTHOUSE, r1->flags&RF_LIGHTHOUSE); + CuAssertPtrNotNull(tc, r2->attribs); + CuAssertPtrEquals(tc, (void *)&at_lighthouse, (void *)r2->attribs->type); + CuAssertPtrNotNull(tc, r3->attribs); + CuAssertPtrEquals(tc, (void *)&at_lighthouse, (void *)r3->attribs->type); + test_cleanup(); +} + +CuSuite *get_lighthouse_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_lighthouse_range); + SUITE_ADD_TEST(suite, test_lighthouse_update); + return suite; +} diff --git a/src/listbox.c b/src/listbox.c index 3686cbba1..332041454 100644 --- a/src/listbox.c +++ b/src/listbox.c @@ -88,7 +88,6 @@ list_selection *do_selection(list_selection * sel, const char *title, width = (int)strlen(s->str); } ++height; - log_debug("s %s w %d h %d\n", s->str, width, height); } if (height == 0 || width == 0) return 0; @@ -97,8 +96,6 @@ list_selection *do_selection(list_selection * sel, const char *title, if (height + 2 > SY) height = SY - 2; - log_debug("w %d h %d\n", width, height); - wn = newwin(height + 2, width + 4, (SY - height - 2) / 2, (SX - width - 4) / 2); diff --git a/src/magic.c b/src/magic.c index d24612e06..2299e6523 100644 --- a/src/magic.c +++ b/src/magic.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 1998-2014, Enno Rehling Katja Zedel #include #include -#include #include #include #include #include #include -#include #include #include @@ -175,7 +173,7 @@ static void a_initicastle(struct attrib *a) a->data.v = calloc(sizeof(icastle_data), 1); } -static void a_finalizeicastle(struct attrib *a) +static void a_finalizeicastle(struct attrib *a) //-V524 { free(a->data.v); } @@ -226,7 +224,11 @@ static void free_mage(attrib * a) bool FactionSpells(void) { - return config_get_int("rules.magic.factionlist", 0) != 0; + static int config, rule; + if (config_changed(&config)) { + rule = config_get_int("rules.magic.factionlist", 0); + } + return rule != 0; } void read_spells(struct quicklist **slistp, magic_t mtype, @@ -345,7 +347,7 @@ attrib_type at_mage = { bool is_mage(const unit * u) { - return i2b(get_mage(u) != NULL); + return get_mage(u) != NULL; } sc_mage *get_mage(const unit * u) @@ -374,7 +376,7 @@ static int read_seenspell(attrib * a, void *owner, struct gamedata *data) char token[32]; READ_TOK(store, token, sizeof(token)); - i = atoi(token); + i = atoip(token); if (i != 0) { sp = find_spellbyid((unsigned int)i); } @@ -1028,9 +1030,8 @@ cancast(unit * u, const spell * sp, int level, int range, struct order * ord) double spellpower(region * r, unit * u, const spell * sp, int cast_level, struct order *ord) { - curse *c; double force = cast_level; - int elf_power; + static int elf_power, config; const struct resource_type *rtype; if (sp == NULL) { @@ -1043,54 +1044,65 @@ spellpower(region * r, unit * u, const spell * sp, int cast_level, struct order if (btype && btype->flags & BTF_MAGIC) ++force; } - elf_power = config_get_int("rules.magic.elfpower", 0); - - if (elf_power && u_race(u) == get_race(RC_ELF) && r_isforest(r)) { - ++force; + if (config_changed(&config)) { + elf_power = config_get_int("rules.magic.elfpower", 0); + } + if (elf_power) { + static int rc_cache; + static const race *rc_elf; + if (rc_changed(&rc_cache)) { + rc_elf = get_race(RC_ELF); + } + if (u_race(u) == rc_elf && r_isforest(r)) { + ++force; + } } rtype = rt_find("rop"); if (rtype && i_get(u->items, rtype->itype) > 0) { ++force; } - /* Antimagie in der Zielregion */ - c = get_curse(r->attribs, ct_find("antimagiczone")); - if (curse_active(c)) { - unit *mage = c->magician; - force -= curse_geteffect(c); - curse_changevigour(&r->attribs, c, -cast_level); - cmistake(u, ord, 185, MSG_MAGIC); - if (mage != NULL && mage->faction != NULL) { - if (force > 0) { - ADDMSG(&mage->faction->msgs, msg_message("reduce_spell", - "self mage region", mage, u, r)); + if (r->attribs) { + curse *c; + + /* Antimagie in der Zielregion */ + c = get_curse(r->attribs, ct_find("antimagiczone")); + if (curse_active(c)) { + unit *mage = c->magician; + force -= curse_geteffect(c); + curse_changevigour(&r->attribs, c, -cast_level); + cmistake(u, ord, 185, MSG_MAGIC); + if (mage != NULL && mage->faction != NULL) { + if (force > 0) { + ADDMSG(&mage->faction->msgs, msg_message("reduce_spell", + "self mage region", mage, u, r)); + } + else { + ADDMSG(&mage->faction->msgs, msg_message("block_spell", + "self mage region", mage, u, r)); + } } - else { - ADDMSG(&mage->faction->msgs, msg_message("block_spell", - "self mage region", mage, u, r)); + } + + /* Patzerfluch-Effekt: */ + c = get_curse(r->attribs, ct_find("fumble")); + if (curse_active(c)) { + unit *mage = c->magician; + force -= curse_geteffect(c); + curse_changevigour(&u->attribs, c, -1); + cmistake(u, ord, 185, MSG_MAGIC); + if (mage != NULL && mage->faction != NULL) { + if (force > 0) { + ADDMSG(&mage->faction->msgs, msg_message("reduce_spell", + "self mage region", mage, u, r)); + } + else { + ADDMSG(&mage->faction->msgs, msg_message("block_spell", + "self mage region", mage, u, r)); + } } } } - - /* Patzerfluch-Effekt: */ - c = get_curse(r->attribs, ct_find("fumble")); - if (curse_active(c)) { - unit *mage = c->magician; - force -= curse_geteffect(c); - curse_changevigour(&u->attribs, c, -1); - cmistake(u, ord, 185, MSG_MAGIC); - if (mage != NULL && mage->faction != NULL) { - if (force > 0) { - ADDMSG(&mage->faction->msgs, msg_message("reduce_spell", - "self mage region", mage, u, r)); - } - else { - ADDMSG(&mage->faction->msgs, msg_message("block_spell", - "self mage region", mage, u, r)); - } - } - } - return _max(force, 0); } @@ -1364,7 +1376,9 @@ static void do_fumble(castorder * co) int level = co->level; int duration; double effect; - + static const race *rc_toad; + static int rc_cache; + ADDMSG(&u->faction->msgs, msg_message("patzer", "unit region spell", u, r, sp)); switch (rng_int() % 10) { @@ -1395,7 +1409,10 @@ static void do_fumble(castorder * co) duration = rng_int() % level / 2; if (duration < 2) duration = 2; add_trigger(&u->attribs, "timer", trigger_timeout(duration, trestore)); - u_setrace(u, get_race(RC_TOAD)); + if (rc_changed(&rc_cache)) { + rc_toad = get_race(RC_TOAD); + } + u_setrace(u, rc_toad); u->irace = NULL; ADDMSG(&r->msgs, msg_message("patzer6", "unit region spell", u, r, sp)); break; @@ -2150,7 +2167,7 @@ typedef struct familiar_data { bool is_familiar(const unit * u) { attrib *a = a_find(u->attribs, &at_familiarmage); - return i2b(a != NULL); + return a != NULL; } static void @@ -2776,6 +2793,8 @@ void magic(void) int rank; castorder *co; spellrank spellranks[MAX_SPELLRANK]; + const race *rc_spell = get_race(RC_SPELL); + const race *rc_insect = get_race(RC_INSECT); memset(spellranks, 0, sizeof(spellranks)); @@ -2784,10 +2803,10 @@ void magic(void) for (u = r->units; u; u = u->next) { order *ord; - if (u->number <= 0 || u_race(u) == get_race(RC_SPELL)) + if (u->number <= 0 || u_race(u) == rc_spell) continue; - if (u_race(u) == get_race(RC_INSECT) && r_insectstalled(r) && + if (u_race(u) == rc_insect && r_insectstalled(r) && !is_cursed(u->attribs, C_KAELTESCHUTZ, 0)) continue; @@ -2954,7 +2973,7 @@ static void select_spellbook(void **tokens, spellbook *sb, const struct locale * else { variant token; token.v = sp; - addtoken(tokens, n, token); + addtoken((struct tnode **)tokens, n, token); } } } diff --git a/src/magic.h b/src/magic.h index 257ba11c4..59ef92475 100644 --- a/src/magic.h +++ b/src/magic.h @@ -184,12 +184,6 @@ extern "C" { SPC_LINEAR /* Komponenten pro Level und müssen vorhanden sein */ }; - enum { - RS_DUMMY, - RS_FARVISION, - MAX_REGIONSPELLS - }; - /* ------------------------------------------------------------- */ /* Prototypen */ diff --git a/src/magic.test.c b/src/magic.test.c index ff6cb1e29..4ba867b96 100644 --- a/src/magic.test.c +++ b/src/magic.test.c @@ -27,7 +27,7 @@ void test_updatespells(CuTest * tc) spell * sp; spellbook *book = 0; - test_cleanup(); + test_setup(); test_create_race("human"); f = test_create_faction(0); @@ -53,7 +53,7 @@ void test_spellbooks(CuTest * tc) spellbook *herp, *derp; spellbook_entry *entry; const char * sname = "herpderp"; - test_cleanup(); + test_setup(); herp = get_spellbook("herp"); CuAssertPtrNotNull(tc, herp); @@ -85,7 +85,7 @@ void test_pay_spell(CuTest * tc) region * r; int level; - test_cleanup(); + test_setup(); test_create_world(); r = findregion(0, 0); f = test_create_faction(0); @@ -119,7 +119,7 @@ void test_pay_spell_failure(CuTest * tc) struct region * r; int level; - test_cleanup(); + test_setup(); test_create_world(); r = findregion(0, 0); f = test_create_faction(0); @@ -157,7 +157,7 @@ void test_getspell_unit(CuTest * tc) struct region * r; struct locale * lang; - test_cleanup(); + test_setup(); test_create_world(); r = findregion(0, 0); f = test_create_faction(0); @@ -186,7 +186,7 @@ void test_getspell_faction(CuTest * tc) struct region * r; struct locale * lang; - test_cleanup(); + test_setup(); test_create_world(); r = findregion(0, 0); f = test_create_faction(0); @@ -218,7 +218,7 @@ void test_getspell_school(CuTest * tc) struct locale * lang; struct spellbook * book; - test_cleanup(); + test_setup(); test_create_world(); r = findregion(0, 0); f = test_create_faction(0); @@ -249,7 +249,7 @@ void test_set_pre_combatspell(CuTest * tc) struct region * r; const int index = 0; - test_cleanup(); + test_setup(); test_create_world(); r = findregion(0, 0); f = test_create_faction(0); @@ -282,7 +282,7 @@ void test_set_main_combatspell(CuTest * tc) struct region * r; const int index = 1; - test_cleanup(); + test_setup(); test_create_world(); r = findregion(0, 0); f = test_create_faction(0); @@ -315,7 +315,7 @@ void test_set_post_combatspell(CuTest * tc) struct region * r; const int index = 2; - test_cleanup(); + test_setup(); test_create_world(); r = findregion(0, 0); f = test_create_faction(0); @@ -347,7 +347,7 @@ void test_hasspell(CuTest * tc) struct faction * f; struct region * r; - test_cleanup(); + test_setup(); test_create_world(); r = findregion(0, 0); f = test_create_faction(0); @@ -382,7 +382,7 @@ void test_multi_cast(CuTest *tc) { spell *sp; struct locale * lang; - test_cleanup(); + test_setup(); sp = create_spell("fireball", 0); sp->cast = cast_fireball; CuAssertPtrEquals(tc, sp, find_spell("fireball")); @@ -410,7 +410,7 @@ static void test_magic_resistance(CuTest *tc) { unit *u; race *rc; - test_cleanup(); + test_setup(); rc = test_create_race("human"); u = test_create_unit(test_create_faction(rc), test_create_region(0, 0, 0)); CuAssertDblEquals(tc, rc->magres, magic_resistance(u), 0.01); diff --git a/src/main.c b/src/main.c index d011a473b..44c1b9e2d 100644 --- a/src/main.c +++ b/src/main.c @@ -20,16 +20,16 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#include #include +#include #include #include #include "eressea.h" +#include "battle.h" #ifdef USE_CURSES #include "gmtool.h" #endif -#include "buildno.h" #include "bindings.h" #include "races/races.h" #include "spells.h" @@ -70,11 +70,6 @@ static void load_inifile(dictionary * d) lomem = iniparser_getint(d, "eressea:lomem", lomem) ? 1 : 0; - str = iniparser_getstring(d, "eressea:encoding", NULL); - if (str && (_strcmpl(str, "utf8") == 0 || _strcmpl(str, "utf-8") == 0)) { - enc_gamedata = ENCODING_UTF8; - } - verbosity = iniparser_getint(d, "eressea:verbose", 2); battledebug = iniparser_getint(d, "eressea:debug", battledebug) ? 1 : 0; @@ -166,8 +161,8 @@ static int parse_args(int argc, char **argv, int *exitcode) if (strcmp(argi + 2, "version") == 0) { printf("\n%s PBEM host\n" "Copyright (C) 1996-2005 C. Schlittchen, K. Zedel, E. Rehling, H. Peters.\n\n" - "Compilation: " __DATE__ " at " __TIME__ "\nVersion: %d.%d.%d\n\n", - game_name(), VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD); + "Compilation: " __DATE__ " at " __TIME__ "\nVersion: %s\n\n", + game_name(), eressea_version()); #ifdef USE_CURSES } else if (strcmp(argi + 2, "color") == 0) { @@ -263,27 +258,6 @@ static int setup_signal_handler(void) } #endif -#undef CRTDBG -#ifdef CRTDBG -#include -void init_crtdbg(void) -{ -#if (defined(_MSC_VER)) - int flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); - if (memdebug == 1) { - flags |= _CRTDBG_CHECK_ALWAYS_DF; /* expensive */ - } else if (memdebug == 2) { - flags = (flags & 0x0000FFFF) | _CRTDBG_CHECK_EVERY_16_DF; - } else if (memdebug == 3) { - flags = (flags & 0x0000FFFF) | _CRTDBG_CHECK_EVERY_128_DF; - } else if (memdebug == 4) { - flags = (flags & 0x0000FFFF) | _CRTDBG_CHECK_EVERY_1024_DF; - } - _CrtSetDbgFlag(flags); -#endif -} -#endif - void locale_init(void) { setlocale(LC_CTYPE, ""); @@ -311,10 +285,6 @@ int main(int argc, char **argv) locale_init(); -#ifdef CRTDBG - init_crtdbg(); -#endif - L = lua_init(); game_init(); bind_monsters(L); @@ -323,10 +293,6 @@ int main(int argc, char **argv) log_error("script %s failed with code %d\n", luafile, err); return err; } -#ifdef MSPACES - malloc_stats(); -#endif - game_done(); lua_done(L); log_close(); diff --git a/src/market.c b/src/market.c index efcaf0d98..cef84b9b2 100644 --- a/src/market.c +++ b/src/market.c @@ -85,6 +85,11 @@ static int rc_herb_trade(const struct race *rc) #define MAX_MARKETS 128 #define MIN_PEASANTS 50 /* if there are at least this many peasants, you will get 1 good */ +bool markets_module(void) +{ + return (bool)config_get_int("modules.markets", 0); +} + void do_markets(void) { quicklist *traders = 0; diff --git a/src/market.h b/src/market.h index dd15253ef..a74c88391 100644 --- a/src/market.h +++ b/src/market.h @@ -17,7 +17,8 @@ extern "C" { #endif struct building; - extern void do_markets(void); + bool markets_module(void); + void do_markets(void); #ifdef __cplusplus } diff --git a/src/modules/arena.c b/src/modules/arena.c index 97488218a..a912d273a 100644 --- a/src/modules/arena.c +++ b/src/modules/arena.c @@ -70,11 +70,6 @@ plane *arena = NULL; /* local vars */ #define CENTRAL_VOLCANO 1 -#ifdef ARENA_CREATION -static unsigned int arena_id = 0; -static region *arena_center = NULL; -static int newarena = 0; -#endif static region *tower_region[6]; static region *start_region[6]; @@ -180,228 +175,6 @@ enter_arena(unit * u, const item_type * itype, int amount, order * ord) move_unit(u, start_region[rng_int() % 6], NULL); return 0; } - -/*** - ** Szepter der Tränen, Demo-Item - ***/ - -static int -use_wand_of_tears(unit * user, const struct item_type *itype, int amount, -order * ord) -{ - int n; - unused_arg(ord); - for (n = 0; n != amount; ++n) { - unit *u; - for (u = user->region->units; u; u = u->next) { - if (u->faction != user->faction) { - int i; - - for (i = 0; i != u->skill_size; ++i) { - if (rng_int() % 3) - reduce_skill(u, u->skills + i, 1); - } - ADDMSG(&u->faction->msgs, msg_message("wand_of_tears_effect", - "unit", u)); - } - } - } - ADDMSG(&user->region->msgs, msg_message("wand_of_tears_usage", "unit", user)); - return 0; -} - -/** - * Tempel der Schreie, Demo-Gebäude **/ - -static int age_hurting(attrib * a, void *owner) -{ - building *b = (building *)a->data.v; - unit *u; - int active = 0; - assert(owner == b); - if (b == NULL) - return AT_AGE_REMOVE; - for (u = b->region->units; u; u = u->next) { - if (u->building == b) { - if (u->faction->magiegebiet == M_DRAIG) { - active++; - ADDMSG(&b->region->msgs, msg_message("praytoigjarjuk", "unit", u)); - } - } - } - if (active) - for (u = b->region->units; u; u = u->next) - if (playerrace(u->faction->race)) { - int i; - if (u->faction->magiegebiet != M_DRAIG) { - for (i = 0; i != active; ++i) - u->hp = (u->hp + 1) / 2; /* make them suffer, but not die */ - ADDMSG(&b->region->msgs, msg_message("cryinpain", "unit", u)); - } - } - return AT_AGE_KEEP; -} - -static void -write_hurting(const attrib * a, const void *owner, struct storage *store) -{ - building *b = a->data.v; - WRITE_INT(store, b->no); -} - -static int read_hurting(attrib * a, void *owner, struct gamedata *data) -{ - int i; - READ_INT(data->store, &i); - a->data.v = (void *)findbuilding(i); - if (a->data.v == NULL) { - log_error("temple of pain is broken\n"); - return AT_READ_FAIL; - } - return AT_READ_OK; -} - -static attrib_type at_hurting = { - "hurting", NULL, NULL, age_hurting, write_hurting, read_hurting -}; - -#ifdef ARENA_CREATION -static void make_temple(region * r) -{ - const building_type *btype = bt_find("temple"); - building *b; - if (btype == NULL) { - log_error("could not find buildingtype 'temple'\n"); - return; - } - - b = r->buildings; - while (b != NULL && b->type != btype) - b = b->next; - if (b != NULL) - return; /* gibt schon einen */ - - b = new_building(btype, r, NULL); - b->size = btype->maxsize; - b->name = _strdup("Igjarjuk's Tempel der Schreie"); - b->display = - _strdup - ("Ein Schrein aus spitzen Knochen und lodernden Flammen, gewidmet dem Wyrm der Wyrme"); - a_add(&b->attribs, a_new(&at_hurting))->data.v = b; -} -#endif - -/** - * Initialisierung Türme */ - -#ifdef ARENA_CREATION -static void tower_init(void) -{ - int i, first = newarena; - item_type *it_demonseye = it_find("demonseye"); - item_type *it_griphonwing = it_find("griphonwing"); - assert(it_griphonwing && it_demonseye); - for (i = 0; i != 6; ++i) { - region *r = tower_region[i] = - findregion(arena_center->x + delta_x[i] * 3, - arena_center->y + delta_y[i] * 3); - if (r) { - start_region[i] = - findregion(arena_center->x + delta_x[i] * 2, - arena_center->y + delta_y[i] * 2); - if (rterrain(r) != T_DESERT) - terraform(r, T_DESERT); - if (!r->buildings) { - building *b = new_building(bt_find("castle"), r, NULL); - b->size = 10; - if (i != 0) { - sprintf(buf, "Turm des %s", - LOC(default_locale, mkname("school", magic_school[i]))); - } else - sprintf(buf, "Turm der Ahnungslosen"); - set_string(&b->name, buf); - } - } - } - if (first && !arena_center->buildings) { - building *b = new_building(bt_find("castle"), arena_center, NULL); - attrib *a; - item *items; - - i_add(&items, i_new(it_griphonwing, 1)); - i_add(&items, i_new(it_demonseye, 1)); - a = a_add(&b->attribs, make_giveitem(b, items)); - - b->size = 10; - set_string(&b->name, "Höhle des Greifen"); - } -} -#endif - -#ifdef ARENA_CREATION -static void guardian_faction(plane * pl, int id) -{ - region *r; - faction *f = findfaction(id); - - if (!f) { - f = calloc(1, sizeof(faction)); - f->banner = _strdup("Sie dienen dem großen Wyrm"); - f->passw = _strdup(itoa36(rng_int())); - set_email(&f->email, "igjarjuk@eressea.de"); - f->name = _strdup("Igjarjuks Kundschafter"); - f->race = get_race(RC_ILLUSION); - f->age = turn; - f->locale = get_locale("de"); - f->options = - want(O_COMPRESS) | want(O_REPORT) | want(O_COMPUTER) | want(O_ADRESSEN) | - want(O_DEBUG); - - f->no = id; - addlist(&factions, f); - fhash(f); - } - if (f->race != get_race(RC_ILLUSION)) { - assert(!"guardian id vergeben"); - exit(0); - } - f->lastorders = turn; - f->alive = true; - for (r = regions; r; r = r->next) - if (getplane(r) == pl && rterrain(r) != T_FIREWALL) { - unit *u; - freset(r, RF_ENCOUNTER); - for (u = r->units; u; u = u->next) { - if (u->faction == f) - break; - } - if (u) - continue; - u = create_unit(r, f, 1, get_race(RC_GOBLIN), 0, NULL, NULL); - set_string(&u->name, "Igjarjuks Auge"); - i_change(&u->items, it_find("roi"), 1); - set_order(&u->thisorder, NULL); - fset(u, UFL_ANON_FACTION); - set_money(u, 1000); - } -} -#endif - -#define BLOCKSIZE 9 - -#ifdef ARENA_CREATION -static void block_create(int x1, int y1, char terrain) -{ - int x, y; - for (x = 0; x != BLOCKSIZE; ++x) { - for (y = 0; y != BLOCKSIZE; ++y) { - region *r = new_region(x1 + x, y1 + y, 0); - terraform(r, terrain); - } - } -} -#endif - #ifdef CENTRAL_VOLCANO static int caldera_handle(trigger * t, void *data) @@ -469,94 +242,11 @@ struct trigger_type tt_caldera = { caldera_read }; -#ifdef ARENA_CREATION -static trigger *trigger_caldera(building * b) -{ - trigger *t = t_new(&tt_caldera); - t->data.v = b; - return t; -} #endif -#ifdef ARENA_CREATION -static void init_volcano(void) -{ - building *b; - region *r = arena_center; - assert(arena_center); - if (rterrain(r) != T_DESERT) - return; /* been done before */ - terraform(arena_center, T_VOLCANO_SMOKING); - b = new_building(bt_find("caldera"), r, NULL); - b->size = 1; - b->name = _strdup("Igjarjuk's Schlund"); - b->display = - _strdup - ("Feurige Lava fließt aus dem Krater des großen Vulkans. Alles wird von ihr verschlungen."); - add_trigger(&b->attribs, "timer", trigger_caldera(b)); - tt_register(&tt_caldera); -} -#endif -#endif - -#ifdef ARENA_CREATION -void create_arena(void) -{ - int x; - arena_id = hashstring("arena"); - arena = getplanebyid(arena_id); - if (arena != NULL) - return; - score(); /* ist wichtig, damit alle Parteien einen score haben, wenn sie durchs Tor wollen. */ - guardian_faction(arena, 999); - if (arena) - arena_center = findregion(plane_center_x(arena), plane_center_y(arena)); - if (!arena_center) { - newarena = 1; - arena = - create_new_plane(arena_id, "Arena", -10000, -10000, 0, BLOCKSIZE - 1, - PFL_LOWSTEALING | PFL_NORECRUITS | PFL_NOALLIANCES); - block_create(arena->minx, arena->miny, T_OCEAN); - arena_center = findregion(plane_center_x(arena), plane_center_y(arena)); - for (x = 0; x != BLOCKSIZE; ++x) { - int y; - for (y = 0; y != BLOCKSIZE; ++y) { - region *r = findregion(arena->minx + x, arena->miny + y); - freset(r, RF_ENCOUNTER); - r->planep = arena; - switch (distance(r, arena_center)) { - case 4: - terraform(r, T_FIREWALL); - break; - case 0: - terraform(r, T_GLACIER); - break; - case 1: - terraform(r, T_SWAMP); - break; - case 2: - terraform(r, T_MOUNTAIN); - break; - } - } - } - } - make_temple(arena_center); -#ifdef CENTRAL_VOLCANO - init_volcano(); -#else - if (arena_center->terrain != T_DESERT) - terraform(arena_center, T_DESERT); -#endif - rsetmoney(arena_center, 0); - rsetpeasants(arena_center, 0); - tower_init(); -} -#endif void register_arena(void) { - at_register(&at_hurting); - register_item_use(use_wand_of_tears, "use_wand_of_tears"); + at_deprecate("hurting", a_readint); register_function((pf_generic)enter_arena, "enter_arena"); register_function((pf_generic)leave_arena, "leave_arena"); tt_register(&tt_caldera); diff --git a/src/modules/autoseed.c b/src/modules/autoseed.c index e8855683e..5420406c0 100644 --- a/src/modules/autoseed.c +++ b/src/modules/autoseed.c @@ -14,6 +14,8 @@ #include #include "autoseed.h" +#include "market.h" + /* kernel includes */ #include #include @@ -132,20 +134,6 @@ static bool f_nolux(const region * r) return (r->land && count_demand(r) != get_maxluxuries()); } -int fix_demand(region * rd) { - luxury_type * ltype; - int maxluxuries = get_maxluxuries(); - if (maxluxuries > 0) { - int sale = rng_int() % maxluxuries; - for (ltype = luxurytypes; sale != 0 && ltype; ltype = ltype->next) { - --sale; - } - setluxuries(rd, ltype); - return 0; - } - return -1; -} - int fix_all_demand(region *rd) { region_list *rl, *rlist = NULL; recurse_regions(rd, &rlist, f_nolux); diff --git a/src/modules/autoseed.h b/src/modules/autoseed.h index 3cfe6225c..06ce646c2 100644 --- a/src/modules/autoseed.h +++ b/src/modules/autoseed.h @@ -35,7 +35,6 @@ extern "C" { extern int autoseed(newfaction ** players, int nsize, int max_agediff); extern newfaction *read_newfactions(const char *filename); - extern int fix_demand(struct region *r); extern const struct terrain_type *random_terrain(const struct terrain_type *terrains[], int distribution[], int size); diff --git a/src/modules/gmcmd.c b/src/modules/gmcmd.c index b9e1bc342..9a4e7ac47 100644 --- a/src/modules/gmcmd.c +++ b/src/modules/gmcmd.c @@ -19,7 +19,6 @@ #include #include #include -#include /* kernel includes */ #include @@ -29,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/src/modules/museum.c b/src/modules/museum.c index 5ad9092a4..e934a71a4 100644 --- a/src/modules/museum.c +++ b/src/modules/museum.c @@ -32,7 +32,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include #include #include diff --git a/src/modules/score.c b/src/modules/score.c index 2fd3cf230..8213b8985 100644 --- a/src/modules/score.c +++ b/src/modules/score.c @@ -38,6 +38,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include /* libc includes */ +#include #include #include @@ -105,14 +106,14 @@ void score(void) int itemscore = 0; int i; faction *f = u->faction; + const race *rc = u_race(u); - if (f == NULL || u_race(u) == get_race(RC_SPELL) - || u_race(u) == get_race(RC_BIRTHDAYDRAGON)) { + if (f == NULL) { continue; } - - if (old_race(u_race(u)) <= RC_AQUARIAN) { - f->score += (u_race(u)->recruitcost * u->number) / 50; + else if (rc->recruitcost>0) { + assert(playerrace(rc)); + f->score += (rc->recruitcost * u->number) / 50; } f->score += get_money(u) / 50; for (itm = u->items; itm; itm = itm->next) { @@ -168,7 +169,7 @@ void score(void) fprintf(scoreFP, "%30.30s (%3.3s) %5s (%3d)\n", f->name, f->race->_name, - factionid(f), + itoa36(f->no), f->age); } fclose(scoreFP); diff --git a/src/modules/score.h b/src/modules/score.h index b0f1b2a91..4fc1f52bb 100644 --- a/src/modules/score.h +++ b/src/modules/score.h @@ -18,6 +18,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef SCORE_H #define SCORE_H + +#include #ifdef __cplusplus extern "C" { #endif diff --git a/src/monster.c b/src/monster.c index 5eafba1ea..301b1b132 100644 --- a/src/monster.c +++ b/src/monster.c @@ -28,6 +28,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* attributes includes */ #include #include +#include /* kernel includes */ #include @@ -75,25 +76,17 @@ bool monster_is_waiting(const unit * u) static void eaten_by_monster(unit * u) { /* adjustment for smaller worlds */ - static double multi = 0.0; + double multi = RESOURCE_QUANTITY * newterrain(T_PLAIN)->size / 10000.0; int n = 0; int horse = -1; const resource_type *rhorse = get_resourcetype(R_HORSE); - if (multi == 0.0) { - multi = RESOURCE_QUANTITY * newterrain(T_PLAIN)->size / 10000.0; - } + const race *rc = u_race(u); + attrib *a; - switch (old_race(u_race(u))) { - case RC_FIREDRAGON: - n = rng_int() % 80 * u->number; - break; - case RC_DRAGON: - n = rng_int() % 200 * u->number; - break; - case RC_WYRM: - n = rng_int() % 500 * u->number; - break; - default: + a = a_find(rc->attribs, &at_scare); + if (a) { + n = rng_int() & a->data.i * u->number; + } else { n = rng_int() % (u->number / 20 + 1); horse = 0; } @@ -118,12 +111,7 @@ static void eaten_by_monster(unit * u) static void absorbed_by_monster(unit * u) { - int n; - - switch (old_race(u_race(u))) { - default: - n = rng_int() % (u->number / 20 + 1); - } + int n = rng_int() % (u->number / 20 + 1); if (n > 0) { n = lovar(n); @@ -172,21 +160,14 @@ static int scareaway(region * r, int anzahl) static void scared_by_monster(unit * u) { int n; - - switch (old_race(u_race(u))) { - case RC_FIREDRAGON: - n = rng_int() % 160 * u->number; - break; - case RC_DRAGON: - n = rng_int() % 400 * u->number; - break; - case RC_WYRM: - n = rng_int() % 1000 * u->number; - break; - default: + const race *rc = u_race(u); + attrib *a; + a = a_find(rc->attribs, &at_scare); + if (a) { + n = rng_int() & a->data.i * u->number; + } else { n = rng_int() % (u->number / 4 + 1); } - if (n > 0) { n = lovar(n); n = _min(rpeasants(u->region), n); diff --git a/src/monster.h b/src/monster.h index 476bcb73e..0f936b17d 100644 --- a/src/monster.h +++ b/src/monster.h @@ -31,7 +31,7 @@ extern "C" { void make_zombie(struct unit * u); #define MONSTER_ID 666 -#define is_monsters(f) (fval(f, FFL_NPC) && f==get_monsters()) +#define is_monsters(f) ((f->flags & FFL_NPC) && f==get_monsters()) #ifdef __cplusplus } diff --git a/src/monsters.c b/src/monsters.c index 67bf9370d..cea817589 100644 --- a/src/monsters.c +++ b/src/monsters.c @@ -25,6 +25,7 @@ #include "economy.h" #include "chaos.h" #include "give.h" +#include "guard.h" #include "monster.h" #include "laws.h" #include "keyword.h" @@ -84,7 +85,12 @@ static void give_peasants(unit *u, const item_type *itype, int reduce) { } static double random_move_chance(void) { - return config_get_flt("rules.monsters.random_move_chance", MOVECHANCE); + static double rule; + static int config; + if (config_changed(&config)) { + rule = config_get_flt("rules.monsters.random_move_chance", MOVECHANCE); + } + return rule; } static void reduce_weight(unit * u) @@ -197,7 +203,7 @@ static order *get_money_for_dragon(region * r, unit * udragon, int wanted) /* falls der drache launisch ist, oder das regionssilber knapp, greift er alle an * und holt sich Silber von Einheiten, vorausgesetzt er bewacht bereits */ money = 0; - if (attacks && is_guard(udragon, GUARD_TAX)) { + if (attacks && is_guard(udragon)) { money += monster_attacks(udragon, true, true); } @@ -264,47 +270,57 @@ static direction_t richest_neighbour(region * r, faction * f, int absolut) static bool room_for_race_in_region(region * r, const race * rc) { - unit *u; - int c = 0; + if (rc->splitsize > 0) { + unit *u; + int c = 0; - for (u = r->units; u; u = u->next) { - if (u_race(u) == rc) - c += u->number; + for (u = r->units; u; u = u->next) { + if (u_race(u) == rc) { + c += u->number; + if (c > rc->splitsize * 2) { + return false; + } + } + } } - - if (c > (rc->splitsize * 2)) - return false; - return true; } static direction_t random_neighbour(region * r, unit * u) { int i; - region *rc; - region * next[MAXDIRECTIONS]; + region *next[MAXDIRECTIONS], *backup[MAXDIRECTIONS]; + region **pick; int rr, c = 0, c2 = 0; + const race *rc = u_race(u); get_neighbours(r, next); /* Nachsehen, wieviele Regionen in Frage kommen */ for (i = 0; i != MAXDIRECTIONS; i++) { - rc = next[i]; - if (rc && can_survive(u, rc)) { - if (room_for_race_in_region(rc, u_race(u))) { + region *rn = next[i]; + if (rn && can_survive(u, rn)) { + if (room_for_race_in_region(rn, rc)) { c++; + } else { + next[i] = NULL; } + backup[i] = rn; c2++; + } else { + next[i] = NULL; + backup[i] = NULL; } } + pick = next; if (c == 0) { if (c2 == 0) { return NODIRECTION; } else { + pick = backup; c = c2; - c2 = 0; /* c2 == 0 -> room_for_race nicht beachten */ } } @@ -314,18 +330,14 @@ static direction_t random_neighbour(region * r, unit * u) /* Durchzählen */ - c = -1; + c = 0; for (i = 0; i != MAXDIRECTIONS; i++) { - rc = next[i]; - if (rc && can_survive(u, rc)) { - if (c2 == 0) { - c++; - } - else if (room_for_race_in_region(rc, u_race(u))) { - c++; - } - if (c == rr) + region *rn = pick[i]; + if (rn) { + if (c == rr) { return (direction_t)i; + } + c++; } } @@ -380,20 +392,15 @@ static order *monster_move(region * r, unit * u) if (monster_is_waiting(u)) { return NULL; } - switch (old_race(u_race(u))) { - case RC_FIREDRAGON: - case RC_DRAGON: - case RC_WYRM: + if (fval(u_race(u), RCF_DRAGON)) { d = richest_neighbour(r, u->faction, 1); - break; - case RC_TREEMAN: - d = treeman_neighbour(r); - break; - default: - d = random_neighbour(r, u); - break; } - + else if (get_race(RC_TREEMAN)==u_race(u)) { + d = treeman_neighbour(r); + } + else { + d = random_neighbour(r, u); + } /* falls kein geld gefunden wird, zufaellig verreisen, aber nicht in * den ozean */ @@ -490,65 +497,6 @@ static order *make_movement_order(unit * u, const region * target, int moves, return parse_order(zOrder, u->faction->locale); } -#ifdef TODO_ALP -static order *monster_seeks_target(region * r, unit * u) -{ - direction_t d; - unit *target = NULL; - int dist, dist2; - direction_t i; - region *nr; - - /* Das Monster sucht ein bestimmtes Opfer. Welches, steht - * in einer Referenz/attribut - * derzeit gibt es nur den alp - */ - - switch (old_race(u_race(u))) { - case RC_ALP: - target = alp_target(u); - break; - default: - assert(!"Seeker-Monster gibt kein Ziel an"); - } - - /* TODO: prüfen, ob target überhaupt noch existiert... */ - if (!target) { - log_error("Monster '%s' hat kein Ziel!\n", unitname(u)); - return NULL; /* this is a bug workaround! remove!! */ - } - - if (r == target->region) { /* Wir haben ihn! */ - if (u_race(u) == get_race(RC_ALP)) { - alp_findet_opfer(u, r); - } else { - assert(!"Seeker-Monster hat keine Aktion fuer Ziel"); - } - return NULL; - } - - /* Simpler Ansatz: Nachbarregion mit gerinster Distanz suchen. - * Sinnvoll momentan nur bei Monstern, die sich nicht um das - * Terrain kümmern. Nebelwände & Co machen derzeit auch nix... - */ - dist2 = distance(r, target->region); - d = NODIRECTION; - for (i = 0; i < MAXDIRECTIONS; i++) { - nr = rconnect(r, i); - assert(nr); - dist = distance(nr, target->region); - if (dist < dist2) { - dist2 = dist; - d = i; - } - } - assert(d != NODIRECTION); - - return create_order(K_MOVE, u->faction->locale, "%s", - LOC(u->faction->locale, directions[d])); -} -#endif - void random_growl(const unit *u, region *target, int rand) { const struct locale *lang = u->faction->locale; @@ -605,19 +553,21 @@ static order *monster_learn(unit * u) return NULL; } -static bool check_overpopulated(unit * u) +static bool check_overpopulated(const unit * u) { - unit *u2; - int c = 0; + const race *rc = u_race(u); + if (rc->splitsize > 0) { + unit *u2; + int c = 0; - for (u2 = u->region->units; u2; u2 = u2->next) { - if (u_race(u2) == u_race(u) && u != u2) - c += u2->number; + for (u2 = u->region->units; u2; u2 = u2->next) { + if (u != u2 && u_race(u2) == rc) { + c += u2->number; + if (c > rc->splitsize * 2) + return true; + } + } } - - if (c > u_race(u)->splitsize * 2) - return true; - return false; } @@ -657,6 +607,13 @@ static order *plan_dragon(unit * u) region *tr = NULL; bool move = false; order *long_order = NULL; + static int rc_cache; + static const race *rc_wyrm; + const race * rc = u_race(u); + + if (rc_changed(&rc_cache)) { + rc_wyrm = get_race(RC_WYRM); + } if (ta == NULL) { move |= (rpeasants(r) == 0); /* when no peasants, move */ @@ -664,7 +621,7 @@ static order *plan_dragon(unit * u) } move |= chance(0.04); /* 4% chance to change your mind */ - if (u_race(u) == get_race(RC_WYRM) && !move) { + if (rc == rc_wyrm && !move) { unit *u2; for (u2 = r->units; u2; u2 = u2->next) { /* wyrme sind einzelgänger */ @@ -694,18 +651,21 @@ static order *plan_dragon(unit * u) } if (tr != NULL) { assert(long_order == NULL); - switch (old_race(u_race(u))) { - case RC_FIREDRAGON: - long_order = make_movement_order(u, tr, 4, allowed_dragon); - break; - case RC_DRAGON: - long_order = make_movement_order(u, tr, 3, allowed_dragon); - break; - case RC_WYRM: + // TODO: per-race planning functions? + if (rc == rc_wyrm) { long_order = make_movement_order(u, tr, 1, allowed_dragon); - break; - default: - break; + } + else { + switch (old_race(rc)) { + case RC_FIREDRAGON: + long_order = make_movement_order(u, tr, 4, allowed_dragon); + break; + case RC_DRAGON: + long_order = make_movement_order(u, tr, 3, allowed_dragon); + break; + default: + break; + } } if (long_order) { reduce_weight(u); @@ -735,7 +695,7 @@ static order *plan_dragon(unit * u) int attempts = 0; skill_t sk = SK_PERCEPTION; /* study perception (or a random useful skill) */ - while ((!skill_enabled(sk) || (attempts < MAXSKILLS && u_race(u)->bonus[sk] < (++attempts < 10?1:-5 )))) { + while (!skill_enabled(sk) || (attempts < MAXSKILLS && u_race(u)->bonus[sk] < (++attempts < 10?1:-5 ))) { sk = (skill_t)(rng_int() % MAXSKILLS); } long_order = create_order(K_STUDY, u->faction->locale, "'%s'", @@ -757,6 +717,7 @@ void plan_monsters(faction * f) bool attacking = chance(attack_chance); for (u = r->units; u; u = u->next) { + const race *rc = u_race(u); attrib *ta; order *long_order = NULL; @@ -775,7 +736,7 @@ void plan_monsters(faction * f) setstatus(u, ST_FIGHT); /* all monsters fight */ } - if (attacking && (!r->land || is_guard(u, GUARD_TAX))) { + if (attacking && (!r->land || is_guard(u))) { monster_attacks(u, true, false); } @@ -812,7 +773,7 @@ void plan_monsters(faction * f) a_remove(&u->attribs, ta); } } - else if (u_race(u)->flags & RCF_MOVERANDOM) { + else if (rc->flags & RCF_MOVERANDOM) { if (chance(random_move_chance()) || check_overpopulated(u)) { long_order = monster_move(r, u); } @@ -826,31 +787,24 @@ void plan_monsters(faction * f) handle_event(u->attribs, "ai_move", u); } - switch (old_race(u_race(u))) { - case RC_SEASERPENT: - long_order = create_order(K_PIRACY, f->locale, NULL); - break; -#ifdef TODO_ALP - case RC_ALP: - long_order = monster_seeks_target(r, u); - break; -#endif - case RC_FIREDRAGON: - case RC_DRAGON: - case RC_WYRM: + if (fval(rc, RCF_DRAGON)) { long_order = plan_dragon(u); - break; - default: - if (u_race(u)->flags & RCF_LEARN) { - long_order = monster_learn(u); + } + else { + if (rc == get_race(RC_SEASERPENT)) { + long_order = create_order(K_PIRACY, f->locale, NULL); + } + else { + if (rc->flags & RCF_LEARN) { + long_order = monster_learn(u); + } } - break; } } if (long_order == NULL && unit_can_study(u)) { /* Einheiten, die Waffenlosen Kampf lernen könnten, lernen es um * zu bewachen: */ - if (u_race(u)->bonus[SK_WEAPONLESS] != -99) { + if (rc->bonus[SK_WEAPONLESS] != -99) { if (effskill(u, SK_WEAPONLESS, 0) < 1) { long_order = create_order(K_STUDY, f->locale, "'%s'", @@ -939,16 +893,16 @@ void spawn_undead(void) { region *r; faction *monsters = get_monsters(); + const curse_type *ctype = ct_find("holyground"); for (r = regions; r; r = r->next) { int unburied = deathcount(r); - static const curse_type *ctype = NULL; - - if (!ctype) - ctype = ct_find("holyground"); - if (ctype && curse_active(get_curse(r->attribs, ctype))) - continue; + if (r->attribs && ctype) { + if (curse_active(get_curse(r->attribs, ctype))) { + continue; + } + } /* Chance 0.1% * chaosfactor */ if (r->land && unburied > rpeasants(r) / 20 && rng_int() % 10000 < (100 + 100 * chaosfactor(r))) { diff --git a/src/monsters.test.c b/src/monsters.test.c index a44a354d9..ca793891c 100644 --- a/src/monsters.test.c +++ b/src/monsters.test.c @@ -54,8 +54,7 @@ static void create_monsters(faction **player, faction **monsters, unit **u, unit *monsters = get_or_create_monsters(); assert(rc_find((*monsters)->race->_name)); rc = rc_get_or_create((*monsters)->race->_name); - fset(rc, RCF_UNARMEDGUARD); - fset(rc, RCF_NPC); + fset(rc, RCF_UNARMEDGUARD|RCF_NPC|RCF_DRAGON); fset(*monsters, FFL_NOIDLEOUT); assert(fval(*monsters, FFL_NPC) && fval((*monsters)->race, RCF_UNARMEDGUARD) && fval((*monsters)->race, RCF_NPC) && fval(*monsters, FFL_NOIDLEOUT)); @@ -75,7 +74,7 @@ static void test_monsters_attack(CuTest * tc) create_monsters(&f, &f2, &u, &m); - guard(m, GUARD_TAX); + setguard(m, true); config_set("rules.monsters.attack_chance", "1"); @@ -112,7 +111,7 @@ static void test_monsters_waiting(CuTest * tc) unit *u, *m; create_monsters(&f, &f2, &u, &m); - guard(m, GUARD_TAX); + setguard(m, true); fset(m, UFL_ISNEW); monster_attacks(m, false, false); CuAssertPtrEquals(tc, 0, find_order("attack 1", m)); @@ -151,8 +150,8 @@ static void test_monsters_attack_not(CuTest * tc) create_monsters(&f, &f2, &u, &m); - guard(m, GUARD_TAX); - guard(u, GUARD_TAX); + setguard(m, true); + setguard(u, true); config_set("rules.monsters.attack_chance", "0"); @@ -171,7 +170,7 @@ static void test_dragon_attacks_the_rich(CuTest * tc) create_monsters(&f, &f2, &u, &m); init_resources(); - guard(m, GUARD_TAX); + setguard(m, true); set_level(m, SK_WEAPONLESS, 10); rsetmoney(findregion(0, 0), 1); diff --git a/src/move.c b/src/move.c index 5de13a2a4..b6a908837 100644 --- a/src/move.c +++ b/src/move.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 1998-2014, Enno Rehling Katja Zedel #include #include "move.h" +#include "guard.h" #include "laws.h" #include "reports.h" #include "study.h" @@ -43,7 +44,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include #include #include @@ -57,6 +57,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "skill.h" /* util includes */ +#include #include #include #include @@ -77,7 +78,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include /* libc includes */ -#include #include #include #include @@ -127,6 +127,7 @@ get_followers(unit * target, region * r, const region_list * route_end, const attrib *a = a_find(uf->attribs, &at_follow); if (a && a->data.v == target) { follower *fnew = (follower *)malloc(sizeof(follower)); + assert_alloc(fnew); fnew->uf = uf; fnew->ut = target; fnew->route_end = route_end; @@ -495,7 +496,8 @@ static double overload(const region * r, ship * sh) if (sh->type->construction && sh->size != sh->type->construction->maxsize) { return DBL_MAX; - } else { + } + else { int n = 0, p = 0; int mcabins = sh->type->cabins; @@ -585,18 +587,21 @@ static void leave_trail(ship * sh, region * from, region_list * route) while (a != NULL && a->type == &at_shiptrail) { td = (traveldir *)a->data.v; - if (td->no == sh->no) + if (td->no == sh->no) { + td->dir = dir; + td->age = 2; break; + } a = a->next; } - if (a == NULL || a->type != &at_shiptrail) { + if (a == NULL) { a = a_add(&(r->attribs), a_new(&at_shiptrail)); td = (traveldir *)a->data.v; td->no = sh->no; + td->dir = dir; + td->age = 2; } - td->dir = dir; - td->age = 2; } route = route->next; r = rn; @@ -664,8 +669,7 @@ static bool is_freezing(const unit * u) int check_ship_allowed(struct ship *sh, const region * r) { int c = 0; - const building_type *bt_harbour = NULL; - bt_harbour = bt_find("harbour"); + const building_type *bt_harbour = bt_find("harbour"); if (sh->region && r_insectstalled(r)) { /* insekten dürfen nicht hier rein. haben wir welche? */ @@ -769,8 +773,9 @@ static void msg_to_ship_inmates(ship *sh, unit **firstu, unit **lastu, message * *lastu = u->next; } } - if (shipfirst) + if (shipfirst) { *firstu = shipfirst; + } for (u = *firstu; u != *lastu; u = u->next) { freset(u->faction, FFL_MARK); } @@ -823,7 +828,7 @@ static void drifting_ships(region * r) /* Kapitän bestimmen */ captain = ship_owner(sh); if (captain && effskill(captain, SK_SAILING, r) < sh->type->cptskill) - captain = NULL; + captain = NULL; /* Kapitän da? Beschädigt? Genügend Matrosen? * Genügend leicht? Dann ist alles OK. */ @@ -838,7 +843,8 @@ static void drifting_ships(region * r) ovl = overload(r, sh); if (ovl >= overload_start()) { rnext = NULL; - } else { + } + else { /* Auswahl einer Richtung: Zuerst auf Land, dann * zufällig. Falls unmögliches Resultat: vergiß es. */ rnext = drift_target(sh); @@ -865,7 +871,8 @@ static void drifting_ships(region * r) if (ovl >= overload_start()) { damage_ship(sh, damage_overload(ovl)); msg_to_ship_inmates(sh, &firstu, &lastu, msg_message("massive_overload", "ship", sh)); - } else + } + else damage_ship(sh, damage_drift); if (sh->damage >= sh->size * DAMAGE_SCALE) { msg_to_ship_inmates(sh, &firstu, &lastu, msg_message("shipsink", "ship", sh)); @@ -915,6 +922,7 @@ static unit *bewegung_blockiert_von(unit * reisender, region * r) int guard_count = 0; int stealth = eff_stealth(reisender, r); const struct resource_type *ramulet = get_resourcetype(R_AMULET_OF_TRUE_SEEING); + const struct building_type *castle_bt = bt_find("castle"); double base_prob = config_get_flt("rules.guard.base_stop_prob", .3); double skill_prob = config_get_flt("rules.guard.skill_stop_prob", .1); @@ -926,7 +934,7 @@ static unit *bewegung_blockiert_von(unit * reisender, region * r) if (fval(u_race(reisender), RCF_ILLUSIONARY)) return NULL; for (u = r->units; u; u = u->next) { - if (is_guard(u, GUARD_TRAVELTHRU)) { + if (is_guard(u)) { int sk = effskill(u, SK_PERCEPTION, r); if (invisible(reisender, u) >= reisender->number) continue; @@ -939,7 +947,7 @@ static unit *bewegung_blockiert_von(unit * reisender, region * r) double prob_u = (sk - stealth) * skill_prob; /* amulet counts at most once */ prob_u += _min(1, _min(u->number, i_get(u->items, ramulet->itype))) * amulet_prob; - if (u->building && (u->building->type == bt_find("castle")) && u == building_owner(u->building)) + if (u->building && (u->building->type == castle_bt) && u == building_owner(u->building)) prob_u += castle_prob*buildingeffsize(u->building, 0); if (prob_u >= prob) { prob = prob_u; @@ -969,102 +977,25 @@ static unit *bewegung_blockiert_von(unit * reisender, region * r) return NULL; } -static bool is_guardian_u(const unit * guard, unit * u, unsigned int mask) -{ - if (guard->faction == u->faction) - return false; - if (is_guard(guard, mask) == 0) - return false; - if (alliedunit(guard, u->faction, HELP_GUARD)) - return false; - if (ucontact(guard, u)) - return false; - if (!cansee(guard->faction, u->region, u, 0)) - return false; - if (!(u_race(guard)->flags & RCF_FLY) && u_race(u)->flags & RCF_FLY) - return false; - - return true; -} - -static bool is_guardian_r(const unit * guard) -{ - if (guard->number == 0) - return false; - if (besieged(guard)) - return false; - - /* if region_owners exist then they may be guardians: */ - if (guard->building && rule_region_owners() && guard == building_owner(guard->building)) { - faction *owner = region_get_owner(guard->region); - if (owner == guard->faction) { - building *bowner = largestbuilding(guard->region, &cmp_taxes, false); - if (bowner == guard->building) { - return true; - } - } - } - - if ((guard->flags & UFL_GUARD) == 0) - return false; - return armedmen(guard, true) > 0 || fval(u_race(guard), RCF_UNARMEDGUARD); -} - -bool is_guard(const struct unit * u, unsigned int mask) -{ - return is_guardian_r(u) && (getguard(u) & mask) != 0; -} - -unit *is_guarded(region * r, unit * u, unsigned int mask) -{ - unit *u2; - int noguards = 1; - - if (!fval(r, RF_GUARDED)) { - return NULL; - } - - /* at this point, u2 is the last unit we tested to - * be a guard (and failed), or NULL - * i is the position of the first free slot in the cache */ - - for (u2 = r->units; u2; u2 = u2->next) { - if (is_guardian_r(u2)) { - noguards = 0; - if (is_guardian_u(u2, u, mask)) { - /* u2 is our guard. stop processing (we might have to go further next time) */ - return u2; - } - } - } - - if (noguards) { - /* you are mistaken, sir. there are no guards in these lands */ - freset(r, RF_GUARDED); - } - return NULL; -} - bool move_blocked(const unit * u, const region * r, const region * r2) { connection *b; - curse *c; - static const curse_type *fogtrap_ct = NULL; if (r2 == NULL) return true; b = get_borders(r, r2); while (b) { - if (b->type->block && b->type->block(b, u, r)) + if (b->type->block && b->type->block(b, u, r)) { return true; + } b = b->next; } - if (fogtrap_ct == NULL) - fogtrap_ct = ct_find("fogtrap"); - c = get_curse(r->attribs, fogtrap_ct); - if (curse_active(c)) - return true; + if (r->attribs) { + const curse_type *fogtrap_ct = ct_find("fogtrap"); + curse *c = get_curse(r->attribs, fogtrap_ct); + return curse_active(c); + } return false; } @@ -1303,23 +1234,23 @@ static bool roadto(const region * r, direction_t dir) /* wenn es hier genug strassen gibt, und verbunden ist, und es dort * genug strassen gibt, dann existiert eine strasse in diese richtung */ region *r2; - static const curse_type *roads_ct = NULL; assert(r); assert(dir < MAXDIRECTIONS); if (!r || dir >= MAXDIRECTIONS || dir < 0) return false; r2 = rconnect(r, dir); - if (r == NULL || r2 == NULL) + if (!r2) { return false; - - if (roads_ct == NULL) - roads_ct = ct_find("magicstreet"); - if (roads_ct != NULL) { - if (get_curse(r->attribs, roads_ct) != NULL) - return true; - if (get_curse(r2->attribs, roads_ct) != NULL) - return true; + } + if (r->attribs || r2->attribs) { + const curse_type *roads_ct = ct_find("magicstreet"); + if (roads_ct != NULL) { + if (get_curse(r->attribs, roads_ct) != NULL) + return true; + if (get_curse(r2->attribs, roads_ct) != NULL) + return true; + } } if (r->terrain->max_road <= 0) @@ -1458,18 +1389,15 @@ static void make_route(unit * u, order * ord, region_list ** routep) static int movement_speed(unit * u) { int mp = BP_WALKING; - static const curse_type *speed_ct; - static bool init = false; - double dk = u_race(u)->speed; - + const race *rc = u_race(u); + double dk = rc->speed; assert(u->number); /* dragons have a fixed speed, and no other effects work on them: */ - switch (old_race(u_race(u))) { - case RC_DRAGON: - case RC_WYRM: - case RC_FIREDRAGON: + if (fval(rc, RCF_DRAGON)) { return BP_DRAGON; - case RC_BIRTHDAYDRAGON: + } + switch (old_race(u_race(u))) { + case RC_BIRTHDAYDRAGON: // FIXME: catdragon has RCF_DRAGON, so this cannot happen case RC_SONGDRAGON: mp = BP_DRAGON; break; @@ -1477,15 +1405,14 @@ static int movement_speed(unit * u) break; } - if (!init) { - init = true; - speed_ct = ct_find("speed"); - } - if (speed_ct) { - curse *c = get_curse(u->attribs, speed_ct); - if (c != NULL) { - int men = get_cursedmen(u, c); - dk *= 1.0 + (double)men / (double)u->number; + if (u->attribs) { + const curse_type *speed_ct = ct_find("speed"); + if (speed_ct) { + curse *c = get_curse(u->attribs, speed_ct); + if (c != NULL) { + int men = get_cursedmen(u, c); + dk *= 1.0 + (double)men / (double)u->number; + } } } @@ -1540,6 +1467,7 @@ static arg_regions *var_copy_regions(const region_list * begin, int size) assert(size > 0); arg_regions *dst = (arg_regions *)malloc(sizeof(arg_regions) + sizeof(region *) * (size_t)size); + assert_alloc(dst); dst->nregions = size; dst->regions = (region **)(dst + 1); for (rsrc = begin; i != size; rsrc = rsrc->next) { @@ -1687,7 +1615,7 @@ static const region_list *travel_route(unit * u, /* the unit has moved at least one region */ int walkmode; - setguard(u, GUARD_NONE); + setguard(u, false); cycle_route(ord, u, steps); if (mode == TRAVEL_RUNNING) { @@ -1715,7 +1643,7 @@ static const region_list *travel_route(unit * u, /* make orders for the followers */ } fset(u, UFL_LONGACTION | UFL_NOTMOVING); - setguard(u, GUARD_NONE); + setguard(u, false); assert(u->region == current); return iroute; } @@ -1786,7 +1714,7 @@ bool can_takeoff(const ship * sh, const region * from, const region * to) return true; } -static void sail(unit * u, order * ord, region_list ** routep) +static void sail(unit * u, order * ord, region_list ** routep, bool drifting) { region *starting_point = u->region; region *current_point, *last_point; @@ -1796,8 +1724,8 @@ static void sail(unit * u, order * ord, region_list ** routep) faction *f = u->faction; region *next_point = NULL; int error; - double damage_storm = config_get_flt("rules.ship.damage_storm", 0.02); - bool storms_enabled = config_get_int("rules.ship.storms", 1) != 0; + bool storms_enabled = drifting && (config_get_int("rules.ship.storms", 1) != 0); + double damage_storm = storms_enabled ? config_get_flt("rules.ship.damage_storm", 0.02) : 0.0; int lighthouse_div = config_get_int("rules.storm.lighthouse.divisor", 0); const char *token = getstrtoken(); @@ -2213,7 +2141,7 @@ static void travel(unit * u, region_list ** routep) sh = NULL; } if (sh) { - unit *guard = is_guarded(r, u, GUARD_LANDING); + unit *guard = is_guarded(r, u); if (guard) { ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "region_guarded", "guard", guard)); @@ -2273,7 +2201,8 @@ void move_cmd(unit * u, order * ord) assert(u->number); if (u->ship && u == ship_owner(u->ship)) { - sail(u, ord, &route); + bool drifting = (getkeyword(ord) == K_MOVE); + sail(u, ord, &route, drifting); } else { travel(u, &route); diff --git a/src/move.h b/src/move.h index 70dddbb0b..6363fe2f9 100644 --- a/src/move.h +++ b/src/move.h @@ -60,8 +60,6 @@ extern "C" { int personcapacity(const struct unit *u); void movement(void); void run_to(struct unit *u, struct region *to); - struct unit *is_guarded(struct region *r, struct unit *u, unsigned int mask); - bool is_guard(const struct unit *u, unsigned int mask); int enoughsailors(const struct ship *sh, int sumskill); bool canswim(struct unit *u); bool canfly(struct unit *u); diff --git a/src/move.test.c b/src/move.test.c index 2ce9cccda..bc93ec124 100644 --- a/src/move.test.c +++ b/src/move.test.c @@ -2,7 +2,6 @@ #include #include "move.h" -#include "guard.h" #include "keyword.h" #include @@ -201,30 +200,6 @@ static void test_walkingcapacity(CuTest *tc) { test_cleanup(); } -static void test_is_guarded(CuTest *tc) { - unit *u1, *u2; - region *r; - race *rc; - - test_cleanup(); - rc = rc_get_or_create("dragon"); - rc->flags |= RCF_UNARMEDGUARD; - r = test_create_region(0, 0, 0); - u1 = test_create_unit(test_create_faction(0), r); - u2 = test_create_unit(test_create_faction(rc), r); - CuAssertPtrEquals(tc, 0, is_guarded(r, u1, GUARD_TRAVELTHRU)); - CuAssertPtrEquals(tc, 0, is_guarded(r, u1, GUARD_PRODUCE)); - CuAssertPtrEquals(tc, 0, is_guarded(r, u1, GUARD_TREES)); - CuAssertPtrEquals(tc, 0, is_guarded(r, u1, GUARD_MINING)); - guard(u2, GUARD_MINING | GUARD_PRODUCE); - CuAssertIntEquals(tc, GUARD_CREWS | GUARD_LANDING | GUARD_TRAVELTHRU | GUARD_TAX | GUARD_PRODUCE | GUARD_RECRUIT, guard_flags(u2)); - CuAssertPtrEquals(tc, 0, is_guarded(r, u1, GUARD_TRAVELTHRU)); - CuAssertPtrEquals(tc, 0, is_guarded(r, u1, GUARD_TREES)); - CuAssertPtrEquals(tc, 0, is_guarded(r, u1, GUARD_MINING)); - CuAssertPtrEquals(tc, u2, is_guarded(r, u1, GUARD_PRODUCE)); - test_cleanup(); -} - static void test_ship_trails(CuTest *tc) { ship *sh; region *r1, *r2, *r3; @@ -298,10 +273,10 @@ void setup_drift (struct drift_fixture *fix) { fix->st_boat->cabins = 20000; fix->u = test_create_unit(fix->f = test_create_faction(0), fix->r=findregion(-1,0)); - assert(fix->r); + assert(fix->r && fix->u && fix->f); set_level(fix->u, SK_SAILING, fix->st_boat->sumskill); u_set_ship(fix->u, fix->sh = test_create_ship(fix->u->region, fix->st_boat)); - assert(fix->f && fix->u && fix->sh); + assert(fix->sh); } static void test_ship_no_overload(CuTest *tc) { @@ -526,7 +501,6 @@ CuSuite *get_move_suite(void) SUITE_ADD_TEST(suite, test_ship_has_harbormaster_contact); SUITE_ADD_TEST(suite, test_ship_has_harbormaster_ally); SUITE_ADD_TEST(suite, test_ship_has_harbormaster_same_faction); - SUITE_ADD_TEST(suite, test_is_guarded); SUITE_ADD_TEST(suite, test_ship_trails); SUITE_ADD_TEST(suite, test_age_trails); SUITE_ADD_TEST(suite, test_ship_no_overload); diff --git a/src/names.c b/src/names.c index f608764d8..99c21a05e 100644 --- a/src/names.c +++ b/src/names.c @@ -22,6 +22,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* kernel includes */ #include +#include #include #include #include @@ -31,8 +32,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* util includes */ #include #include -#include #include +#include #include #include @@ -44,108 +45,113 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -static const char *describe_braineater(unit * u, const struct locale *lang) +static const char *describe_race(const race * rc, const struct locale *lang) { - return LOC(lang, "describe_braineater"); + char zText[32]; + sprintf(zText, "describe_%s", rc->_name); + return locale_getstring(lang, zText); } -static const char *make_names(const char *monster, int *num_postfix, - int pprefix, int *num_name, int *num_prefix, int ppostfix) +static void count_particles(const char *monster, int *num_prefix, int *num_name, int *num_postfix) { - int uv, uu, un; - static char name[NAMESIZE + 1]; // FIXME: static return value char zText[32]; const char *str; - if (*num_prefix == 0) { - - for (*num_prefix = 0;; ++*num_prefix) { - sprintf(zText, "%s_prefix_%d", monster, *num_prefix); - str = locale_getstring(default_locale, zText); - if (str == NULL) - break; - } - - for (*num_name = 0;; ++*num_name) { - sprintf(zText, "%s_name_%d", monster, *num_name); - str = locale_getstring(default_locale, zText); - if (str == NULL) - break; - } - - for (*num_postfix = 0;; ++*num_postfix) { - sprintf(zText, "%s_postfix_%d", monster, *num_postfix); - str = locale_getstring(default_locale, zText); - if (str == NULL) - break; - } + for (*num_prefix = 0;; ++*num_prefix) { + sprintf(zText, "%s_prefix_%d", monster, *num_prefix); + str = locale_getstring(default_locale, zText); + if (str == NULL) + break; } + for (*num_name = 0;; ++*num_name) { + sprintf(zText, "%s_name_%d", monster, *num_name); + str = locale_getstring(default_locale, zText); + if (str == NULL) + break; + } + + for (*num_postfix = 0;; ++*num_postfix) { + sprintf(zText, "%s_postfix_%d", monster, *num_postfix); + str = locale_getstring(default_locale, zText); + if (str == NULL) + break; + } +} + +static void make_name(unit *u, const char *monster, int *num_postfix, + int pprefix, int *num_name, int *num_prefix, int ppostfix) +{ if (*num_name == 0) { - return NULL; + count_particles(monster, num_prefix, num_name, num_postfix); } + if (*num_name > 0) { + char name[NAMESIZE + 1]; + char zText[32]; + int uv = 0, uu = 0, un = 0; + const char *str; - /* nur 50% aller Namen haben "Vor-Teil" */ - uv = rng_int() % (*num_prefix * pprefix); - - uu = rng_int() % *num_name; - - /* nur 50% aller Namen haben "Nach-Teil", wenn kein Vor-Teil */ - if (*num_postfix > 0 && uv >= *num_prefix) { - un = rng_int() % *num_postfix; - } - else { - un = rng_int() % (*num_postfix * ppostfix); - } - - name[0] = 0; - if (uv < *num_prefix) { - sprintf(zText, "%s_prefix_%d", monster, uv); - str = locale_getstring(default_locale, zText); - if (str) { - size_t sz = strlcpy(name, (const char *)str, sizeof(name)); - strlcpy(name + sz, " ", sizeof(name) - sz); + if (*num_prefix > 0) { + uv = rng_int() % (*num_prefix * pprefix); } - } + uu = rng_int() % *num_name; - sprintf(zText, "%s_name_%d", monster, uu); - str = locale_getstring(default_locale, zText); - if (str) - strlcat(name, (const char *)str, sizeof(name)); + if (*num_postfix > 0 && uv >= *num_prefix) { + un = rng_int() % *num_postfix; + } + else { + un = rng_int() % (*num_postfix * ppostfix); + } - if (un < *num_postfix) { - sprintf(zText, "%s_postfix_%d", monster, un); + name[0] = 0; + if (uv < *num_prefix) { + sprintf(zText, "%s_prefix_%d", monster, uv); + str = locale_getstring(default_locale, zText); + if (str) { + size_t sz = strlcpy(name, (const char *)str, sizeof(name)); + strlcpy(name + sz, " ", sizeof(name) - sz); + } + } + + sprintf(zText, "%s_name_%d", monster, uu); str = locale_getstring(default_locale, zText); - if (str) { - strlcat(name, " ", sizeof(name)); + if (str) strlcat(name, (const char *)str, sizeof(name)); + + if (un < *num_postfix) { + sprintf(zText, "%s_postfix_%d", monster, un); + str = locale_getstring(default_locale, zText); + if (str) { + strlcat(name, " ", sizeof(name)); + strlcat(name, (const char *)str, sizeof(name)); + } } + unit_setname(u, name); } - return name; } -static const char *undead_name(const unit * u) +static void undead_name(unit * u) { static int num_postfix, num_name, num_prefix; - return make_names("undead", &num_postfix, 2, &num_name, &num_prefix, 2); + make_name(u, "undead", &num_postfix, 2, &num_name, &num_prefix, 2); } -static const char *skeleton_name(const unit * u) +static void skeleton_name(unit * u) { static int num_postfix, num_name, num_prefix; - return make_names("skeleton", &num_postfix, 5, &num_name, &num_prefix, 2); + make_name(u, "skeleton", &num_postfix, 5, &num_name, &num_prefix, 2); } -static const char *zombie_name(const unit * u) +static void zombie_name(unit * u) { static int num_postfix, num_name, num_prefix; - return make_names("zombie", &num_postfix, 5, &num_name, &num_prefix, 2); + make_name(u, "zombie", &num_postfix, 5, &num_name, &num_prefix, 2); } -static const char *ghoul_name(const unit * u) +static void ghoul_name(unit * u) { static int num_postfix, num_name, num_prefix; - return make_names("ghoul", &num_postfix, 5, &num_name, &num_prefix, 4); + make_name(u, "ghoul", &num_postfix, 5, &num_name, &num_prefix, 4); } /* Drachen */ @@ -213,21 +219,24 @@ const char *silbe3[SIL3] = { "bus", }; -static const char *generic_name(const unit * u) +static void generic_name(unit * u) { const char * name = rc_name_s(u_race(u), (u->number == 1) ? NAME_SINGULAR : NAME_PLURAL); - return LOC(u->faction->locale, name); + name = LOC(u->faction->locale, name); + if (name) { + unit_setname(u, name); + } } -static const char *dragon_name(const unit * u) +static void dragon_name(unit * u) { - static char name[NAMESIZE + 1]; // FIXME: static return value + char name[NAMESIZE + 1]; int rnd, ter = 0; - int anzahl = 1; static int num_postfix; char zText[32]; const char *str; + assert(u); if (num_postfix == 0) { for (num_postfix = 0;; ++num_postfix) { sprintf(zText, "dragon_postfix_%d", num_postfix); @@ -239,30 +248,26 @@ static const char *dragon_name(const unit * u) num_postfix = -1; } - if (u) { - region *r = u->region; - anzahl = u->number; - switch (rterrain(r)) { - case T_PLAIN: - ter = 1; - break; - case T_MOUNTAIN: - ter = 2; - break; - case T_DESERT: - ter = 3; - break; - case T_SWAMP: - ter = 4; - break; - case T_GLACIER: - ter = 5; - break; - } + switch (rterrain(u->region)) { + case T_PLAIN: + ter = 1; + break; + case T_MOUNTAIN: + ter = 2; + break; + case T_DESERT: + ter = 3; + break; + case T_SWAMP: + ter = 4; + break; + case T_GLACIER: + ter = 5; + break; } if (num_postfix <=0) { - return NULL; + return; } else if (num_postfix < 6) { rnd = rng_int() % num_postfix; @@ -276,7 +281,7 @@ static const char *dragon_name(const unit * u) str = locale_getstring(default_locale, zText); assert(str != NULL); - if (anzahl > 1) { + if (u->number > 1) { const char *no_article = strchr((const char *)str, ' '); assert(no_article); // TODO: localization @@ -299,13 +304,13 @@ static const char *dragon_name(const unit * u) sz += strlcat(name, " ", sizeof(name)); sz += strlcat(name, n, sizeof(name)); } - if (u && (rng_int() % 3 == 0)) { + if (rng_int() % 3 == 0) { sz += strlcat(name, " von ", sizeof(name)); sz += strlcat(name, (const char *)rname(u->region, default_locale), sizeof(name)); } } - return name; + unit_setname(u, name); } /* Dracoide */ @@ -357,9 +362,9 @@ static const char *drac_suf[DRAC_SUF] = { "k" }; -static const char *dracoid_name(const unit * u) +static void dracoid_name(unit * u) { - static char name[NAMESIZE + 1]; // FIXME: static return value + static char name[NAMESIZE + 1]; int mid_syllabels; size_t sz; @@ -377,7 +382,7 @@ static const char *dracoid_name(const unit * u) sz += strlcat(name, drac_mid[rng_int() % DRAC_MID], sizeof(name)); } sz += strlcat(name, drac_suf[rng_int() % DRAC_SUF], sizeof(name)); - return name; + unit_setname(u, name); } /** returns an abbreviation of a string. @@ -473,15 +478,15 @@ const char *abkz(const char *s, char *buf, size_t buflen, size_t maxchars) void register_names(void) { - register_function((pf_generic)describe_braineater, "describe_braineater"); + register_race_description_function(describe_race, "describe_race"); /* function name * generate a name for a nonplayerunit * race->generate_name() */ - register_function((pf_generic)undead_name, "nameundead"); - register_function((pf_generic)skeleton_name, "nameskeleton"); - register_function((pf_generic)zombie_name, "namezombie"); - register_function((pf_generic)ghoul_name, "nameghoul"); - register_function((pf_generic)dragon_name, "namedragon"); - register_function((pf_generic)dracoid_name, "namedracoid"); - register_function((pf_generic)generic_name, "namegeneric"); + register_race_name_function(undead_name, "nameundead"); + register_race_name_function(skeleton_name, "nameskeleton"); + register_race_name_function(zombie_name, "namezombie"); + register_race_name_function(ghoul_name, "nameghoul"); + register_race_name_function(dracoid_name, "namedracoid"); + register_race_name_function(dragon_name, "namedragon"); + register_race_name_function(generic_name, "namegeneric"); } diff --git a/src/names.h b/src/names.h index 17bb9a0e9..d7ab417c1 100644 --- a/src/names.h +++ b/src/names.h @@ -18,10 +18,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef H_KRNL_NAMES #define H_KRNL_NAMES + +#include + #ifdef __cplusplus extern "C" { #endif - extern void register_names(void); + + struct unit; + void register_names(void); const char *abkz(const char *s, char *buf, size_t size, size_t maxchars); #ifdef __cplusplus diff --git a/src/names.test.c b/src/names.test.c new file mode 100644 index 000000000..f50937f17 --- /dev/null +++ b/src/names.test.c @@ -0,0 +1,44 @@ +#include + +#include "names.h" + +#include +#include +#include +#include + +#include +#include "tests.h" + +static void test_names(CuTest * tc) +{ + race_name_func foo; + unit *u; + race *rc; + test_cleanup(); + register_names(); + default_locale = test_create_locale(); + u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); + rc = test_create_race("undead"); + locale_setstring(default_locale, "undead_name_0", "Graue"); + locale_setstring(default_locale, "undead_postfix_0", "Kobolde"); + CuAssertPtrNotNull(tc, foo = (race_name_func)get_function("nameundead")); + rc->generate_name = foo; + race_namegen(rc, u); + CuAssertStrEquals(tc, "Graue Kobolde", u->_name); + CuAssertPtrNotNull(tc, get_function("nameskeleton")); + CuAssertPtrNotNull(tc, get_function("namezombie")); + CuAssertPtrNotNull(tc, get_function("nameghoul")); + CuAssertPtrNotNull(tc, get_function("namedragon")); + CuAssertPtrNotNull(tc, get_function("namedracoid")); + CuAssertPtrNotNull(tc, get_function("namegeneric")); + CuAssertPtrNotNull(tc, get_function("describe_race")); + test_cleanup(); +} + +CuSuite *get_names_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_names); + return suite; +} diff --git a/src/piracy.c b/src/piracy.c index 8af0b899e..b2f96c596 100644 --- a/src/piracy.c +++ b/src/piracy.c @@ -209,6 +209,7 @@ void piracy_cmd(unit * u) /* Bewegung ausführen */ init_order(ord); move_cmd(u, ord); + free_order(ord); } void age_piracy(region *r) { diff --git a/src/piracy.test.c b/src/piracy.test.c index affb6f5c4..82e4e55b7 100644 --- a/src/piracy.test.c +++ b/src/piracy.test.c @@ -83,12 +83,12 @@ static void test_piracy_cmd(CuTest * tc) { t_ocean = get_or_create_terrain("ocean"); st_boat = st_get_or_create("boat"); u2 = test_create_unit(test_create_faction(0), test_create_region(1, 0, t_ocean)); - u_set_ship(u2, test_create_ship(u2->region, st_boat)); assert(u2); + u_set_ship(u2, test_create_ship(u2->region, st_boat)); u = test_create_unit(f = test_create_faction(0), r = test_create_region(0, 0, t_ocean)); + assert(f && u); set_level(u, SK_SAILING, st_boat->sumskill); u_set_ship(u, test_create_ship(u->region, st_boat)); - assert(f && u); f->locale = get_or_create_locale("de"); u->thisorder = create_order(K_PIRACY, f->locale, "%s", itoa36(u2->faction->no)); diff --git a/src/platform.h b/src/platform.h index 77a767875..c781021ae 100644 --- a/src/platform.h +++ b/src/platform.h @@ -16,16 +16,34 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ -#ifndef CONFIG_H -#define CONFIG_H +#ifndef PLATFORM_H +#define PLATFORM_H #ifdef NDEBUG #define LOMEM #endif +// enable X/Open 7 extensions (like strdup): +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 700 +#endif + +// enable bsd string extensions, since glibc 2.12 (_BSD_SOURCE is dead): +#ifndef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809L +#endif + +#ifndef USE_AUTOCONF +#define USE_AUTOCONF + #ifdef _MSC_VER -# define VC_EXTRALEAN -# define WIN32_LEAN_AND_MEAN +#undef USE_AUTOCONF +#define HAVE_STDBOOL_H +#define HAVE_DIRECT__MKDIR +#define HAVE__ACCESS + +#define VC_EXTRALEAN +#define WIN32_LEAN_AND_MEAN #pragma warning(push) #pragma warning(disable:4820 4255 4668) # include @@ -60,7 +78,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* warning C4100: was declared deprecated */ #ifndef _CRT_SECURE_NO_DEPRECATE -# define _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE #endif /* @@ -69,50 +87,30 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * single-threaded I/O model and use the _nolock forms of the functions. */ #ifndef _CRT_DISABLE_PERFCRIT_LOCKS -# define _CRT_DISABLE_PERFCRIT_LOCKS +#define _CRT_DISABLE_PERFCRIT_LOCKS #endif -/* define CRTDBG to enable MSVC CRT Debug library functions */ -#if defined(_DEBUG) && defined(CRTDBG) -# include -# define _CRTDBG_MAP_ALLOC +#elif __GNUC__ +#undef USE_AUTOCONF +#define HAVE_SNPRINTF +#define HAVE_SYS_STAT_MKDIR +#define HAVE_STRDUP +#define HAVE_UNISTD_H +#endif #endif -#endif /* _MSC_VER_ */ - -#if defined __GNUC__ -# undef _BSD_SOURCE -# define _BSD_SOURCE -# undef __USE_BSD -# define __USE_BSD -#endif - -#ifdef _BSD_SOURCE -# undef __EXTENSIONS__ -# define __EXTENSIONS__ -#endif - -#ifdef SOLARIS -# define _SYS_PROCSET_H -#undef _XOPEN_SOURCE -# define _XOPEN_SOURCE +#ifdef USE_AUTOCONF +// unknown toolchain, using autoconf +#include #endif #define unused_arg (void) -#ifndef INLINE_FUNCTION -# define INLINE_FUNCTION -#endif - #define iswxspace(c) (c==160 || iswspace(c)) #define isxspace(c) (c==160 || isspace(c)) #define TOLUA_CAST (char*) -#ifdef USE_AUTOCONF -# include -#endif - #if !defined(MAX_PATH) #if defined(PATH_MAX) # define MAX_PATH PATH_MAX @@ -125,8 +123,56 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif -#ifdef HAVE_STRINGS_H -#include +#if defined(HAVE_STDBOOL_H) +# include +#else +# ifndef HAVE__BOOL +# ifdef __cplusplus +typedef bool _Bool; +# else +typedef unsigned char _Bool; +# endif +# endif +# define bool _Bool +# define false 0 +# define true 1 +# define __bool_true_false_are_defined 1 +#endif + +#ifndef HAVE__ACCESS +#ifdef HAVE_ACCESS +#define _access(path, mode) access(path, mode) +#endif +#endif + +#if defined(HAVE_DIRECT__MKDIR) +#include +#elif defined(HAVE_DIRECT_MKDIR) +#include +#define _mkdir(a) mkdir(a) +#elif defined(HAVE_SYS_STAT_MKDIR) +#include +#define _mkdir(a) mkdir(a, 0777) +#endif + +#ifndef _min +#define _min(a,b) ((a) < (b) ? (a) : (b)) +#endif +#ifndef _max +#define _max(a,b) ((a) > (b) ? (a) : (b)) +#endif + +#if !defined(HAVE__STRDUP) +#if defined(HAVE_STRDUP) +#undef _strdup +#define _strdup strdup +#endif +#endif + +#if !defined(HAVE__SNPRINTF) +#if defined(HAVE_SNPRINTF) +#define _snprintf snprintf +#endif #endif #endif diff --git a/src/prefix.c b/src/prefix.c index b6adb7c02..a6564b6e8 100644 --- a/src/prefix.c +++ b/src/prefix.c @@ -1,6 +1,8 @@ #include #include "prefix.h" +#include + #include #include #include @@ -10,7 +12,7 @@ char **race_prefixes = NULL; static size_t size = 4; static unsigned int next = 0; -void add_raceprefix(const char *prefix) +int add_raceprefix(const char *prefix) { assert(prefix); if (race_prefixes == NULL) { @@ -19,11 +21,18 @@ void add_raceprefix(const char *prefix) race_prefixes = malloc(size * sizeof(char *)); } if (next + 1 == size) { + char **tmp; + tmp = realloc(race_prefixes, 2 * size * sizeof(char *)); + if (!tmp) { + log_fatal("allocation failure"); + return 1; + } + race_prefixes = tmp; size *= 2; - race_prefixes = realloc(race_prefixes, size * sizeof(char *)); } race_prefixes[next++] = _strdup(prefix); race_prefixes[next] = NULL; + return 0; } void free_prefixes(void) { diff --git a/src/prefix.h b/src/prefix.h index 9c5b84907..aa04e505b 100644 --- a/src/prefix.h +++ b/src/prefix.h @@ -7,7 +7,7 @@ extern "C" { #endif - void add_raceprefix(const char *); + int add_raceprefix(const char *); char **race_prefixes; // zero-terminated array of valid prefixes void free_prefixes(void); diff --git a/src/prefix.test.c b/src/prefix.test.c index 44c0d845d..a914426fa 100644 --- a/src/prefix.test.c +++ b/src/prefix.test.c @@ -6,13 +6,13 @@ #include static void test_add_prefix(CuTest *tc) { - test_cleanup(); + test_setup(); CuAssertPtrEquals(tc, 0, race_prefixes); - add_raceprefix("sea"); + CuAssertIntEquals(tc, 0, add_raceprefix("sea")); CuAssertPtrNotNull(tc, race_prefixes); CuAssertStrEquals(tc, "sea", race_prefixes[0]); CuAssertPtrEquals(tc, 0, race_prefixes[1]); - add_raceprefix("moon"); + CuAssertIntEquals(tc, 0, add_raceprefix("moon")); CuAssertStrEquals(tc, "sea", race_prefixes[0]); CuAssertStrEquals(tc, "moon", race_prefixes[1]); CuAssertPtrEquals(tc, 0, race_prefixes[2]); @@ -26,4 +26,4 @@ CuSuite *get_prefix_suite(void) CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_add_prefix); return suite; -} \ No newline at end of file +} diff --git a/src/process.pkg b/src/process.pkg index 5db5c7344..a81917293 100755 --- a/src/process.pkg +++ b/src/process.pkg @@ -25,7 +25,6 @@ module eressea { void process_leave @ leave(void); /* LEAVE */ void process_maintenance @ maintenance(void); /* PAY */ void process_promote @ promote(void); /* PROMOTE */ - void process_renumber @ renumber(void); /* RENUMBER */ void process_restack @ restack(void); /* SORT */ void process_setspells @ set_spells(void); /* COMBATSPELL */ void process_sethelp @ set_help(void); /* HELP */ diff --git a/src/process.pkg.c b/src/process.pkg.c index 787258a96..42dff20ff 100644 --- a/src/process.pkg.c +++ b/src/process.pkg.c @@ -531,30 +531,6 @@ static int tolua_process_eressea_process_promote00(lua_State* tolua_S) #endif } -/* function: process_renumber */ -static int tolua_process_eressea_process_renumber00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isnoobj(tolua_S,1,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - { - process_renumber(); - } - } - return 0; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'renumber'.",&tolua_err); - return 0; -#endif -} - /* function: process_restack */ static int tolua_process_eressea_process_restack00(lua_State* tolua_S) { @@ -1021,7 +997,6 @@ LUALIB_API int luaopen_process (lua_State* tolua_S) tolua_function(tolua_S,"leave",tolua_process_eressea_process_leave00); tolua_function(tolua_S,"maintenance",tolua_process_eressea_process_maintenance00); tolua_function(tolua_S,"promote",tolua_process_eressea_process_promote00); - tolua_function(tolua_S,"renumber",tolua_process_eressea_process_renumber00); tolua_function(tolua_S,"restack",tolua_process_eressea_process_restack00); tolua_function(tolua_S,"set_spells",tolua_process_eressea_process_set_spells00); tolua_function(tolua_S,"set_help",tolua_process_eressea_process_set_help00); diff --git a/src/races/dragons.c b/src/races/dragons.c index 828e68c64..222d63c89 100644 --- a/src/races/dragons.c +++ b/src/races/dragons.c @@ -13,7 +13,6 @@ */ #include -#include /* kernel includes */ #include diff --git a/src/races/illusion.c b/src/races/illusion.c index e2a05cfd3..7411ae4d5 100644 --- a/src/races/illusion.c +++ b/src/races/illusion.c @@ -11,7 +11,6 @@ */ #include -#include /* kernel includes */ #include diff --git a/src/races/races.c b/src/races/races.c index 38d69ac3e..2c6cfffa9 100644 --- a/src/races/races.c +++ b/src/races/races.c @@ -9,7 +9,6 @@ */ #include -#include #include "races.h" #include @@ -84,9 +83,6 @@ static void equip_newunits(const struct equipment *eq, struct unit *u) u_set_ship(u, sh); } break; - case RC_CENTAUR: - rsethorses(r, 250 + rng_int() % 51 + rng_int() % 51); - break; default: break; } diff --git a/src/races/races.h b/src/races/races.h index c0a516430..ea7be1337 100644 --- a/src/races/races.h +++ b/src/races/races.h @@ -14,6 +14,7 @@ #ifdef __cplusplus extern "C" { #endif + struct unit; void register_races(void); void make_undead_unit(struct unit *); diff --git a/src/races/zombies.c b/src/races/zombies.c index d86074d26..d7f871dac 100644 --- a/src/races/zombies.c +++ b/src/races/zombies.c @@ -13,7 +13,6 @@ */ #include -#include /* kernel includes */ #include @@ -40,7 +39,7 @@ void make_undead_unit(unit * u) { free_orders(&u->orders); name_unit(u); - fset(u, UFL_ISNEW); + u->flags |= UFL_ISNEW; } void age_undead(unit * u) diff --git a/src/randenc.c b/src/randenc.c index 6a642557b..a3c5ce303 100644 --- a/src/randenc.c +++ b/src/randenc.c @@ -20,10 +20,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "randenc.h" +#include "volcano.h" #include "economy.h" #include "monster.h" #include "move.h" -#include "alchemy.h" #include "chaos.h" #include "study.h" @@ -67,10 +67,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include extern struct attrib_type at_unitdissolve; -extern struct attrib_type at_orcification; /* In a->data.ca[1] steht der Prozentsatz mit dem sich die Einheit - * auflöst, in a->data.ca[0] kann angegeben werden, wohin die Personen + * aufl�st, in a->data.ca[0] kann angegeben werden, wohin die Personen * verschwinden. Passiert bereits in der ersten Runde! */ static void dissolve_units(void) { @@ -412,118 +411,6 @@ void encounters(void) } } -static int nb_armor(const unit * u, int index) -{ - const item *itm; - int av = 0; - int s = 0, a = 0; - - if (!(u_race(u)->battle_flags & BF_EQUIPMENT)) - return 0; - - /* Normale Rüstung */ - - for (itm = u->items; itm; itm = itm->next) { - const armor_type *atype = itm->type->rtype->atype; - if (atype != NULL) { - int *schutz = &a; - if (atype->flags & ATF_SHIELD) - schutz = &s; - if (*schutz <= index) { - *schutz += itm->number; - if (*schutz > index) { - av += atype->prot; - } - } - } - } - return av; -} - -static int -damage_unit(unit * u, const char *dam, bool physical, bool magic) -{ - int *hp, hpstack[20]; - int h; - int i, dead = 0, hp_rem = 0, heiltrank; - double magres = magic_resistance(u); - - assert(u->number); - if (fval(u_race(u), RCF_ILLUSIONARY) || u_race(u) == get_race(RC_SPELL)) { - return 0; - } - - assert(u->number <= u->hp); - h = u->hp / u->number; - /* HP verteilen */ - if (u->number < 20) { - hp = hpstack; - } - else { - hp = malloc(u->number * sizeof(int)); - } - for (i = 0; i < u->number; i++) - hp[i] = h; - h = u->hp - (u->number * h); - for (i = 0; i < h; i++) - hp[i]++; - - /* Schaden */ - for (i = 0; i < u->number; i++) { - int damage = dice_rand(dam); - if (magic) - damage = (int)(damage * (1.0 - magres)); - if (physical) - damage -= nb_armor(u, i); - hp[i] -= damage; - } - - /* Auswirkungen */ - for (i = 0; i < u->number; i++) { - if (hp[i] <= 0) { - heiltrank = 0; - - /* Sieben Leben */ - if (old_race(u_race(u)) == RC_CAT && (chance(1.0 / 7))) { - hp[i] = u->hp / u->number; - hp_rem += hp[i]; - continue; - } - - /* Heiltrank */ - if (oldpotiontype[P_HEAL]) { - if (get_effect(u, oldpotiontype[P_HEAL]) > 0) { - change_effect(u, oldpotiontype[P_HEAL], -1); - heiltrank = 1; - } - else if (i_get(u->items, oldpotiontype[P_HEAL]->itype) > 0) { - i_change(&u->items, oldpotiontype[P_HEAL]->itype, -1); - change_effect(u, oldpotiontype[P_HEAL], 3); - heiltrank = 1; - } - if (heiltrank && (chance(0.50))) { - hp[i] = u->hp / u->number; - hp_rem += hp[i]; - continue; - } - } - dead++; - } - else { - hp_rem += hp[i]; - } - } - - scale_number(u, u->number - dead); - u->hp = hp_rem; - - if (hp != hpstack) { - free(hp); - } - - return dead; -} - void drown(region * r) { if (fval(r->terrain, SEA_REGION)) { @@ -542,106 +429,6 @@ void drown(region * r) } } -region *rrandneighbour(region * r) -{ - direction_t i; - region *rc = NULL; - int rr, c = 0; - - /* Nachsehen, wieviele Regionen in Frage kommen */ - - for (i = 0; i != MAXDIRECTIONS; i++) { - c++; - } - /* Zufällig eine auswählen */ - - rr = rng_int() % c; - - /* Durchzählen */ - - c = -1; - for (i = 0; i != MAXDIRECTIONS; i++) { - rc = rconnect(r, i); - c++; - if (c == rr) - break; - } - assert(i != MAXDIRECTIONS); - return rc; -} - -static void -volcano_destruction(region * volcano, region * r, const char *damage) -{ - attrib *a; - unit **up; - int percent = 25, time = 6 + rng_int() % 12; - - rsettrees(r, 2, 0); - rsettrees(r, 1, 0); - rsettrees(r, 0, 0); - - a = a_find(r->attribs, &at_reduceproduction); - if (!a) { - a = a_add(&r->attribs, make_reduceproduction(percent, time)); - } - else { - /* Produktion vierteln ... */ - a->data.sa[0] = (short)percent; - /* Für 6-17 Runden */ - a->data.sa[1] = (short)(a->data.sa[1] + time); - } - - /* Personen bekommen 4W10 Punkte Schaden. */ - - for (up = &r->units; *up;) { - unit *u = *up; - if (u->number) { - int dead = damage_unit(u, damage, true, false); - /* TODO create undead */ - if (dead) { - ADDMSG(&u->faction->msgs, msg_message("volcano_dead", - "unit region dead", u, volcano, dead)); - } - if (!fval(u->faction, FFL_SELECT)) { - fset(u->faction, FFL_SELECT); - ADDMSG(&u->faction->msgs, msg_message("volcanooutbreaknn", - "region", r)); - } - } - if (u == *up) { - up = &u->next; - } - } - - if (r != volcano) { - ADDMSG(&r->msgs, msg_message("volcanooutbreak", - "regionv regionn", volcano, r)); - } - remove_empty_units_in_region(r); -} - -void volcano_outbreak(region * r) -{ - region *rn; - unit *u; - faction *f; - - for (f = NULL, u = r->units; u; u = u->next) { - if (f != u->faction) { - f = u->faction; - freset(f, FFL_SELECT); - } - } - - /* Zufällige Nachbarregion verwüsten */ - rn = rrandneighbour(r); - volcano_destruction(r, r, "4d10"); - if (rn) { - volcano_destruction(r, rn, "3d10"); - } -} - static void melt_iceberg(region * r) { attrib *a; @@ -655,12 +442,12 @@ static void melt_iceberg(region * r) ADDMSG(&u->faction->msgs, msg_message("iceberg_melt", "region", r)); } - /* driftrichtung löschen */ + /* driftrichtung l�schen */ a = a_find(r->attribs, &at_iceberg); if (a) a_remove(&r->attribs, a); - /* Gebäude löschen */ + /* Geb�ude l�schen */ while (r->buildings) { remove_building(&r->buildings, r->buildings); } @@ -668,7 +455,7 @@ static void melt_iceberg(region * r) /* in Ozean wandeln */ terraform_region(r, newterrain(T_OCEAN)); - /* Einheiten, die nicht schwimmen können oder in Schiffen sind, + /* Einheiten, die nicht schwimmen k�nnen oder in Schiffen sind, * ertrinken */ drown(r); } @@ -732,13 +519,13 @@ static void move_iceberg(region * r) freset(sh, SF_SELECT); for (sh = r->ships; sh; sh = sh->next) { - /* Meldung an Kapitän */ + /* Meldung an Kapit�n */ double dmg = config_get_flt("rules.ship.damage.intoiceberg", 0.1); damage_ship(sh, dmg); fset(sh, SF_SELECT); } - /* Personen, Schiffe und Gebäude verschieben */ + /* Personen, Schiffe und Geb�ude verschieben */ while (rc->buildings) { rc->buildings->region = r; translist(&rc->buildings, &r->buildings, rc->buildings); @@ -757,7 +544,7 @@ static void move_iceberg(region * r) u_set_building(u, b); /* undo leave-prevention */ } - /* Beschädigte Schiffe können sinken */ + /* Besch�digte Schiffe k�nnen sinken */ for (sh = r->ships; sh;) { shn = sh->next; @@ -894,7 +681,7 @@ static void godcurse(void) } /** handles the "orcish" curse that makes units grow like old orks - * This would probably be better handled in an age-function for the curse, + * TODO: This would probably be better handled in an age-function for the curse, * but it's now being called by randomevents() */ static void orc_growth(void) @@ -903,54 +690,56 @@ static void orc_growth(void) for (r = regions; r; r = r->next) { unit *u; for (u = r->units; u; u = u->next) { - static bool init = false; - static const curse_type *ct_orcish = 0; - curse *c = 0; - if (!init) { - init = true; - ct_orcish = ct_find("orcish"); - } - if (ct_orcish) - c = get_curse(u->attribs, ct_orcish); - - if (c && !has_skill(u, SK_MAGIC) && !has_skill(u, SK_ALCHEMY) + if (u->attribs && !has_skill(u, SK_MAGIC) && !has_skill(u, SK_ALCHEMY) && !fval(u, UFL_HERO)) { - int n; - int increase = 0; - int num = get_cursedmen(u, c); - double prob = curse_geteffect(c); - const item_type * it_chastity = it_find("ao_chastity"); + const curse_type *ct_orcish = ct_find("orcish"); - if (it_chastity) { - num -= i_get(u->items, it_chastity); - } - for (n = num; n > 0; n--) { - if (chance(prob)) { - ++increase; + if (ct_orcish) { + curse *c = get_curse(u->attribs, ct_orcish); + if (c) { + int n; + int increase = 0; + int num = get_cursedmen(u, c); + double prob = curse_geteffect(c); + const item_type * it_chastity = it_find("ao_chastity"); + + if (it_chastity) { + num -= i_get(u->items, it_chastity); + } + for (n = num; n > 0; n--) { + if (chance(prob)) { + ++increase; + } + } + if (increase) { + unit *u2 = create_unit(r, u->faction, increase, u_race(u), 0, NULL, u); + transfermen(u2, u, u2->number); + + ADDMSG(&u->faction->msgs, msg_message("orcgrowth", + "unit amount race", u, increase, u_race(u))); + } } } - if (increase) { - unit *u2 = create_unit(r, u->faction, increase, u_race(u), 0, NULL, u); - transfermen(u2, u, u2->number); - - ADDMSG(&u->faction->msgs, msg_message("orcgrowth", - "unit amount race", u, increase, u_race(u))); - } } } } } -/** Talente von Dämonen verschieben sich. +/** Talente von D�monen verschieben sich. */ static void demon_skillchanges(void) { region *r; + static const race *rc_demon; + static int rc_cache; + if (rc_changed(&rc_cache)) { + rc_demon = get_race(RC_DAEMON); + } for (r = regions; r; r = r->next) { unit *u; for (u = r->units; u; u = u->next) { - if (u_race(u) == get_race(RC_DAEMON)) { + if (u_race(u) == rc_demon) { demon_skillchange(u); } } @@ -971,7 +760,7 @@ static void icebergs(void) } #define HERBS_ROT /* herbs owned by units have a chance to rot. */ -#define HERBROTCHANCE 5 /* Verrottchance für Kräuter (ifdef HERBS_ROT) */ +#define HERBROTCHANCE 5 /* Verrottchance f�r Kr�uter (ifdef HERBS_ROT) */ #ifdef HERBS_ROT static void rotting_herbs(void) { @@ -1017,70 +806,7 @@ void randomevents(void) godcurse(); orc_growth(); demon_skillchanges(); - - /* Orkifizierte Regionen mutieren und mutieren zurück */ - - for (r = regions; r; r = r->next) { - if (fval(r, RF_ORCIFIED)) { - direction_t dir; - double probability = 0.0; - for (dir = 0; dir < MAXDIRECTIONS; dir++) { - region *rc = rconnect(r, dir); - if (rc && rpeasants(rc) > 0 && !fval(rc, RF_ORCIFIED)) - probability += 0.02; - } - if (chance(probability)) { - ADDMSG(&r->msgs, msg_message("deorcified", "region", r)); - freset(r, RF_ORCIFIED); - } - } - else { - attrib *a = a_find(r->attribs, &at_orcification); - if (a != NULL) { - double probability = 0.0; - if (rpeasants(r) <= 0) - continue; - probability = a->data.i / (double)rpeasants(r); - if (chance(probability)) { - fset(r, RF_ORCIFIED); - a_remove(&r->attribs, a); - ADDMSG(&r->msgs, msg_message("orcified", "region", r)); - } - else { - a->data.i -= _max(10, a->data.i / 10); - if (a->data.i <= 0) - a_remove(&r->attribs, a); - } - } - } - } - - /* Vulkane qualmen, brechen aus ... */ - for (r = regions; r; r = r->next) { - if (r->terrain == newterrain(T_VOLCANO_SMOKING)) { - if (a_find(r->attribs, &at_reduceproduction)) { - ADDMSG(&r->msgs, msg_message("volcanostopsmoke", "region", r)); - rsetterrain(r, T_VOLCANO); - } - else { - if (rng_int() % 100 < 12) { - ADDMSG(&r->msgs, msg_message("volcanostopsmoke", "region", r)); - rsetterrain(r, T_VOLCANO); - } - else if (r->age > 20 && rng_int() % 100 < 8) { - volcano_outbreak(r); - rsetterrain(r, T_VOLCANO); - } - } - } - else if (r->terrain == newterrain(T_VOLCANO)) { - if (rng_int() % 100 < 4) { - ADDMSG(&r->msgs, msg_message("volcanostartsmoke", "region", r)); - rsetterrain(r, T_VOLCANO_SMOKING); - } - } - } - + volcano_update(); /* Monumente zerfallen, Schiffe verfaulen */ for (r = regions; r; r = r->next) { diff --git a/src/renumber.c b/src/renumber.c new file mode 100644 index 000000000..de2b5a490 --- /dev/null +++ b/src/renumber.c @@ -0,0 +1,191 @@ +#include +#include "renumber.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +static attrib_type at_number = { + "faction_renum", + NULL, NULL, NULL, NULL, NULL, NULL, + ATF_UNIQUE +}; + +void renumber_factions(void) +/* gibt parteien neue nummern */ +{ + struct renum { + struct renum *next; + int want; + faction *faction; + attrib *attrib; + } *renum = NULL, *rp; + faction *f; + for (f = factions; f; f = f->next) { + attrib *a = a_find(f->attribs, &at_number); + int want; + struct renum **rn; + + if (!a) + continue; + want = a->data.i; + if (fval(f, FFL_NEWID)) { + ADDMSG(&f->msgs, msg_message("renumber_twice", "id", want)); + continue; + } + if (!faction_id_is_unused(want)) { + a_remove(&f->attribs, a); + ADDMSG(&f->msgs, msg_message("renumber_inuse", "id", want)); + continue; + } + for (rn = &renum; *rn; rn = &(*rn)->next) { + if ((*rn)->want >= want) + break; + } + if (*rn && (*rn)->want == want) { + ADDMSG(&f->msgs, msg_message("renumber_inuse", "id", want)); + } + else { + struct renum *r = calloc(sizeof(struct renum), 1); + r->next = *rn; + r->attrib = a; + r->faction = f; + r->want = want; + *rn = r; + } + } + for (rp = renum; rp; rp = rp->next) { + f = rp->faction; + a_remove(&f->attribs, rp->attrib); + renumber_faction(f, rp->want); + } + while (renum) { + rp = renum->next; + free(renum); + renum = rp; + } +} + +int renumber_cmd(unit * u, order * ord) +{ + char token[128]; + const char *s; + int i = 0; + faction *f = u->faction; + + init_order(ord); + s = gettoken(token, sizeof(token)); + switch (findparam_ex(s, u->faction->locale)) { + + case P_FACTION: + s = gettoken(token, sizeof(token)); + if (s && *s) { + int id = atoi36((const char *)s); + attrib *a = a_find(f->attribs, &at_number); + if (!a) + a = a_add(&f->attribs, a_new(&at_number)); + a->data.i = id; + } + break; + + case P_UNIT: + s = gettoken(token, sizeof(token)); + if (s && *s) { + i = atoi36((const char *)s); + if (i <= 0 || i > MAX_UNIT_NR) { + cmistake(u, ord, 114, MSG_EVENT); + break; + } + + if (forbiddenid(i)) { + cmistake(u, ord, 116, MSG_EVENT); + break; + } + + if (findunitg(i, u->region)) { + cmistake(u, ord, 115, MSG_EVENT); + break; + } + } + renumber_unit(u, i); + break; + + case P_SHIP: + if (!u->ship) { + cmistake(u, ord, 144, MSG_EVENT); + break; + } + if (ship_owner(u->ship) != u) { + cmistake(u, ord, 146, MSG_EVENT); + break; + } + if (u->ship->coast != NODIRECTION) { + cmistake(u, ord, 116, MSG_EVENT); + break; + } + s = gettoken(token, sizeof(token)); + if (s == NULL || *s == 0) { + i = newcontainerid(); + } + else { + i = atoi36((const char *)s); + if (i <= 0 || i > MAX_CONTAINER_NR) { + cmistake(u, ord, 114, MSG_EVENT); + break; + } + if (findship(i)) { + cmistake(u, ord, 115, MSG_EVENT); + break; + } + } + sunhash(u->ship); + u->ship->no = i; + shash(u->ship); + break; + case P_BUILDING: + case P_GEBAEUDE: + if (!u->building) { + cmistake(u, ord, 145, MSG_EVENT); + break; + } + if (building_owner(u->building) != u) { + cmistake(u, ord, 148, MSG_EVENT); + break; + } + s = gettoken(token, sizeof(token)); + if (*s == 0) { + i = newcontainerid(); + } + else { + i = atoi36((const char *)s); + if (i <= 0 || i > MAX_CONTAINER_NR) { + cmistake(u, ord, 114, MSG_EVENT); + break; + } + if (findbuilding(i)) { + cmistake(u, ord, 115, MSG_EVENT); + break; + } + } + bunhash(u->building); + u->building->no = i; + bhash(u->building); + break; + + default: + cmistake(u, ord, 239, MSG_EVENT); + } + return 0; +} + diff --git a/src/renumber.h b/src/renumber.h new file mode 100644 index 000000000..244b8043f --- /dev/null +++ b/src/renumber.h @@ -0,0 +1,12 @@ +#pragma once + +#ifndef H_RENUMBER +#define H_RENUMBER + + struct unit; + struct order; + + void renumber_factions(void); + int renumber_cmd(struct unit *u, struct order *ord); + +#endif diff --git a/src/renumber.test.c b/src/renumber.test.c new file mode 100644 index 000000000..6c3f0f17b --- /dev/null +++ b/src/renumber.test.c @@ -0,0 +1,233 @@ +#include "renumber.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +static void test_renumber_faction(CuTest *tc) { + unit *u; + int uno, no; + const struct locale *lang; + + test_setup_ex(tc); + u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); + no = u->faction->no; + uno = (no > 1) ? no - 1 : no + 1; + lang = u->faction->locale; + u->thisorder = create_order(K_NUMBER, lang, "%s %s", LOC(lang, parameters[P_FACTION]), itoa36(uno)); + renumber_cmd(u, u->thisorder); + renumber_factions(); + CuAssertIntEquals(tc, uno, u->faction->no); + test_cleanup(); +} + +static void test_renumber_faction_duplicate(CuTest *tc) { + unit *u; + faction *f, *f2; + int no; + const struct locale *lang; + + test_setup_ex(tc); + f2 = test_create_faction(0); + u = test_create_unit(f = test_create_faction(0), test_create_region(0, 0, 0)); + no = f->no; + lang = f->locale; + u->thisorder = create_order(K_NUMBER, lang, "%s %s", LOC(lang, parameters[P_FACTION]), itoa36(f2->no)); + renumber_cmd(u, u->thisorder); + renumber_factions(); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "renumber_inuse")); + CuAssertIntEquals(tc, no, u->faction->no); + test_cleanup(); +} + +static void test_renumber_building(CuTest *tc) { + unit *u; + int uno, no; + const struct locale *lang; + + test_setup_ex(tc); + u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); + u->building = test_create_building(u->region, 0); + no = u->building->no; + uno = (no > 1) ? no - 1 : no + 1; + lang = u->faction->locale; + u->thisorder = create_order(K_NUMBER, lang, "%s %s", LOC(lang, parameters[P_BUILDING]), itoa36(uno)); + renumber_cmd(u, u->thisorder); + CuAssertIntEquals(tc, uno, u->building->no); + test_cleanup(); +} + +static void test_renumber_building_duplicate(CuTest *tc) { + unit *u; + faction *f; + int uno, no; + const struct locale *lang; + + test_setup_ex(tc); + u = test_create_unit(f = test_create_faction(0), test_create_region(0, 0, 0)); + u->building = test_create_building(u->region, 0); + uno = u->building->no; + u->building = test_create_building(u->region, 0); + no = u->building->no; + lang = f->locale; + u->thisorder = create_order(K_NUMBER, lang, "%s %s", LOC(lang, parameters[P_BUILDING]), itoa36(uno)); + renumber_cmd(u, u->thisorder); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "error115")); + CuAssertIntEquals(tc, no, u->building->no); + test_cleanup(); +} + +static void test_renumber_ship(CuTest *tc) { + unit *u; + int uno, no; + const struct locale *lang; + + test_setup_ex(tc); + u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); + u->ship = test_create_ship(u->region, 0); + no = u->ship->no; + uno = (no > 1) ? no - 1 : no + 1; + lang = u->faction->locale; + u->thisorder = create_order(K_NUMBER, lang, "%s %s", LOC(lang, parameters[P_SHIP]), itoa36(uno)); + renumber_cmd(u, u->thisorder); + CuAssertIntEquals(tc, uno, u->ship->no); + test_cleanup(); +} + +static void test_renumber_ship_twice(CuTest *tc) { + unit *u; + int uno, no; + const struct locale *lang; + + test_setup_ex(tc); + u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); + u->ship = test_create_ship(u->region, 0); + no = u->ship->no; + uno = (no > 1) ? no - 1 : no + 1; + lang = u->faction->locale; + u->thisorder = create_order(K_NUMBER, lang, "%s %s", LOC(lang, parameters[P_SHIP]), itoa36(uno)); + renumber_cmd(u, u->thisorder); + CuAssertIntEquals(tc, uno, u->ship->no); + free_order(u->thisorder); + u->thisorder = create_order(K_NUMBER, lang, "%s %s", LOC(lang, parameters[P_SHIP]), itoa36(no)); + renumber_cmd(u, u->thisorder); + CuAssertIntEquals(tc, no, u->ship->no); + test_cleanup(); +} + +static void test_renumber_ship_duplicate(CuTest *tc) { + unit *u; + faction *f; + int uno, no; + const struct locale *lang; + + test_setup_ex(tc); + u = test_create_unit(f = test_create_faction(0), test_create_region(0, 0, 0)); + u->ship = test_create_ship(u->region, 0); + uno = u->ship->no; + u->ship = test_create_ship(u->region, 0); + no = u->ship->no; + lang = f->locale; + u->thisorder = create_order(K_NUMBER, lang, "%s %s", LOC(lang, parameters[P_SHIP]), itoa36(uno)); + renumber_cmd(u, u->thisorder); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "error115")); + CuAssertIntEquals(tc, no, u->ship->no); + test_cleanup(); +} + +static void test_renumber_unit(CuTest *tc) { + unit *u; + int uno, no; + const struct locale *lang; + + test_setup_ex(tc); + u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); + no = u->no; + uno = (no > 1) ? no - 1 : no + 1; + lang = u->faction->locale; + u->thisorder = create_order(K_NUMBER, lang, "%s %s", LOC(lang, parameters[P_UNIT]), itoa36(uno)); + renumber_cmd(u, u->thisorder); + CuAssertIntEquals(tc, uno, u->no); + CuAssertIntEquals(tc, -no, ualias(u)); + test_cleanup(); +} + +static void test_renumber_unit_duplicate(CuTest *tc) { + unit *u, *u2; + faction *f; + int no; + const struct locale *lang; + + test_setup_ex(tc); + u = test_create_unit(f = test_create_faction(0), test_create_region(0, 0, 0)); + no = u->no; + u2 = test_create_unit(f, u->region); + lang = f->locale; + u->thisorder = create_order(K_NUMBER, lang, "%s %s", LOC(lang, parameters[P_UNIT]), itoa36(u2->no)); + renumber_cmd(u, u->thisorder); + CuAssertIntEquals(tc, no, u->no); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "error115")); + CuAssertIntEquals(tc, 0, ualias(u)); + test_cleanup(); +} + +static void test_renumber_unit_limit(CuTest *tc) { + unit *u; + faction *f; + int no; + const struct locale *lang; + + test_setup_ex(tc); + u = test_create_unit(f = test_create_faction(0), test_create_region(0, 0, 0)); + no = u->no; + lang = f->locale; + u->thisorder = create_order(K_NUMBER, lang, "%s 10000", LOC(lang, parameters[P_UNIT])); + renumber_cmd(u, u->thisorder); + CuAssertIntEquals(tc, no, u->no); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "error114")); + CuAssertIntEquals(tc, 0, ualias(u)); + test_cleanup(); +} + +static void test_renumber_unit_invalid(CuTest *tc) { + unit *u; + faction *f; + int no; + const struct locale *lang; + + test_setup_ex(tc); + u = test_create_unit(f = test_create_faction(0), test_create_region(0, 0, 0)); + no = u->no; + lang = f->locale; + u->thisorder = create_order(K_NUMBER, lang, "%s TEMP", LOC(lang, parameters[P_UNIT])); + renumber_cmd(u, u->thisorder); + CuAssertIntEquals(tc, no, u->no); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "error116")); + CuAssertIntEquals(tc, 0, ualias(u)); + test_cleanup(); +} + +CuSuite *get_renumber_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_renumber_unit); + SUITE_ADD_TEST(suite, test_renumber_unit_limit); + SUITE_ADD_TEST(suite, test_renumber_unit_duplicate); + SUITE_ADD_TEST(suite, test_renumber_unit_invalid); + SUITE_ADD_TEST(suite, test_renumber_building); + SUITE_ADD_TEST(suite, test_renumber_building_duplicate); + SUITE_ADD_TEST(suite, test_renumber_ship); + SUITE_ADD_TEST(suite, test_renumber_ship_twice); + SUITE_ADD_TEST(suite, test_renumber_ship_duplicate); + SUITE_ADD_TEST(suite, test_renumber_faction); + SUITE_ADD_TEST(suite, test_renumber_faction_duplicate); + return suite; +} diff --git a/src/report.c b/src/report.c index 6436fe990..dd6b29525 100644 --- a/src/report.c +++ b/src/report.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 1998-2015, Enno Rehling Katja Zedel @@ -21,11 +21,13 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include +#include "report.h" #include "reports.h" -#include "seen.h" +#include "guard.h" #include "laws.h" -#include "travelthru.h" +#include "market.h" #include "monster.h" +#include "travelthru.h" /* modules includes */ #include @@ -62,7 +64,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include #include #include @@ -84,6 +85,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include +#include /* libc includes */ #include @@ -132,11 +134,11 @@ static char *gamedate_season(const struct locale *lang) return buf; } -void newline(stream *out) { +void newline(struct stream *out) { sputs("", out); } -void write_spaces(stream *out, size_t num) { +void write_spaces(struct stream *out, size_t num) { static const char spaces[REPORTWIDTH] = " "; while (num > 0) { size_t bytes = (num > REPORTWIDTH) ? REPORTWIDTH : num; @@ -145,8 +147,7 @@ void write_spaces(stream *out, size_t num) { } } - -static void centre(stream *out, const char *s, bool breaking) +static void centre(struct stream *out, const char *s, bool breaking) { /* Bei Namen die genau 80 Zeichen lang sind, kann es hier Probleme * geben. Seltsamerweise wird i dann auf MAXINT oder aehnlich @@ -170,8 +171,8 @@ static void centre(stream *out, const char *s, bool breaking) } static void -paragraph(stream *out, const char *str, ptrdiff_t indent, int hanging_indent, -char marker) +paragraph(struct stream *out, const char *str, ptrdiff_t indent, int hanging_indent, + char marker) { size_t length = REPORTWIDTH; const char *end, *begin, *mark = 0; @@ -248,126 +249,7 @@ static size_t write_spell_modifier(spell * sp, int flag, const char * str, bool return 0; } -void nr_spell_syntax(struct stream *out, struct spellbook_entry * sbe, const struct locale *lang); - -void nr_spell(stream *out, spellbook_entry * sbe, const struct locale *lang) -{ - int bytes, k, itemanz, costtyp; - char buf[4096]; - char *startp, *bufp = buf; - size_t size = sizeof(buf) - 1; - spell * sp = sbe->sp; - - newline(out); - centre(out, spell_name(sp, lang), true); - newline(out); - paragraph(out, LOC(lang, "nr_spell_description"), 0, 0, 0); - paragraph(out, spell_info(sp, lang), 2, 0, 0); - - bytes = (int)strlcpy(bufp, LOC(lang, "nr_spell_type"), size); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - - if (size) { - *bufp++ = ' '; - --size; - } - if (sp->sptyp & PRECOMBATSPELL) { - bytes = (int)strlcpy(bufp, LOC(lang, "sptype_precombat"), size); - } - else if (sp->sptyp & COMBATSPELL) { - bytes = (int)strlcpy(bufp, LOC(lang, "sptype_combat"), size); - } - else if (sp->sptyp & POSTCOMBATSPELL) { - bytes = (int)strlcpy(bufp, LOC(lang, "sptype_postcombat"), size); - } - else { - bytes = (int)strlcpy(bufp, LOC(lang, "sptype_normal"), size); - } - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - *bufp = 0; - paragraph(out, buf, 0, 0, 0); - - sprintf(buf, "%s %d", LOC(lang, "nr_spell_level"), sbe->level); - paragraph(out, buf, 0, 0, 0); - - sprintf(buf, "%s %d", LOC(lang, "nr_spell_rank"), sp->rank); - paragraph(out, buf, 0, 0, 0); - - paragraph(out, LOC(lang, "nr_spell_components"), 0, 0, 0); - for (k = 0; sp->components[k].type; ++k) { - const resource_type *rtype = sp->components[k].type; - itemanz = sp->components[k].amount; - costtyp = sp->components[k].cost; - if (itemanz > 0) { - size = sizeof(buf) - 1; - bufp = buf; - if (sp->sptyp & SPELLLEVEL) { - bytes = - _snprintf(bufp, size, " %d %s", itemanz, LOC(lang, resourcename(rtype, - itemanz != 1))); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - if (costtyp == SPC_LEVEL || costtyp == SPC_LINEAR) { - bytes = _snprintf(bufp, size, " * %s", LOC(lang, "nr_level")); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - } - } - else { - bytes = _snprintf(bufp, size, "%d %s", itemanz, LOC(lang, resourcename(rtype, itemanz != 1))); - if (wrptr(&bufp, &size, bytes) != 0) { - WARN_STATIC_BUFFER(); - } - } - *bufp = 0; - paragraph(out, buf, 2, 2, '-'); - } - } - - size = sizeof(buf) - 1; - bufp = buf; - bytes = (int)strlcpy(buf, LOC(lang, "nr_spell_modifiers"), size); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - - startp = bufp; - bytes = (int)write_spell_modifier(sp, FARCASTING, LOC(lang, "smod_far"), startp != bufp, bufp, size); - if (bytes && wrptr(&bufp, &size, bytes) != 0) { - WARN_STATIC_BUFFER(); - } - bytes = (int)write_spell_modifier(sp, OCEANCASTABLE, LOC(lang, "smod_sea"), startp != bufp, bufp, size); - if (bytes && wrptr(&bufp, &size, bytes) != 0) { - WARN_STATIC_BUFFER(); - } - bytes = (int)write_spell_modifier(sp, ONSHIPCAST, LOC(lang, "smod_ship"), startp != bufp, bufp, size); - if (bytes && wrptr(&bufp, &size, bytes) != 0) { - WARN_STATIC_BUFFER(); - } - bytes = (int)write_spell_modifier(sp, NOTFAMILIARCAST, LOC(lang, "smod_nofamiliar"), startp != bufp, bufp, size); - if (bytes && wrptr(&bufp, &size, bytes) != 0) { - WARN_STATIC_BUFFER(); - } - if (startp == bufp) { - bytes = (int)write_spell_modifier(sp, NOTFAMILIARCAST, LOC(lang, "smod_none"), startp != bufp, bufp, size); - if (bytes && wrptr(&bufp, &size, bytes) != 0) { - WARN_STATIC_BUFFER(); - } - } - *bufp = 0; - paragraph(out, buf, 0, 0, 0); - paragraph(out, LOC(lang, "nr_spell_syntax"), 0, 0, 0); - - bufp = buf; - size = sizeof(buf) - 1; - - nr_spell_syntax(out, sbe, lang); - - newline(out); -} - -void nr_spell_syntax(stream *out, spellbook_entry * sbe, const struct locale *lang) +void nr_spell_syntax(struct stream *out, spellbook_entry * sbe, const struct locale *lang) { int bytes; char buf[4096]; @@ -545,8 +427,9 @@ void nr_spell_syntax(stream *out, spellbook_entry * sbe, const struct locale *la } if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); - } else { - log_error("unknown spell parameter %c for spell %s", cp, sp->sname); + } + else { + log_error("unknown spell parameter %c for spell %s", cp, sp->sname); } } *bufp = 0; @@ -554,8 +437,125 @@ void nr_spell_syntax(stream *out, spellbook_entry * sbe, const struct locale *la } +void nr_spell(struct stream *out, spellbook_entry * sbe, const struct locale *lang) +{ + int bytes, k, itemanz, costtyp; + char buf[4096]; + char *startp, *bufp = buf; + size_t size = sizeof(buf) - 1; + spell * sp = sbe->sp; + + newline(out); + centre(out, spell_name(sp, lang), true); + newline(out); + paragraph(out, LOC(lang, "nr_spell_description"), 0, 0, 0); + paragraph(out, spell_info(sp, lang), 2, 0, 0); + + bytes = (int)strlcpy(bufp, LOC(lang, "nr_spell_type"), size); + if (wrptr(&bufp, &size, bytes) != 0) + WARN_STATIC_BUFFER(); + + if (size) { + *bufp++ = ' '; + --size; + } + if (sp->sptyp & PRECOMBATSPELL) { + bytes = (int)strlcpy(bufp, LOC(lang, "sptype_precombat"), size); + } + else if (sp->sptyp & COMBATSPELL) { + bytes = (int)strlcpy(bufp, LOC(lang, "sptype_combat"), size); + } + else if (sp->sptyp & POSTCOMBATSPELL) { + bytes = (int)strlcpy(bufp, LOC(lang, "sptype_postcombat"), size); + } + else { + bytes = (int)strlcpy(bufp, LOC(lang, "sptype_normal"), size); + } + if (wrptr(&bufp, &size, bytes) != 0) + WARN_STATIC_BUFFER(); + *bufp = 0; + paragraph(out, buf, 0, 0, 0); + + sprintf(buf, "%s %d", LOC(lang, "nr_spell_level"), sbe->level); + paragraph(out, buf, 0, 0, 0); + + sprintf(buf, "%s %d", LOC(lang, "nr_spell_rank"), sp->rank); + paragraph(out, buf, 0, 0, 0); + + paragraph(out, LOC(lang, "nr_spell_components"), 0, 0, 0); + for (k = 0; sp->components[k].type; ++k) { + const resource_type *rtype = sp->components[k].type; + itemanz = sp->components[k].amount; + costtyp = sp->components[k].cost; + if (itemanz > 0) { + size = sizeof(buf) - 1; + bufp = buf; + if (sp->sptyp & SPELLLEVEL) { + bytes = + _snprintf(bufp, size, " %d %s", itemanz, LOC(lang, resourcename(rtype, + itemanz != 1))); + if (wrptr(&bufp, &size, bytes) != 0) + WARN_STATIC_BUFFER(); + if (costtyp == SPC_LEVEL || costtyp == SPC_LINEAR) { + bytes = _snprintf(bufp, size, " * %s", LOC(lang, "nr_level")); + if (wrptr(&bufp, &size, bytes) != 0) + WARN_STATIC_BUFFER(); + } + } + else { + bytes = _snprintf(bufp, size, "%d %s", itemanz, LOC(lang, resourcename(rtype, itemanz != 1))); + if (wrptr(&bufp, &size, bytes) != 0) { + WARN_STATIC_BUFFER(); + } + } + *bufp = 0; + paragraph(out, buf, 2, 2, '-'); + } + } + + size = sizeof(buf) - 1; + bufp = buf; + bytes = (int)strlcpy(buf, LOC(lang, "nr_spell_modifiers"), size); + if (wrptr(&bufp, &size, bytes) != 0) + WARN_STATIC_BUFFER(); + + startp = bufp; + bytes = (int)write_spell_modifier(sp, FARCASTING, LOC(lang, "smod_far"), startp != bufp, bufp, size); + if (bytes && wrptr(&bufp, &size, bytes) != 0) { + WARN_STATIC_BUFFER(); + } + bytes = (int)write_spell_modifier(sp, OCEANCASTABLE, LOC(lang, "smod_sea"), startp != bufp, bufp, size); + if (bytes && wrptr(&bufp, &size, bytes) != 0) { + WARN_STATIC_BUFFER(); + } + bytes = (int)write_spell_modifier(sp, ONSHIPCAST, LOC(lang, "smod_ship"), startp != bufp, bufp, size); + if (bytes && wrptr(&bufp, &size, bytes) != 0) { + WARN_STATIC_BUFFER(); + } + bytes = (int)write_spell_modifier(sp, NOTFAMILIARCAST, LOC(lang, "smod_nofamiliar"), startp != bufp, bufp, size); + if (bytes && wrptr(&bufp, &size, bytes) != 0) { + WARN_STATIC_BUFFER(); + } + if (startp == bufp) { + bytes = (int)write_spell_modifier(sp, NOTFAMILIARCAST, LOC(lang, "smod_none"), startp != bufp, bufp, size); + if (bytes && wrptr(&bufp, &size, bytes) != 0) { + WARN_STATIC_BUFFER(); + } + } + *bufp = 0; + paragraph(out, buf, 0, 0, 0); + paragraph(out, LOC(lang, "nr_spell_syntax"), 0, 0, 0); + + bufp = buf; + size = sizeof(buf) - 1; + + nr_spell_syntax(out, sbe, lang); + + newline(out); +} + static void -nr_curses_i(stream *out, int indent, const faction *viewer, objtype_t typ, const void *obj, attrib *a, int self) +nr_curses_i(struct stream *out, int indent, const faction *viewer, objtype_t typ, const void *obj, attrib *a, int self) { for (; a; a = a->next) { char buf[4096]; @@ -583,7 +583,7 @@ nr_curses_i(stream *out, int indent, const faction *viewer, objtype_t typ, const } } -static void nr_curses(stream *out, int indent, const faction *viewer, objtype_t typ, const void *obj) +static void nr_curses(struct stream *out, int indent, const faction *viewer, objtype_t typ, const void *obj) { int self = 0; attrib *a = NULL; @@ -653,7 +653,7 @@ static void nr_curses(stream *out, int indent, const faction *viewer, objtype_t nr_curses_i(out, indent, viewer, typ, obj, a, self); } -static void rps_nowrap(stream *out, const char *s) +static void rps_nowrap(struct stream *out, const char *s) { const char *x = s; size_t indent = 0; @@ -676,12 +676,12 @@ static void rps_nowrap(stream *out, const char *s) } static void -nr_unit(stream *out, const faction * f, const unit * u, int indent, int mode) +nr_unit(struct stream *out, const faction * f, const unit * u, int indent, seen_mode mode) { attrib *a_otherfaction; char marker; int dh; - bool isbattle = (bool)(mode == see_battle); + bool isbattle = (bool)(mode == seen_battle); char buf[8192]; if (fval(u_race(u), RCF_INVISIBLE)) @@ -718,8 +718,8 @@ nr_unit(stream *out, const faction * f, const unit * u, int indent, int mode) } static void -rp_messages(stream *out, message_list * msgs, faction * viewer, int indent, -bool categorized) +rp_messages(struct stream *out, message_list * msgs, faction * viewer, int indent, + bool categorized) { nrsection *section; @@ -754,7 +754,7 @@ bool categorized) } } -static void rp_battles(stream *out, faction * f) +static void rp_battles(struct stream *out, faction * f) { if (f->battles != NULL) { struct bmsg *bm = f->battles; @@ -774,7 +774,7 @@ static void rp_battles(stream *out, faction * f) } } -static void prices(stream *out, const region * r, const faction * f) +static void prices(struct stream *out, const region * r, const faction * f) { const luxury_type *sale = NULL; struct demand *dmd; @@ -812,7 +812,7 @@ static void prices(stream *out, const region * r, const faction * f) if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); - for (dmd = r->land->demands; dmd; dmd = dmd->next){ + for (dmd = r->land->demands; dmd; dmd = dmd->next) { if (dmd->value > 0) { m = msg_message("nr_market_price", "product price", dmd->type->itype->rtype, dmd->value * dmd->type->price); @@ -876,9 +876,8 @@ bool see_border(const connection * b, const faction * f, const region * r) return cs; } -static void describe(stream *out, const seen_region * sr, faction * f) +static void describe(struct stream *out, const region * r, faction * f) { - const region *r; int n; bool dh; direction_t d; @@ -902,9 +901,8 @@ static void describe(stream *out, const seen_region * sr, faction * f) assert(out); assert(f); - assert(sr); + assert(r); - r = sr->r; for (d = 0; d != MAXDIRECTIONS; d++) { /* Nachbarregionen, die gesehen werden, ermitteln */ region *r2 = rconnect(r, d); @@ -917,14 +915,16 @@ static void describe(stream *out, const seen_region * sr, faction * f) bool transparent = b->type->transparent(b, f); const char *name = border_name(b, r, f, GF_DETAILED | GF_ARTICLE); - if (!transparent) + if (!transparent) { see[d] = false; + } if (!see_border(b, f, r)) { b = b->next; continue; } - while (e && (e->transparent != transparent || strcmp(name, e->name))) + while (e && (e->transparent != transparent || strcmp(name, e->name)!=0)) { e = e->next; + } if (!e) { e = calloc(sizeof(struct edge), 1); e->name = _strdup(name); @@ -942,13 +942,13 @@ static void describe(stream *out, const seen_region * sr, faction * f) if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); - if (sr->mode == see_travel) { + if (r->seen.mode == seen_travel) { bytes = _snprintf(bufp, size, " (%s)", LOC(f->locale, "see_travel")); } - else if (sr->mode == see_neighbour) { + else if (r->seen.mode == seen_neighbour) { bytes = _snprintf(bufp, size, " (%s)", LOC(f->locale, "see_neighbour")); } - else if (sr->mode == see_lighthouse) { + else if (r->seen.mode == seen_lighthouse) { bytes = _snprintf(bufp, size, " (%s)", LOC(f->locale, "see_lighthouse")); } else { @@ -996,9 +996,9 @@ static void describe(stream *out, const seen_region * sr, faction * f) } /* iron & stone */ - if (sr->mode == see_unit) { + if (r->seen.mode == seen_unit) { resource_report result[MAX_RAWMATERIALS]; - int n, numresults = report_resources(sr, result, MAX_RAWMATERIALS, f); + int n, numresults = report_resources(r, result, MAX_RAWMATERIALS, f, true); for (n = 0; n < numresults; ++n) { if (result[n].number >= 0 && result[n].level >= 0) { @@ -1024,23 +1024,12 @@ static void describe(stream *out, const seen_region * sr, faction * f) if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); } - if (fval(r, RF_ORCIFIED)) { - bytes = (int)strlcpy(bufp, " ", size); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - - bytes = - (int)strlcpy(bufp, LOC(f->locale, n == 1 ? "rc_orc" : "rc_orc_p"), + bytes = (int)strlcpy(bufp, " ", size); + if (wrptr(&bufp, &size, bytes) != 0) + WARN_STATIC_BUFFER(); + bytes = + (int)strlcpy(bufp, LOC(f->locale, n == 1 ? "peasant" : "peasant_p"), size); - } - else { - bytes = (int)strlcpy(bufp, " ", size); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - bytes = - (int)strlcpy(bufp, LOC(f->locale, n == 1 ? "peasant" : "peasant_p"), - size); - } if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); if (is_mourning(r, turn + 1)) { @@ -1049,13 +1038,13 @@ static void describe(stream *out, const seen_region * sr, faction * f) WARN_STATIC_BUFFER(); } } - if (rmoney(r) && sr->mode >= see_travel) { + if (rmoney(r) && r->seen.mode >= seen_travel) { bytes = _snprintf(bufp, size, ", %d ", rmoney(r)); if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); bytes = (int)strlcpy(bufp, LOC(f->locale, resourcename(get_resourcetype(R_SILVER), - rmoney(r) != 1)), size); + rmoney(r) != 1)), size); if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); } @@ -1194,7 +1183,7 @@ static void describe(stream *out, const seen_region * sr, faction * f) *bufp = 0; paragraph(out, buf, 0, 0, 0); - if (sr->mode == see_unit && is_astral(r) && + if (r->seen.mode == seen_unit && is_astral(r) && !is_cursed(r->attribs, C_ASTRALBLOCK, 0)) { /* Sonderbehandlung Teleport-Ebene */ region_list *rl = astralregions(r, inhabitable); @@ -1282,7 +1271,7 @@ static void describe(stream *out, const seen_region * sr, faction * f) } } -static void statistics(stream *out, const region * r, const faction * f) +static void statistics(struct stream *out, const region * r, const faction * f) { const unit *u; int number = 0, p = rpeasants(r); @@ -1390,18 +1379,16 @@ static int buildingmaintenance(const building * b, const resource_type * rtype) } static int -report_template(const char *filename, report_context * ctx, const char *charset) +report_template(const char *filename, report_context * ctx, const char *bom) { const resource_type *rsilver = get_resourcetype(R_SILVER); faction *f = ctx->f; region *r; FILE *F = fopen(filename, "w"); stream strm = { 0 }, *out = &strm; - seen_region *sr = NULL; char buf[8192], *bufp; size_t size; int bytes; - bool utf8 = _strcmpl(charset, "utf8") == 0 || _strcmpl(charset, "utf-8") == 0; const curse_type *nocost_ct = ct_find("nocostbuilding"); if (F == NULL) { @@ -1410,9 +1397,8 @@ report_template(const char *filename, report_context * ctx, const char *charset) } fstream_init(&strm, F); - if (utf8) { - const unsigned char utf8_bom[4] = { 0xef, 0xbb, 0xbf, 0 }; - swrite(utf8_bom, 1, 3, out); + if (bom) { + swrite(bom, 1, strlen(bom), out); } newline(out); @@ -1420,7 +1406,7 @@ report_template(const char *filename, report_context * ctx, const char *charset) newline(out); newline(out); - sprintf(buf, "%s %s \"password\"", LOC(f->locale, "ERESSEA"), factionid(f)); + sprintf(buf, "%s %s \"password\"", LOC(f->locale, "ERESSEA"), itoa36(f->no)); rps_nowrap(out, buf); newline(out); newline(out); @@ -1429,16 +1415,11 @@ report_template(const char *filename, report_context * ctx, const char *charset) rps_nowrap(out, buf); newline(out); - for (r = ctx->first; sr == NULL && r != ctx->last; r = r->next) { - sr = find_seen(ctx->f->seen, r); - } - - for (; sr != NULL; sr = sr->next) { - region *r = sr->r; + for (r = ctx->first; r != ctx->last; r = r->next) { unit *u; int dh = 0; - if (sr->mode < see_unit) + if (r->seen.mode < seen_unit) continue; for (u = r->units; u; u = u->next) { @@ -1472,7 +1453,7 @@ report_template(const char *filename, report_context * ctx, const char *charset) size = sizeof(buf) - 1; bytes = _snprintf(bufp, size, "%s %s; %s [%d,%d$", LOC(u->faction->locale, parameters[P_UNIT]), - unitid(u), unit_getname(u), u->number, get_money(u)); + itoa36(u->no), unit_getname(u), u->number, get_money(u)); if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); if (u->building && building_owner(u->building) == u) { @@ -1498,7 +1479,7 @@ report_template(const char *filename, report_context * ctx, const char *charset) } if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); - bytes = (int)strlcpy(bufp, shipid(u->ship), size); + bytes = (int)strlcpy(bufp, itoa36(u->ship->no), size); if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); } @@ -1640,7 +1621,7 @@ show_allies(const faction * f, const ally * allies, char *buf, size_t size) *bufp = 0; } -static void allies(stream *out, const faction * f) +static void allies(struct stream *out, const faction * f) { const group *g = f->groups; char buf[16384]; @@ -1669,7 +1650,7 @@ static void allies(stream *out, const faction * f) } } -static void guards(stream *out, const region * r, const faction * see) +static void guards(struct stream *out, const region * r, const faction * see) { /* die Partei see sieht dies; wegen * "unbekannte Partei", wenn man es selbst ist... */ @@ -1681,7 +1662,7 @@ static void guards(stream *out, const region * r, const faction * see) /* Bewachung */ for (u = r->units; u; u = u->next) { - if (is_guard(u, GUARD_ALL) != 0) { + if (is_guard(u) != 0) { faction *f = u->faction; faction *fv = visible_faction(see, u); @@ -1742,17 +1723,17 @@ static void guards(stream *out, const region * r, const faction * see) } } -static void rpline(stream *out) +static void rpline(struct stream *out) { static char line[REPORTWIDTH + 1]; if (line[0] != '-') { memset(line, '-', sizeof(line)); line[REPORTWIDTH] = '\n'; } - swrite(line, sizeof(char), sizeof(line), out); + swrite(line, sizeof(line), 1, out); } -static void list_address(stream *out, const faction * uf, quicklist * seenfactions) +static void list_address(struct stream *out, const faction * uf, quicklist * seenfactions) { int qi = 0; quicklist *flist = seenfactions; @@ -1783,10 +1764,9 @@ static void list_address(stream *out, const faction * uf, quicklist * seenfactio } static void -nr_ship(stream *out, const seen_region * sr, const ship * sh, const faction * f, -const unit * captain) +nr_ship(struct stream *out, const region *r, const ship * sh, const faction * f, + const unit * captain) { - const region *r = sr->r; char buffer[8192], *bufp = buffer; size_t size = sizeof(buffer) - 1; int bytes; @@ -1805,7 +1785,7 @@ const unit * captain) else { bytes = _snprintf(bufp, size, "%s, %s", shipname(sh), LOC(f->locale, - sh->type->_name)); + sh->type->_name)); } if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); @@ -1857,8 +1837,7 @@ const unit * captain) } static void -nr_building(stream *out, const seen_region * sr, const building * b, -const faction * f) +nr_building(struct stream *out, const region *r, const building *b, const faction *f) { int i, bytes; const char *name, *bname, *billusion = NULL; @@ -1872,7 +1851,7 @@ const faction * f) newline(out); bytes = _snprintf(bufp, size, "%s, %s %d, ", buildingname(b), LOC(lang, - "nr_size"), b->size); + "nr_size"), b->size); if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); @@ -1898,7 +1877,7 @@ const faction * f) WARN_STATIC_BUFFER(); } - if (b->besieged > 0 && sr->mode >= see_lighthouse) { + if (b->besieged > 0 && r->seen.mode >= seen_lighthouse) { msg = msg_message("nr_building_besieged", "soldiers diff", b->besieged, b->besieged - b->size * SIEGEFACTOR); bytes = (int)nr_render(msg, lang, bufp, size, f); @@ -1925,14 +1904,12 @@ const faction * f) *bufp = 0; paragraph(out, buffer, 2, 0, 0); - if (sr->mode < see_lighthouse) - return; - - i = 0; - nr_curses(out, 4, f, TYP_BUILDING, b); + if (r->seen.mode >= seen_lighthouse) { + nr_curses(out, 4, f, TYP_BUILDING, b); + } } -static void nr_paragraph(stream *out, message * m, faction * f) +static void nr_paragraph(struct stream *out, message * m, faction * f) { int bytes; char buf[4096], *bufp = buf; @@ -1948,14 +1925,14 @@ static void nr_paragraph(stream *out, message * m, faction * f) } typedef struct cb_data { - stream *out; + struct stream *out; char *start, *writep; size_t size; const faction *f; int maxtravel, counter; } cb_data; -static void init_cb(cb_data *data, stream *out, char *buffer, size_t size, const faction *f) { +static void init_cb(cb_data *data, struct stream *out, char *buffer, size_t size, const faction *f) { data->out = out; data->writep = buffer; data->start = buffer; @@ -2020,7 +1997,7 @@ static void cb_write_travelthru(region *r, unit *u, void *cbdata) { } } -void write_travelthru(stream *out, region * r, const faction * f) +void write_travelthru(struct stream *out, region *r, const faction *f) { int maxtravel; char buf[8192]; @@ -2038,7 +2015,7 @@ void write_travelthru(stream *out, region * r, const faction * f) init_cb(&cbdata, out, buf, sizeof(buf), f); cbdata.maxtravel = maxtravel; - cbdata.writep += + cbdata.writep += strlcpy(buf, LOC(f->locale, "travelthru_header"), sizeof(buf)); travelthru_map(r, cb_write_travelthru, &cbdata); return; @@ -2047,12 +2024,12 @@ void write_travelthru(stream *out, region * r, const faction * f) int report_plaintext(const char *filename, report_context * ctx, -const char *charset) + const char *bom) { int flag = 0; char ch; int anyunits, no_units, no_people; - const struct region *r; + region *r; faction *f = ctx->f; unit *u; char pzTime[64]; @@ -2063,15 +2040,13 @@ const char *charset) int wants_stats = (f->options & ix); FILE *F = fopen(filename, "w"); stream strm = { 0 }, *out = &strm; - seen_region *sr = NULL; char buf[8192]; char *bufp; - bool utf8 = _strcmpl(charset, "utf8") == 0 || _strcmpl(charset, "utf-8") == 0; size_t size; int thisseason; int nextseason; gamedate date; - + get_gamedate(turn + 1, &date); thisseason = date.season; get_gamedate(turn + 2, &date); @@ -2083,9 +2058,8 @@ const char *charset) } fstream_init(&strm, F); - if (utf8) { - const unsigned char utf8_bom[4] = { 0xef, 0xbb, 0xbf, 0 }; - fwrite(utf8_bom, 1, 3, F); + if (bom) { + fwrite(bom, 1, strlen(bom), F); } strftime(pzTime, 64, "%A, %d. %B %Y, %H:%M", localtime(&ctx->report_time)); @@ -2106,19 +2080,14 @@ const char *charset) if (f->age <= 2) { const char *s; - s = locale_getstring(f->locale, "newbie_info_1"); - if (s) { - newline(out); - centre(out, s, true); - } - s = locale_getstring(f->locale, "newbie_info_2"); + s = locale_getstring(f->locale, "newbie_info_game"); if (s) { newline(out); centre(out, s, true); } if ((f->options & want(O_COMPUTER)) == 0) { f->options |= want(O_COMPUTER); - s = locale_getstring(f->locale, "newbie_info_3"); + s = locale_getstring(f->locale, "newbie_info_cr"); if (s) { newline(out); centre(out, s, true); @@ -2133,23 +2102,6 @@ const char *charset) RENDER(f, buf, sizeof(buf), ("nr_score", "score average", score, avg)); centre(out, buf, true); } -#ifdef COUNT_AGAIN - no_units = 0; - no_people = 0; - for (u = f->units; u; u = u->nextF) { - if (playerrace(u_race(u))) { - ++no_people; - no_units += u->number; - assert(f == u->faction); - } - } - if (no_units != f->no_units) { - f->no_units = no_units; - } - if (no_people != f->num_people) { - f->num_people = no_people; -} -#else no_units = count_units(f); no_people = count_all(f); if (f->flags & FFL_NPC) { @@ -2158,7 +2110,6 @@ const char *charset) else { no_people = f->num_people; } -#endif m = msg_message("nr_population", "population units limit", no_people, no_units, rule_faction_limit()); nr_render(m, f->locale, buf, sizeof(buf), f); msg_release(m); @@ -2176,8 +2127,8 @@ const char *charset) if (f_get_alliance(f)) { m = msg_message("nr_alliance", "leader name id age", - alliance_get_leader(f->alliance), f->alliance->name, f->alliance->id, - turn - f->alliance_joindate); + alliance_get_leader(f->alliance), f->alliance->name, f->alliance->id, + turn - f->alliance_joindate); nr_render(m, f->locale, buf, sizeof(buf), f); msg_release(m); centre(out, buf, true); @@ -2295,10 +2246,8 @@ const char *charset) *bufp = 0; centre(out, buf, true); newline(out); - if (description == NULL) { - const char *potiontext = mkname("potion", pname); - description = LOC(f->locale, potiontext); - } + description = mkname("potion", pname); + description = LOC(f->locale, description); centre(out, description, true); } } @@ -2314,22 +2263,18 @@ const char *charset) CHECK_ERRNO(); anyunits = 0; - for (r = ctx->first; sr == NULL && r != ctx->last; r = r->next) { - sr = find_seen(ctx->f->seen, r); - } - for (; sr != NULL; sr = sr->next) { - region *r = sr->r; - int stealthmod = stealth_modifier(sr->mode); + for (r = ctx->first; r != ctx->last; r = r->next) { + int stealthmod = stealth_modifier(r->seen.mode); building *b = r->buildings; ship *sh = r->ships; - if (sr->mode < see_lighthouse) + if (r->seen.mode < seen_lighthouse) continue; /* Beschreibung */ - if (sr->mode == see_unit) { + if (r->seen.mode == seen_unit) { anyunits = 1; - describe(out, sr, f); + describe(out, r, f); if (markets_module() && r->land) { const item_type *lux = r_luxury(r); const item_type *herb = r->land->herbtype; @@ -2359,27 +2304,27 @@ const char *charset) write_travelthru(out, r, f); } else { - if (sr->mode == see_far) { - describe(out, sr, f); + if (r->seen.mode == seen_far) { + describe(out, r, f); newline(out); guards(out, r, f); newline(out); write_travelthru(out, r, f); } else { - describe(out, sr, f); + describe(out, r, f); newline(out); write_travelthru(out, r, f); } } /* Statistik */ - if (wants_stats && sr->mode == see_unit) + if (wants_stats && r->seen.mode == seen_unit) statistics(out, r, f); /* Nachrichten an REGION in der Region */ - if (sr->mode == see_unit || sr->mode == see_travel) { + if (r->seen.mode == seen_unit || r->seen.mode == seen_travel) { // TODO: Bug 2073 message_list *mlist = r_getmessages(r, f); if (mlist) { @@ -2396,13 +2341,13 @@ const char *charset) u = r->units; while (b) { while (b && (!u || u->building != b)) { - nr_building(out, sr, b, f); + nr_building(out, r, b, f); b = b->next; } if (b) { - nr_building(out, sr, b, f); + nr_building(out, r, b, f); while (u && u->building == b) { - nr_unit(out, f, u, 6, sr->mode); + nr_unit(out, f, u, 6, r->seen.mode); u = u->next; } b = b->next; @@ -2411,7 +2356,7 @@ const char *charset) while (u && !u->ship) { if (stealthmod > INT_MIN) { if (u->faction == f || cansee(f, r, u, stealthmod)) { - nr_unit(out, f, u, 4, sr->mode); + nr_unit(out, f, u, 4, r->seen.mode); } } assert(!u->building); @@ -2419,13 +2364,13 @@ const char *charset) } while (sh) { while (sh && (!u || u->ship != sh)) { - nr_ship(out, sr, sh, f, NULL); + nr_ship(out, r, sh, f, NULL); sh = sh->next; } if (sh) { - nr_ship(out, sr, sh, f, u); + nr_ship(out, r, sh, f, u); while (u && u->ship == sh) { - nr_unit(out, f, u, 6, sr->mode); + nr_unit(out, f, u, 6, r->seen.mode); u = u->next; } sh = sh->next; @@ -2487,74 +2432,12 @@ unit *can_find(faction * f, faction * f2) if (ss) { /* bei TARNE PARTEI yxz muss die Partei von unit proof nicht * wirklich Partei f2 sein! */ - /* assert(ss->proof->faction==f2); */ + /* assert(ss->proof->faction==f2); */ return ss->proof; } return NULL; } -static void add_find(faction * f, unit * u, faction * f2) -{ - /* faction f sees f2 through u */ - int key = f->no % FMAXHASH; - struct fsee **fp = &fsee[key]; - struct fsee *fs; - struct see **sp; - struct see *ss; - while (*fp && (*fp)->f != f) - fp = &(*fp)->nexthash; - if (!*fp) { - fs = *fp = calloc(sizeof(struct fsee), 1); - fs->f = f; - } - else - fs = *fp; - sp = &fs->see; - while (*sp && (*sp)->seen != f2) - sp = &(*sp)->next; - if (!*sp) { - ss = *sp = calloc(sizeof(struct see), 1); - ss->proof = u; - ss->seen = f2; - } - else - ss = *sp; - ss->proof = u; -} - -static void update_find(void) -{ - region *r; - static bool initial = true; - - if (initial) - for (r = regions; r; r = r->next) { - unit *u; - for (u = r->units; u; u = u->next) { - faction *lastf = u->faction; - unit *u2; - for (u2 = r->units; u2; u2 = u2->next) { - if (u2->faction == lastf || u2->faction == u->faction) - continue; - if (seefaction(u->faction, r, u2, 0)) { - faction *fv = visible_faction(u->faction, u2); - lastf = fv; - add_find(u->faction, u2, fv); - } - } - } - } - initial = false; -} - -bool kann_finden(faction * f1, faction * f2) -{ - update_find(); - return (bool)(can_find(f1, f2) != NULL); -} - -/******* end summary ******/ - void register_nr(void) { if (!nocr) diff --git a/src/report.h b/src/report.h index 66eb4a4b9..84a6c66d4 100644 --- a/src/report.h +++ b/src/report.h @@ -23,10 +23,11 @@ extern "C" { struct spellbook_entry; struct region; struct faction; + struct locale; void register_nr(void); void report_cleanup(void); void write_spaces(struct stream *out, size_t num); - void write_travelthru(struct stream *out, const struct region * r, const struct faction * f); + void write_travelthru(struct stream *out, struct region * r, const struct faction * f); void nr_spell_syntax(struct stream *out, struct spellbook_entry * sbe, const struct locale *lang); void nr_spell(struct stream *out, struct spellbook_entry * sbe, const struct locale *lang); diff --git a/src/report.test.c b/src/report.test.c new file mode 100644 index 000000000..202458db5 --- /dev/null +++ b/src/report.test.c @@ -0,0 +1,241 @@ +#include +#include "report.h" +#include "move.h" +#include "travelthru.h" +#include "keyword.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +static void test_write_spaces(CuTest *tc) { + stream out = { 0 }; + char buf[1024]; + size_t len; + + mstream_init(&out); + write_spaces(&out, 4); + out.api->rewind(out.handle); + len = out.api->read(out.handle, buf, sizeof(buf)); + buf[len] = '\0'; + CuAssertStrEquals(tc, " ", buf); + CuAssertIntEquals(tc, ' ', buf[3]); + mstream_done(&out); +} + +static void test_write_many_spaces(CuTest *tc) { + stream out = { 0 }; + char buf[1024]; + size_t len; + + mstream_init(&out); + write_spaces(&out, 100); + out.api->rewind(out.handle); + len = out.api->read(out.handle, buf, sizeof(buf)); + buf[len] = '\0'; + CuAssertIntEquals(tc, 100, (int)len); + CuAssertIntEquals(tc, ' ', buf[99]); + mstream_done(&out); +} + +static void test_write_travelthru(CuTest *tc) { + stream out = { 0 }; + char buf[1024]; + size_t len; + region *r; + faction *f; + unit *u; + struct locale *lang; + + test_cleanup(); + lang = get_or_create_locale("de"); + locale_setstring(lang, "travelthru_header", "Durchreise: "); + mstream_init(&out); + r = test_create_region(0, 0, 0); + r->flags |= RF_TRAVELUNIT; + f = test_create_faction(0); + f->locale = lang; + u = test_create_unit(f, test_create_region(0, 1, 0)); + unit_setname(u, "Hodor"); + unit_setid(u, 1); + + write_travelthru(&out, r, f); + out.api->rewind(out.handle); + len = out.api->read(out.handle, buf, sizeof(buf)); + CuAssertIntEquals_Msg(tc, "no travelers, no report", 0, (int)len); + mstream_done(&out); + + mstream_init(&out); + travelthru_add(r, u); + write_travelthru(&out, r, f); + out.api->rewind(out.handle); + len = out.api->read(out.handle, buf, sizeof(buf)); + buf[len] = '\0'; + CuAssertStrEquals_Msg(tc, "list one unit", "Durchreise: Hodor (1).\n", buf); + mstream_done(&out); + + mstream_init(&out); + move_unit(u, r, 0); + write_travelthru(&out, r, f); + out.api->rewind(out.handle); + len = out.api->read(out.handle, buf, sizeof(buf)); + CuAssertIntEquals_Msg(tc, "do not list units that stopped in the region", 0, (int)len); + + mstream_done(&out); + test_cleanup(); +} + +typedef struct { + struct locale *lang; + spell *sp; + spellbook *spb; + spellbook_entry * sbe; +} spell_fixture; + +static void setup_spell_fixture(spell_fixture * spf) { + spf->lang = test_create_locale(); + locale_setstring(spf->lang, mkname("spell", "testspell"), "Testzauber"); + locale_setstring(spf->lang, "nr_spell_type", "Typ:"); + locale_setstring(spf->lang, "sptype_normal", "Normal"); + locale_setstring(spf->lang, "nr_spell_modifiers", "Modifier:"); + locale_setstring(spf->lang, "smod_none", "Keine"); + locale_setstring(spf->lang, keyword(K_CAST), "ZAUBERE"); + locale_setstring(spf->lang, parameters[P_REGION], "REGION"); + locale_setstring(spf->lang, parameters[P_LEVEL], "STUFE"); + locale_setstring(spf->lang, "par_unit", "enr"); + locale_setstring(spf->lang, "par_ship", "snr"); + locale_setstring(spf->lang, "par_building", "bnr"); + locale_setstring(spf->lang, "spellpar::hodor", "Hodor"); + + spf->spb = create_spellbook("testbook"); + spf->sp = test_create_spell(); + spellbook_add(spf->spb, spf->sp, 1); + spf->sbe = spellbook_get(spf->spb, spf->sp); +} + +static void cleanup_spell_fixture(spell_fixture *spf) { + spellbook_clear(spf->spb); + free(spf->spb); + test_cleanup(); +} + +static void set_parameter(spell_fixture spell, char *value) { + free(spell.sp->parameter); + spell.sp->parameter = _strdup(value); +} + +static void check_spell_syntax(CuTest *tc, char *msg, spell_fixture *spell, char *syntax) { + stream strm; + char buf[1024]; + char *linestart, *newline; + size_t len; + + mstream_init(&strm); + nr_spell_syntax(&strm, spell->sbe, spell->lang); + strm.api->rewind(strm.handle); + len = strm.api->read(strm.handle, buf, sizeof(buf)); + buf[len] = '\0'; + + linestart = strtok(buf, "\n"); + while (linestart && !strstr(linestart, "ZAUBERE")) + linestart = strtok(NULL, "\n"); + + CuAssertPtrNotNull(tc, linestart); + + newline = strtok(NULL, "\n"); + while (newline) { + *(newline - 1) = '\n'; + newline = strtok(NULL, "\n"); + } + + CuAssertStrEquals_Msg(tc, msg, syntax, linestart); + + mstream_done(&strm); +} + +static void test_write_spell_syntax(CuTest *tc) { + spell_fixture spell; + + test_cleanup(); + setup_spell_fixture(&spell); + + check_spell_syntax(tc, "vanilla", &spell, " ZAUBERE \"Testzauber\""); + + spell.sp->sptyp |= FARCASTING; + check_spell_syntax(tc, "far", &spell, " ZAUBERE [REGION x y] \"Testzauber\""); + + spell.sp->sptyp |= SPELLLEVEL; + check_spell_syntax(tc, "farlevel", &spell, " ZAUBERE [REGION x y] [STUFE n] \"Testzauber\""); + spell.sp->sptyp = 0; + + set_parameter(spell, "kc"); + check_spell_syntax(tc, "kc", &spell, " ZAUBERE \"Testzauber\" ( REGION | EINHEIT | SCHIFF | BURG )"); + + spell.sp->sptyp |= BUILDINGSPELL; + check_spell_syntax(tc, "kc typed", &spell, " ZAUBERE \"Testzauber\" BURG "); + spell.sp->sptyp = 0; + + set_parameter(spell, "b"); + check_spell_syntax(tc, "b", &spell, " ZAUBERE \"Testzauber\" "); + + set_parameter(spell, "s"); + check_spell_syntax(tc, "s", &spell, " ZAUBERE \"Testzauber\" "); + + set_parameter(spell, "s+"); + check_spell_syntax(tc, "s+", &spell, " ZAUBERE \"Testzauber\" [ ...]"); + + set_parameter(spell, "u"); + check_spell_syntax(tc, "u", &spell, " ZAUBERE \"Testzauber\" "); + + set_parameter(spell, "r"); + check_spell_syntax(tc, "r", &spell, " ZAUBERE \"Testzauber\" "); + + set_parameter(spell, "bc"); + free(spell.sp->syntax); + spell.sp->syntax = _strdup("hodor"); + check_spell_syntax(tc, "bc hodor", &spell, " ZAUBERE \"Testzauber\" "); + free(spell.sp->syntax); + spell.sp->syntax = 0; + + set_parameter(spell, "c?"); + free(spell.sp->syntax); + spell.sp->syntax = _strdup("hodor"); + check_spell_syntax(tc, "c?", &spell, " ZAUBERE \"Testzauber\" []"); + free(spell.sp->syntax); + spell.sp->syntax = 0; + + set_parameter(spell, "kc+"); + check_spell_syntax(tc, "kc+", &spell, + " ZAUBERE \"Testzauber\" ( REGION | EINHEIT [ ...] | SCHIFF \n [ ...] | BURG [ ...] )"); + + cleanup_spell_fixture(&spell); +} + +CuSuite *get_report_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_write_spaces); + SUITE_ADD_TEST(suite, test_write_many_spaces); + SUITE_ADD_TEST(suite, test_write_travelthru); + SUITE_ADD_TEST(suite, test_write_spell_syntax); + return suite; +} diff --git a/src/reports.c b/src/reports.c index 8dfd055c4..a8b9e5cfb 100644 --- a/src/reports.c +++ b/src/reports.c @@ -19,8 +19,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include "reports.h" +#include "guard.h" #include "laws.h" -#include "seen.h" #include "travelthru.h" #include "lighthouse.h" #include "donations.h" @@ -105,13 +105,42 @@ const char *coasts[MAXDIRECTIONS] = { "coast::w" }; +const char *options[MAXOPTIONS] = { + "AUSWERTUNG", + "COMPUTER", + "ZUGVORLAGE", + NULL, + "STATISTIK", + "DEBUG", + "ZIPPED", + "ZEITUNG", /* Option hat Sonderbehandlung! */ + NULL, + "ADRESSEN", + "BZIP2", + "PUNKTE", + "SHOWSKCHANGE" +}; + +bool omniscient(const faction *f) +{ + static const race *rc_template, *rc_illusion; + static int cache; + if (rc_changed(&cache)) { + rc_illusion = get_race(RC_ILLUSION); + rc_template = get_race(RC_TEMPLATE); + } + return (f->race == rc_template || f->race == rc_illusion); +} + + + static char *groupid(const struct group *g, const struct faction *f) { typedef char name[OBJECTIDSIZE + 1]; static name idbuf[8]; static int nextbuf = 0; char *buf = idbuf[(++nextbuf) % 8]; - sprintf(buf, "%s (%s)", g->name, factionid(f)); + sprintf(buf, "%s (%s)", g->name, itoa36(f->no)); return buf; } @@ -129,9 +158,9 @@ size_t report_status(const unit * u, const struct locale *lang, char *fsbuf, siz if (!status) { const char *lname = locale_name(lang); struct locale *wloc = get_or_create_locale(lname); - log_error("no translation for combat status %s in %s", combatstatus[u->status], lname); - locale_setstring(wloc, combatstatus[u->status], combatstatus[u->status]); - len = strlcpy(fsbuf, combatstatus[u->status], buflen); + log_warning("no translation for combat status %s in %s", combatstatus[u->status], lname); + locale_setstring(wloc, combatstatus[u->status], combatstatus[u->status]+7); + len = strlcpy(fsbuf, combatstatus[u->status]+7, buflen); } else { len = strlcpy(fsbuf, status, buflen); @@ -265,16 +294,24 @@ static size_t buforder(char *buffer, size_t size, const order * ord, int mode) * \param viewer: the faction looking at the items */ int -report_items(const item * items, item * result, int size, const unit * owner, -const faction * viewer) +report_items(const unit *u, item * result, int size, const unit * owner, + const faction * viewer) { - const item *itm; + const item *itm, *items = u->items; int n = 0; /* number of results */ - assert(owner == NULL || viewer != owner->faction - || !"not required for owner=viewer!"); + assert(owner == NULL || viewer != owner->faction); assert(size); + if (u->attribs) { + const curse_type *itemcloak_ct = ct_find("itemcloak"); + if (itemcloak_ct) { + curse * cu = get_curse(u->attribs, itemcloak_ct); + if (cu && curse_active(cu)) { + return 0; + } + } + } for (itm = items; itm; itm = itm->next) { item *ishow; const char *ic; @@ -344,16 +381,13 @@ void report_building(const struct building *b, const char **name, const char **illusion) { - const struct building_type *bt_illusion; - if (name) { *name = buildingtype(b->type, b, b->size); } if (illusion) { *illusion = NULL; - bt_illusion = bt_find("illusioncastle"); - if (bt_illusion && b->type == bt_illusion) { + if (is_building_type(b->type, "illusioncastle")) { const attrib *a = a_find(b->attribs, &at_icastle); if (a != NULL) { *illusion = buildingtype(icastle_type(a), b, b->size); @@ -363,10 +397,9 @@ const char **illusion) } int -report_resources(const seen_region * sr, resource_report * result, int size, -const faction * viewer) +report_resources(const region * r, resource_report * result, int size, +const faction * viewer, bool see_unit) { - const region *r = sr->r; int n = 0; if (r->land) { @@ -411,7 +444,7 @@ const faction * viewer) } } - if (sr->mode >= see_unit) { + if (see_unit) { rawmaterial *res = r->resources; while (res) { int maxskill = 0; @@ -447,31 +480,23 @@ const faction * viewer) } int -bufunit(const faction * f, const unit * u, unsigned int indent, int mode, char *buf, +bufunit(const faction * f, const unit * u, unsigned int indent, seen_mode mode, char *buf, size_t size) { int i, dh; int getarnt = fval(u, UFL_ANON_FACTION); const char *pzTmp, *str; building *b; - bool isbattle = (bool)(mode == see_battle); - int telepath_see = 0; - item *itm; - item *show; - faction *fv = visible_faction(f, u); + bool isbattle = (bool)(mode == seen_battle); + item *itm, *show = NULL; + faction *fv; char *bufp = buf; - bool itemcloak = false; - const curse_type *itemcloak_ct = 0; int result = 0; item results[MAX_INVENTORY]; - itemcloak_ct = ct_find("itemcloak"); - if (itemcloak_ct) { - itemcloak = curse_active(get_curse(u->attribs, itemcloak_ct)); - } - + assert(f); bufp = STRLCPY(bufp, unitname(u), size); - + fv = visible_faction(f, u); if (!isbattle) { attrib *a_otherfaction = a_find(u->attribs, &at_otherfaction); if (u->faction == f) { @@ -553,7 +578,7 @@ size_t size) } /* status */ - if (u->number && (u->faction == f || telepath_see || isbattle)) { + if (u->number && (u->faction == f || isbattle)) { const char *c = hp_status(u); c = c ? LOC(f->locale, c) : 0; bufp = STRLCPY(bufp, ", ", size); @@ -575,7 +600,7 @@ size_t size) } } } - if (is_guard(u, GUARD_ALL) != 0) { + if (is_guard(u)) { bufp = STRLCPY(bufp, ", ", size); bufp = STRLCPY(bufp, LOC(f->locale, "unit_guards"), size); } @@ -586,7 +611,7 @@ size_t size) } dh = 0; - if (u->faction == f || telepath_see) { + if (u->faction == f) { skill *sv; for (sv = u->skills; sv != u->skills + u->skill_size; ++sv) { size_t bytes = spskill(bufp, size, f->locale, u, sv, &dh, 1); @@ -597,19 +622,15 @@ size_t size) } dh = 0; - if (f == u->faction || telepath_see || omniscient(f)) { + if (f == u->faction || omniscient(f)) { show = u->items; } - else if (!itemcloak && mode >= see_unit) { - int n = report_items(u->items, results, MAX_INVENTORY, u, f); + else if (mode >= seen_unit) { + int n = report_items(u, results, MAX_INVENTORY, u, f); assert(n >= 0); - if (n > 0) + if (n > 0) { show = results; - else - show = NULL; - } - else { - show = NULL; + } } for (itm = show; itm; itm = itm->next) { const char *ic; @@ -634,7 +655,7 @@ size_t size) } } - if (u->faction == f || telepath_see) { + if (u->faction == f) { spellbook *book = unit_get_spellbook(u); if (book) { @@ -699,7 +720,7 @@ size_t size) } } if (!isbattle) { - bool printed = 0; + int printed = 0; order *ord;; for (ord = u->old_orders; ord; ord = ord->next) { keyword_t kwd = getkeyword(ord); @@ -750,7 +771,7 @@ size_t size) } dh = 0; - if (!getarnt && f) { + if (!getarnt) { if (alliedfaction(rplane(u->region), f, fv, HELP_ALL)) { dh = 1; } @@ -761,11 +782,6 @@ size_t size) return dh; } -/* TODO: telepath_see wird nicht berücksichtigt: Parteien mit - * telepath_see sollten immer einzelne Einheiten zu sehen - * bekommen, alles andere ist darstellungsteschnisch kompliziert. - */ - size_t spskill(char *buffer, size_t size, const struct locale * lang, const struct unit * u, struct skill * sv, int *dh, int days) @@ -903,7 +919,7 @@ void lparagraph(struct strlist **SP, char *s, unsigned int indent, char mark) void spunit(struct strlist **SP, const struct faction *f, const unit * u, unsigned int indent, -int mode) +seen_mode mode) { char buf[DISPLAYSIZE]; int dh = bufunit(f, u, indent, mode, buf, sizeof(buf)); @@ -942,15 +958,15 @@ const struct unit *ucansee(const struct faction *f, const struct unit *u, return x; } -int stealth_modifier(int seen_mode) +int stealth_modifier(seen_mode mode) { - switch (seen_mode) { - case see_unit: + switch (mode) { + case seen_unit: return 0; - case see_far: - case see_lighthouse: + case seen_far: + case seen_lighthouse: return -2; - case see_travel: + case seen_travel: return -1; default: return INT_MIN; @@ -1016,7 +1032,6 @@ static void add_travelthru_addresses(region *r, faction *f, quicklist **flist, i static void get_addresses(report_context * ctx) { /* "TODO: travelthru" */ - seen_region *sr = NULL; region *r; const faction *lastf = NULL; quicklist *flist = 0; @@ -1035,14 +1050,13 @@ static void get_addresses(report_context * ctx) } /* find the first region that this faction can see */ - for (r = ctx->first; sr == NULL && r != ctx->last; r = r->next) { - sr = find_seen(ctx->f->seen, r); + for (r = ctx->first; r != ctx->last; r = r->next) { + if (r->seen.mode > seen_none) break; } - for (; sr != NULL; sr = sr->next) { - int stealthmod = stealth_modifier(sr->mode); - r = sr->r; - if (sr->mode == see_lighthouse) { + for (; r != NULL; r = r->next) { + int stealthmod = stealth_modifier(r->seen.mode); + if (r->seen.mode == seen_lighthouse) { unit *u = r->units; for (; u; u = u->next) { faction *sf = visible_faction(ctx->f, u); @@ -1055,12 +1069,12 @@ static void get_addresses(report_context * ctx) } } } - else if (sr->mode == see_travel) { + else if (r->seen.mode == seen_travel) { /* when we travel through a region, then we must add * the factions of any units we saw */ add_travelthru_addresses(r, ctx->f, &flist, stealthmod); } - else if (sr->mode > see_travel) { + else if (r->seen.mode > seen_travel) { const unit *u = r->units; while (u != NULL) { if (u->faction != ctx->f) { @@ -1107,6 +1121,15 @@ void register_reporttype(const char *extension, report_fun write, int flag) report_types = type; } +void reports_done(void) { + report_type **rtp = &report_types; + while (*rtp) { + report_type *rt = *rtp; + *rtp = rt->next; + free(rt); + } +} + static quicklist *get_regions_distance(region * root, int radius) { quicklist *ql, *rlist = NULL; @@ -1137,130 +1160,43 @@ static quicklist *get_regions_distance(region * root, int radius) return rlist; } -void view_default(struct seen_region **seen, region * r, faction * f) -{ - int dir; - for (dir = 0; dir != MAXDIRECTIONS; ++dir) { - region *r2 = rconnect(r, dir); - if (r2) { - connection *b = get_borders(r, r2); - while (b) { - if (!b->type->transparent(b, f)) - break; - b = b->next; - } - if (!b) - add_seen(seen, r2, see_neighbour, false); - } +static void add_seen(region *r, seen_mode mode) { + if (r->seen.mode < mode) { + r->seen.mode = mode; } } -void view_neighbours(struct seen_region **seen, region * r, faction * f) -{ - int d; - region * nb[MAXDIRECTIONS]; - - get_neighbours(r, nb); - for (d = 0; d != MAXDIRECTIONS; ++d) { - region *r2 = nb[d]; - if (r2) { - connection *b = get_borders(r, r2); - while (b) { - if (!b->type->transparent(b, f)) - break; - b = b->next; - } - if (!b) { - if (add_seen(seen, r2, see_far, false)) { - if (!(fval(r2->terrain, FORBIDDEN_REGION))) { - int dir; - for (dir = 0; dir != MAXDIRECTIONS; ++dir) { - region *r3 = rconnect(r2, dir); - if (r3) { - connection *b = get_borders(r2, r3); - while (b) { - if (!b->type->transparent(b, f)) - break; - b = b->next; - } - if (!b) - add_seen(seen, r3, see_neighbour, false); - } - } - } - } +static void add_seen_nb(faction *f, region *r, seen_mode mode) { + region *first = r, *last = r; + add_seen(r, mode); + if (mode > seen_neighbour) { + region *next[MAXDIRECTIONS]; + int d; + get_neighbours(r, next); + for (d = 0; d != MAXDIRECTIONS; ++d) { + region *rn = next[d]; + if (rn && rn->seen.modeindex>rn->index) first = rn; + if (last->indexindex) last = rn; } } } + update_interval(f, first); + update_interval(f, last); } -static void -recurse_regatta(struct seen_region **seen, region * center, region * r, -faction * f, int maxdist) +/** mark all regions seen by the lighthouse. + */ +static void prepare_lighthouse(faction *f, region *r, int range) { - int d; - int dist = distance(center, r); - region * nb[MAXDIRECTIONS]; - - get_neighbours(r, nb); - for (d = 0; d != MAXDIRECTIONS; ++d) { - region *r2 = nb[d]; - if (r2) { - int ndist = distance(center, r2); - if (ndist > dist && fval(r2->terrain, SEA_REGION)) { - connection *b = get_borders(r, r2); - while (b) { - if (!b->type->transparent(b, f)) - break; - b = b->next; - } - if (!b) { - if (ndist < maxdist) { - if (add_seen(seen, r2, see_far, false)) { - recurse_regatta(seen, center, r2, f, maxdist); - } - } - else - add_seen(seen, r2, see_neighbour, false); - } - } - } - } -} - -static void view_regatta(struct seen_region **seen, region * r, faction * f) -{ - unit *u; - int skill = 0; - for (u = r->units; u; u = u->next) { - if (u->faction == f) { - int es = effskill(u, SK_PERCEPTION, 0); - if (es > skill) - skill = es; - } - } - recurse_regatta(seen, r, r, f, skill / 2); -} - -static void prepare_lighthouse(building * b, faction * f) -{ - int range = lighthouse_range(b, f); - quicklist *ql, *rlist = get_regions_distance(b->region, range); + quicklist *ql, *rlist = get_regions_distance(r, range); int qi; for (ql = rlist, qi = 0; ql; ql_advance(&ql, &qi, 1)) { region *rl = (region *)ql_get(ql, qi); if (!fval(rl->terrain, FORBIDDEN_REGION)) { - region * next[MAXDIRECTIONS]; - int d; - - get_neighbours(rl, next); - faction_add_seen(f, rl, see_lighthouse); - for (d = 0; d != MAXDIRECTIONS; ++d) { - if (next[d]) { - faction_add_seen(f, next[d], see_neighbour); - } - } + add_seen_nb(f, rl, seen_lighthouse); } } ql_free(rlist); @@ -1364,116 +1300,13 @@ void reorder_units(region * r) } } -static void cb_add_seen(region *r, unit *u, void *cbdata) { - unused_arg(cbdata); - if (u->faction) { - faction_add_seen(u->faction, r, see_travel); - } -} - -static void prepare_reports(void) -{ - region *r; - faction *f; - building *b; - const struct building_type *bt_lighthouse = bt_find("lighthouse"); - - for (f = factions; f; f = f->next) { - if (f->seen) seen_done(f->seen); - f->seen = seen_init(); - } - - for (r = regions; r; r = r->next) { - unit *u; - - reorder_units(r); - - /* Region owner get always the Lighthouse report */ - if (bt_lighthouse && config_token("rules.region_owner_pay_building", bt_lighthouse->_name)) { - for (b = rbuildings(r); b; b = b->next) { - if (b && b->type == bt_lighthouse) { - u = building_owner(b); - if (u) { - prepare_lighthouse(b, u->faction); - if (u_race(u) != get_race(RC_SPELL) || u->number == RS_FARVISION) { - seen_region *sr = faction_add_seen(u->faction, r, see_unit); - if (fval(u, UFL_DISBELIEVES)) { - sr->disbelieves = true; - } - } - } - } - } - } - - for (u = r->units; u; u = u->next) { - if (u->building && u->building->type == bt_lighthouse) { - /* we are in a lighthouse. add the regions we can see from here! */ - prepare_lighthouse(u->building, u->faction); - } - - if (u_race(u) != get_race(RC_SPELL) || u->number == RS_FARVISION) { - seen_region *sr = faction_add_seen(u->faction, r, see_unit); - if (fval(u, UFL_DISBELIEVES)) { - sr->disbelieves = true; - } - } - } - - - if (fval(r, RF_TRAVELUNIT)) { - travelthru_map(r, cb_add_seen, r); - } - } -} - -static void cb_set_last(region *r, unit *u, void *cbdata) { - faction *f = (faction *)cbdata; - if (u->faction == f) { - f->last = r; - } -} - static region *lastregion(faction * f) { -#ifdef SMART_INTERVALS - unit *u = f->units; - region *r = f->last; - - if (u == NULL) - return NULL; - if (r != NULL) - return r->next; - - /* it is safe to start in the region of the first unit. */ - f->last = u->region; - /* if regions have indices, we can skip ahead: */ - for (u = u->nextF; u != NULL; u = u->nextF) { - r = u->region; - if (r->index > f->last->index) - f->last = r; - } - - /* we continue from the best region and look for travelthru etc. */ - for (r = f->last->next; r; r = r->next) { - /* search the region for travelthru-attributes: */ - if (fval(r, RF_TRAVELUNIT)) { - travelthru_map(r, cb_set_last, f); - } - if (f->last == r) - continue; - if (check_leuchtturm(r, f)) - f->last = r; - } - return f->last->next; -#else - return NULL; -#endif + return f->last ? f->last->next : NULL; } static region *firstregion(faction * f) { -#ifdef SMART_INTERVALS region *r = f->first; if (f->units == NULL) @@ -1482,59 +1315,96 @@ static region *firstregion(faction * f) return r; return f->first = regions; -#else - return regions; -#endif } -static void cb_view_neighbours(seen_region *sr, void *cbdata) { +static void cb_add_seen(region *r, unit *u, void *cbdata) { faction *f = (faction *)cbdata; - if (sr->mode > see_neighbour) { - region *r = sr->r; - plane *p = rplane(r); - void(*view) (struct seen_region **, region *, faction *) = view_default; - - if (p && fval(p, PFL_SEESPECIAL)) { - /* TODO: this is not very customizable */ - view = (strcmp(p->name, "Regatta") == 0) ? view_regatta : view_neighbours; - } - view(f->seen, r, f); + if (u->faction==f) { + add_seen_nb(f, r, seen_travel); } } -void prepare_seen(faction *f) +/** set region.seen based on visibility by one faction. + * + * this function may also update ctx->last and ctx->first for potential + * lighthouses and travelthru reports + */ +void prepare_report(report_context *ctx, faction *f) { region *r; - struct seen_region *sr; + static int config; + static bool rule_region_owners; + const struct building_type *bt_lighthouse = bt_find("lighthouse"); - for (r = f->first, sr = NULL; sr == NULL && r != f->last; r = r->next) { - sr = find_seen(f->seen, r); + if (bt_lighthouse && config_changed(&config)) { + rule_region_owners = config_token("rules.region_owner_pay_building", bt_lighthouse->_name); } - seenhash_map(f->seen, cb_view_neighbours, f); - get_seen_interval(f->seen, &f->first, &f->last); - link_seen(f->seen, f->first, f->last); -} - -static void prepare_report(struct report_context *ctx, faction *f) -{ - prepare_seen(f); ctx->f = f; ctx->report_time = time(NULL); ctx->addresses = NULL; ctx->userdata = NULL; + // [first,last) interval of regions with a unit in it: + ctx->first = firstregion(f); + ctx->last = lastregion(f); + + for (r = ctx->first; r!=ctx->last; r = r->next) { + int range = 0; + unit *u; + if (fval(r, RF_LIGHTHOUSE) && bt_lighthouse) { + if (rule_region_owners && f == region_get_owner(r)) { + /* region owners get the report from lighthouses */ + building *b; + + for (b = r->buildings; b; b = b->next) { + if (b->type == bt_lighthouse) { + int br = lighthouse_range(b, NULL); + if (br > range) range = br; + } + } + } + } + for (u = r->units; u; u = u->next) { + if (u->faction == f) { + add_seen_nb(f, r, seen_unit); + if (fval(r, RF_LIGHTHOUSE) && bt_lighthouse) { + if (u->building && u->building->type == bt_lighthouse && inside_building(u)) { + int br = lighthouse_range(u->building, f); + if (br > range) range = br; + } + } + } + } + if (range > 0) { + /* we are in at least one lighthouse. add the regions we can see from here! */ + prepare_lighthouse(f, r, range); + } + + if (fval(r, RF_TRAVELUNIT) && r->seen.modefirst = firstregion(f); ctx->last = lastregion(f); } +void finish_reports(report_context *ctx) { + region *r; + ql_free(ctx->addresses); + for (r = ctx->first; r != ctx->last; r = r->next) { + r->seen.mode = seen_none; + } +} + int write_reports(faction * f, time_t ltime) { - unsigned int backup = 1, maxbackup = 128 * 1000; bool gotit = false; struct report_context ctx; - const char *encoding = "UTF-8"; + const unsigned char utf8_bom[4] = { 0xef, 0xbb, 0xbf, 0 }; report_type *rtype; - if (noreports) { return false; } @@ -1547,35 +1417,25 @@ int write_reports(faction * f, time_t ltime) do { char filename[32]; char path[MAX_PATH]; - sprintf(filename, "%d-%s.%s", turn, factionid(f), + sprintf(filename, "%d-%s.%s", turn, itoa36(f->no), rtype->extension); join_path(reportpath(), filename, path, sizeof(path)); errno = 0; - if (rtype->write(path, &ctx, encoding) == 0) { + if (rtype->write(path, &ctx, (const char *)utf8_bom) == 0) { gotit = true; } if (errno) { - char zText[64]; - log_warning("retrying, error %d during %s report for faction %s", errno, rtype->extension, factionname(f)); - sprintf(zText, "waiting %u seconds before we retry", backup); - perror(zText); - _sleep(backup); - if (backup < maxbackup) { - backup *= 2; - } error = errno; + log_fatal("error %d during %s report for faction %s: %s", errno, rtype->extension, factionname(f), strerror(error)); errno = 0; } } while (error); } } if (!gotit) { - log_warning("No report for faction %s!", factionid(f)); - } - ql_free(ctx.addresses); - if (ctx.f->seen) { - seen_done(ctx.f->seen); + log_warning("No report for faction %s!", itoa36(f->no)); } + finish_reports(&ctx); return 0; } @@ -1584,7 +1444,7 @@ static void write_script(FILE * F, const faction * f) report_type *rtype; char buf[1024]; - fprintf(F, "faction=%s:email=%s:lang=%s", factionid(f), f->email, + fprintf(F, "faction=%s:email=%s:lang=%s", itoa36(f->no), f->email, locale_name(f->locale)); if (f->options & (1 << O_BZIP2)) fputs(":compression=bz2", F); @@ -1611,9 +1471,12 @@ static void check_messages_exist(void) { int init_reports(void) { + region *r; check_messages_exist(); create_directories(); - prepare_reports(); + for (r = regions; r; r = r->next) { + reorder_units(r); + } return 0; } @@ -1645,7 +1508,6 @@ int reports(void) } if (mailit) fclose(mailit); - free_seen(); return retval; } @@ -1716,7 +1578,7 @@ static void var_free_resources(variant x) x.v = 0; } -static void var_free_regions(variant x) +static void var_free_regions(variant x) //-V524 { free(x.v); } @@ -1764,11 +1626,9 @@ f_regionid(const region * r, const faction * f, char *buffer, size_t size) static char *f_regionid_s(const region * r, const faction * f) { - static int i = 0; - static char bufs[4][NAMESIZE + 20]; // FIXME: static return value - char *buf = bufs[(++i) % 4]; + static char buf[NAMESIZE + 20]; // FIXME: static return value - f_regionid(r, f, buf, NAMESIZE + 20); + f_regionid(r, f, buf, sizeof(buf)); return buf; } @@ -1847,18 +1707,6 @@ static void eval_curse(struct opstack **stack, const void *userdata) opush(stack, var); } -static void eval_unitname(struct opstack **stack, const void *userdata) -{ /* unit -> string */ - const struct faction *f = (const struct faction *)userdata; - const struct unit *u = (const struct unit *)opop(stack).v; - const char *c = u ? unit_getname(u) : LOC(f->locale, "an_unknown_unit"); - size_t len = strlen(c); - variant var; - - var.v = strcpy(balloc(len + 1), c); - opush(stack, var); -} - static void eval_unitid(struct opstack **stack, const void *userdata) { /* unit -> int */ const struct faction *f = (const struct faction *)userdata; @@ -1967,16 +1815,16 @@ static void eval_weight(struct opstack **stack, const void *userdata) sprintf(buffer, "1 %s", LOC(lang, "weight_unit")); } else { - sprintf(buffer, "%u %s", weight / SCALEWEIGHT, LOC(lang, + sprintf(buffer, "%d %s", weight / SCALEWEIGHT, LOC(lang, "weight_unit_p")); } } else { if (weight == 1) { - sprintf(buffer, "1 %s %u", LOC(lang, "weight_per"), SCALEWEIGHT); + sprintf(buffer, "1 %s %d", LOC(lang, "weight_per"), SCALEWEIGHT); } else { - sprintf(buffer, "%u %s %u", weight, LOC(lang, "weight_per_p"), + sprintf(buffer, "%d %s %d", weight, LOC(lang, "weight_per_p"), SCALEWEIGHT); } } @@ -2176,26 +2024,6 @@ static void eval_int36(struct opstack **stack, const void *userdata) /*** END MESSAGE RENDERING ***/ -/* - String Listen --------------------------------------------- */ -void addstrlist(strlist ** SP, const char *s) -{ - strlist *slist = malloc(sizeof(strlist)); - slist->next = NULL; - slist->s = _strdup(s); - addlist(SP, slist); -} - -void freestrlist(strlist * s) -{ - strlist *q, *p = s; - while (p) { - q = p->next; - free(p->s); - free(p); - p = q; - } -} - #include static void log_orders(const struct message *msg) @@ -2287,7 +2115,6 @@ void register_reports(void) add_function("ship", &eval_ship); add_function("unit", &eval_unit); add_function("unit.dative", &eval_unit_dative); - add_function("unit.name", &eval_unitname); add_function("unit.id", &eval_unitid); add_function("unit.size", &eval_unitsize); add_function("building", &eval_building); @@ -2302,8 +2129,4 @@ void register_reports(void) add_function("resources", &eval_resources); add_function("regions", &eval_regions); add_function("trail", &eval_trail); - - /* register alternative visibility functions */ - register_function((pf_generic)view_neighbours, "view_neighbours"); - register_function((pf_generic)view_regatta, "view_regatta"); } diff --git a/src/reports.h b/src/reports.h index 2c71803c3..e5fd976e3 100644 --- a/src/reports.h +++ b/src/reports.h @@ -43,20 +43,22 @@ extern "C" { extern bool nocr; extern bool noreports; extern const char *visibility[]; + extern const char *options[MAXOPTIONS]; /* report options */ + + void reports_done(void); - /* kann_finden speedups */ - bool kann_finden(struct faction *f1, struct faction *f2); struct unit *can_find(struct faction *, struct faction *); + bool omniscient(const struct faction *f); + /* funktionen zum schreiben eines reports */ void sparagraph(struct strlist **SP, const char *s, unsigned int indent, char mark); void lparagraph(struct strlist **SP, char *s, unsigned int indent, char mark); const char *hp_status(const struct unit *u); size_t spskill(char *pbuf, size_t siz, const struct locale *lang, const struct unit *u, struct skill *sv, int *dh, int days); /* mapper */ void spunit(struct strlist **SP, const struct faction *f, - const struct unit *u, unsigned int indent, int mode); + const struct unit *u, unsigned int indent, seen_mode mode); - void prepare_seen(struct faction *f); int reports(void); int write_reports(struct faction *f, time_t ltime); int init_reports(void); @@ -65,7 +67,7 @@ extern "C" { const struct unit *ucansee(const struct faction *f, const struct unit *u, const struct unit *x); - int stealth_modifier(int seen_mode); + int stealth_modifier(seen_mode seen_mode); typedef struct report_context { struct faction *f; @@ -75,13 +77,16 @@ extern "C" { time_t report_time; } report_context; + void prepare_report(report_context *ctx, struct faction *f); + void finish_reports(report_context *ctx); + typedef int(*report_fun) (const char *filename, report_context * ctx, const char *charset); void register_reporttype(const char *extension, report_fun write, int flag); int bufunit(const struct faction *f, const struct unit *u, unsigned int indent, - int mode, char *buf, size_t size); + seen_mode mode, char *buf, size_t size); const char *trailinto(const struct region *r, const struct locale *lang); @@ -103,11 +108,9 @@ extern "C" { int number; int level; } resource_report; - void view_default(struct seen_region **seen, struct region * r, struct faction * f); - void view_neighbours(struct seen_region **seen, struct region * r, struct faction * f); - int report_resources(const struct seen_region *sr, - struct resource_report *result, int size, const struct faction *viewer); - int report_items(const struct item *items, struct item *result, int size, + int report_resources(const struct region *r, struct resource_report *res, + int size, const struct faction *viewer, bool see_unit); + int report_items(const struct unit *u, struct item *result, int size, const struct unit *owner, const struct faction *viewer); void report_item(const struct unit *owner, const struct item *i, const struct faction *viewer, const char **name, const char **basename, @@ -121,14 +124,7 @@ extern "C" { size_t f_regionid(const struct region *r, const struct faction *f, char *buffer, size_t size); - typedef struct strlist { - struct strlist *next; - char *s; - } strlist; - - void addstrlist(strlist ** SP, const char *s); - void freestrlist(strlist * s); - void split_paragraph(strlist ** SP, const char *s, unsigned int indent, unsigned int width, char mark); + void split_paragraph(struct strlist ** SP, const char *s, unsigned int indent, unsigned int width, char mark); int stream_printf(struct stream * out, const char *format, ...); diff --git a/src/reports.test.c b/src/reports.test.c index ebfe794cb..c9fe39c19 100644 --- a/src/reports.test.c +++ b/src/reports.test.c @@ -1,23 +1,27 @@ #include -#include #include "reports.h" -#include "report.h" -#include "creport.h" + #include "move.h" -#include "seen.h" +#include "lighthouse.h" #include "travelthru.h" #include "keyword.h" +#include #include #include +#include #include #include #include +#include #include #include #include +#include #include +#include +#include #include #include @@ -116,36 +120,6 @@ static void test_seen_faction(CuTest *tc) { test_cleanup(); } -static void test_write_spaces(CuTest *tc) { - stream out = { 0 }; - char buf[1024]; - size_t len; - - mstream_init(&out); - write_spaces(&out, 4); - out.api->rewind(out.handle); - len = out.api->read(out.handle, buf, sizeof(buf)); - buf[len] = '\0'; - CuAssertStrEquals(tc, " ", buf); - CuAssertIntEquals(tc, ' ', buf[3]); - mstream_done(&out); -} - -static void test_write_many_spaces(CuTest *tc) { - stream out = { 0 }; - char buf[1024]; - size_t len; - - mstream_init(&out); - write_spaces(&out, 100); - out.api->rewind(out.handle); - len = out.api->read(out.handle, buf, sizeof(buf)); - buf[len] = '\0'; - CuAssertIntEquals(tc, 100, (int)len); - CuAssertIntEquals(tc, ' ', buf[99]); - mstream_done(&out); -} - static void test_sparagraph(CuTest *tc) { strlist *sp = 0; @@ -178,75 +152,6 @@ static void test_sparagraph(CuTest *tc) { freestrlist(sp); } -static void test_cr_unit(CuTest *tc) { - stream strm; - char line[1024]; - faction *f; - region *r; - unit *u; - - test_cleanup(); - f = test_create_faction(0); - r = test_create_region(0, 0, 0); - u = test_create_unit(f, r); - renumber_unit(u, 1234); - - mstream_init(&strm); - cr_output_unit(&strm, r, f, u, see_unit); - strm.api->rewind(strm.handle); - CuAssertIntEquals(tc, 0, strm.api->readln(strm.handle, line, sizeof(line))); - CuAssertStrEquals(tc, line, "EINHEIT 1234"); - mstream_done(&strm); - test_cleanup(); -} - -static void test_write_travelthru(CuTest *tc) { - stream out = { 0 }; - char buf[1024]; - size_t len; - region *r; - faction *f; - unit *u; - struct locale *lang; - - test_cleanup(); - lang = get_or_create_locale("de"); - locale_setstring(lang, "travelthru_header", "Durchreise: "); - mstream_init(&out); - r = test_create_region(0, 0, 0); - r->flags |= RF_TRAVELUNIT; - f = test_create_faction(0); - f->locale = lang; - u = test_create_unit(f, 0); - unit_setname(u, "Hodor"); - unit_setid(u, 1); - - write_travelthru(&out, r, f); - out.api->rewind(out.handle); - len = out.api->read(out.handle, buf, sizeof(buf)); - CuAssertIntEquals_Msg(tc, "no travelers, no report", 0, (int)len); - mstream_done(&out); - - mstream_init(&out); - travelthru_add(r, u); - write_travelthru(&out, r, f); - out.api->rewind(out.handle); - len = out.api->read(out.handle, buf, sizeof(buf)); - buf[len] = '\0'; - CuAssertStrEquals_Msg(tc, "list one unit", "Durchreise: Hodor (1).\n", buf); - mstream_done(&out); - - mstream_init(&out); - move_unit(u, r, 0); - write_travelthru(&out, r, f); - out.api->rewind(out.handle); - len = out.api->read(out.handle, buf, sizeof(buf)); - CuAssertIntEquals_Msg(tc, "do not list units that stopped in the region", 0, (int)len); - - mstream_done(&out); - test_cleanup(); -} - static void test_write_unit(CuTest *tc) { unit *u; faction *f; @@ -288,144 +193,290 @@ static void test_write_unit(CuTest *tc) { test_cleanup(); } -typedef struct { - struct locale *lang; - spell *sp; - spellbook *spb; - spellbook_entry * sbe; -} spell_fixture; +static void test_arg_resources(CuTest *tc) { + variant v1, v2; + arg_type *atype; + resource *res; + item_type *itype; -static void setup_spell_fixture(spell_fixture * spf) { - spf->lang = get_or_create_locale("de"); - locale_setstring(spf->lang, mkname("spell", "testspell"), "Testzauber"); - locale_setstring(spf->lang, "nr_spell_type", "Typ:"); - locale_setstring(spf->lang, "sptype_normal", "Normal"); - locale_setstring(spf->lang, "nr_spell_modifiers", "Modifier:"); - locale_setstring(spf->lang, "smod_none", "Keine"); - locale_setstring(spf->lang, keyword(K_CAST), "ZAUBERE"); - locale_setstring(spf->lang, parameters[P_REGION], "REGION"); - locale_setstring(spf->lang, parameters[P_LEVEL], "STUFE"); - locale_setstring(spf->lang, "par_unit", "enr"); - locale_setstring(spf->lang, "par_ship", "snr"); - locale_setstring(spf->lang, "par_building", "bnr"); - locale_setstring(spf->lang, "spellpar::hodor", "Hodor"); + test_setup(); + itype = test_create_itemtype("stone"); + v1.v = res = malloc(sizeof(resource)*2); + res[0].number = 10; + res[0].type = itype->rtype; + res[0].next = &res[1]; + res[1].number = 5; + res[1].type = itype->rtype; + res[1].next = NULL; - spf->spb = create_spellbook("testbook"); - spf->sp = test_create_spell(); - spellbook_add(spf->spb, spf->sp, 1); - spf->sbe = spellbook_get(spf->spb, spf->sp); -} - -static void cleanup_spell_fixture(spell_fixture *spf) { - spellbook_clear(spf->spb); - free(spf->spb); + register_reports(); + atype = find_argtype("resources"); + CuAssertPtrNotNull(tc, atype); + v2 = atype->copy(v1); + free(v1.v); + CuAssertPtrNotNull(tc, v2.v); + res = (resource *)v2.v; + CuAssertPtrEquals(tc, itype->rtype, (void *)res->type); + CuAssertIntEquals(tc, 10, res->number); + CuAssertPtrNotNull(tc, res = res->next); + CuAssertPtrEquals(tc, itype->rtype, (void *)res->type); + CuAssertIntEquals(tc, 5, res->number); + CuAssertPtrEquals(tc, 0, res->next); + atype->release(v2); test_cleanup(); } -static void check_spell_syntax(CuTest *tc, char *msg, spell_fixture *spell, char *syntax) { - stream strm; - char buf[1024]; - char *linestart, *newline; - size_t len; +static void test_prepare_travelthru(CuTest *tc) { + report_context ctx; + faction *f, *f2; + region *r1, *r2, *r3; + unit *u; - mstream_init(&strm); - nr_spell_syntax(&strm, spell->sbe, spell->lang); - strm.api->rewind(strm.handle); - len = strm.api->read(strm.handle, buf, sizeof(buf)); - buf[len] = '\0'; + test_setup(); + f = test_create_faction(0); + f2 = test_create_faction(0); + r1 = test_create_region(0, 0, 0); + r2 = test_create_region(1, 0, 0); + r3 = test_create_region(3, 0, 0); + test_create_unit(f2, r1); + test_create_unit(f2, r3); + u = test_create_unit(f, r1); + travelthru_add(r2, u); + prepare_report(&ctx, f); + CuAssertPtrEquals(tc, r1, ctx.first); + CuAssertPtrEquals(tc, r3, ctx.last); + CuAssertPtrEquals(tc, f, ctx.f); + CuAssertIntEquals(tc, seen_unit, r1->seen.mode); + CuAssertIntEquals(tc, seen_travel, r2->seen.mode); + CuAssertIntEquals(tc, seen_none, r3->seen.mode); + finish_reports(&ctx); + CuAssertIntEquals(tc, seen_none, r2->seen.mode); - linestart = strtok(buf, "\n"); - while (linestart && !strstr(linestart, "ZAUBERE")) - linestart = strtok(NULL, "\n") ; - - CuAssertPtrNotNull(tc, linestart); - - newline = strtok(NULL, "\n"); - while (newline) { - *(newline - 1) = '\n'; - newline = strtok(NULL, "\n"); - } - - CuAssertStrEquals_Msg(tc, msg, syntax, linestart); - - mstream_done(&strm); + prepare_report(&ctx, f2); + CuAssertIntEquals(tc, seen_unit, r1->seen.mode); + CuAssertIntEquals(tc, seen_neighbour, r2->seen.mode); + CuAssertIntEquals(tc, seen_unit, r3->seen.mode); + CuAssertPtrEquals(tc, f2, ctx.f); + CuAssertPtrEquals(tc, r1, ctx.first); + CuAssertPtrEquals(tc, NULL, ctx.last); + test_cleanup(); } -static void set_parameter(spell_fixture spell, char *value) { - free(spell.sp->parameter); - spell.sp->parameter = _strdup(value); -} +void test_prepare_lighthouse_capacity(CuTest *tc) { + building *b; + building_type *btype; + unit *u1, *u2; + region *r1, *r2; + faction *f; + const struct terrain_type *t_ocean, *t_plain; + report_context ctx; -static void test_write_spell_syntax(CuTest *tc) { - spell_fixture spell; + test_setup(); + f = test_create_faction(0); + t_ocean = test_create_terrain("ocean", SEA_REGION); + t_plain = test_create_terrain("plain", LAND_REGION); + btype = test_create_buildingtype("lighthouse"); + btype->maxcapacity = 4; + r1 = test_create_region(0, 0, t_plain); + r2 = test_create_region(1, 0, t_ocean); + b = test_create_building(r1, btype); + b->flags |= BLD_MAINTAINED; + b->size = 10; + update_lighthouse(b); + u1 = test_create_unit(test_create_faction(0), r1); + u1->number = 4; + u1->building = b; + set_level(u1, SK_PERCEPTION, 3); + CuAssertIntEquals(tc, 1, lighthouse_range(b, u1->faction)); + CuAssertPtrEquals(tc, b, inside_building(u1)); + u2 = test_create_unit(f, r1); + u2->building = b; + set_level(u2, SK_PERCEPTION, 3); + CuAssertIntEquals(tc, 0, lighthouse_range(b, u2->faction)); + CuAssertPtrEquals(tc, NULL, inside_building(u2)); + prepare_report(&ctx, u1->faction); + CuAssertPtrEquals(tc, r1, ctx.first); + CuAssertPtrEquals(tc, NULL, ctx.last); + CuAssertIntEquals(tc, seen_unit, r1->seen.mode); + CuAssertIntEquals(tc, seen_lighthouse, r2->seen.mode); + finish_reports(&ctx); + + prepare_report(&ctx, u2->faction); + CuAssertPtrEquals(tc, r1, ctx.first); + CuAssertPtrEquals(tc, 0, ctx.last); + CuAssertIntEquals(tc, seen_unit, r1->seen.mode); + CuAssertIntEquals(tc, seen_neighbour, r2->seen.mode); + finish_reports(&ctx); test_cleanup(); - setup_spell_fixture(&spell); +} - check_spell_syntax(tc, "vanilla", &spell, " ZAUBERE \"Testzauber\""); +static void test_prepare_lighthouse(CuTest *tc) { + report_context ctx; + faction *f; + region *r1, *r2, *r3; + unit *u; + building *b; + building_type *btype; + const struct terrain_type *t_ocean, *t_plain; - spell.sp->sptyp |= FARCASTING; - check_spell_syntax(tc, "far", &spell, " ZAUBERE [REGION x y] \"Testzauber\""); + test_setup(); + t_ocean = test_create_terrain("ocean", SEA_REGION); + t_plain = test_create_terrain("plain", LAND_REGION); + f = test_create_faction(0); + r1 = test_create_region(0, 0, t_plain); + r2 = test_create_region(1, 0, t_ocean); + r3 = test_create_region(2, 0, t_ocean); + btype = test_create_buildingtype("lighthouse"); + b = test_create_building(r1, btype); + b->flags |= BLD_MAINTAINED; + b->size = 10; + update_lighthouse(b); + u = test_create_unit(f, r1); + u->building = b; + set_level(u, SK_PERCEPTION, 3); + prepare_report(&ctx, f); + CuAssertPtrEquals(tc, r1, ctx.first); + CuAssertPtrEquals(tc, NULL, ctx.last); + CuAssertIntEquals(tc, seen_unit, r1->seen.mode); + CuAssertIntEquals(tc, seen_lighthouse, r2->seen.mode); + CuAssertIntEquals(tc, seen_neighbour, r3->seen.mode); + test_cleanup(); +} - spell.sp->sptyp |= SPELLLEVEL; - check_spell_syntax(tc, "farlevel", &spell, " ZAUBERE [REGION x y] [STUFE n] \"Testzauber\""); - spell.sp->sptyp = 0; +static void test_prepare_lighthouse_owners(CuTest *tc) { + report_context ctx; + faction *f; + region *r1, *r2, *r3; + unit *u; + building *b; + building_type *btype; + const struct terrain_type *t_ocean, *t_plain; - set_parameter(spell, "kc"); - check_spell_syntax(tc, "kc", &spell, " ZAUBERE \"Testzauber\" ( REGION | EINHEIT | SCHIFF | BURG )"); + test_setup(); + config_set("rules.region_owner_pay_building", "lighthouse"); + config_set("rules.region_owners", "1"); + t_ocean = test_create_terrain("ocean", SEA_REGION); + t_plain = test_create_terrain("plain", LAND_REGION); + f = test_create_faction(0); + r1 = test_create_region(0, 0, t_plain); + r2 = test_create_region(1, 0, t_ocean); + r3 = test_create_region(2, 0, t_ocean); + btype = test_create_buildingtype("lighthouse"); + b = test_create_building(r1, btype); + b->flags |= BLD_MAINTAINED; + b->size = 10; + update_lighthouse(b); + u = test_create_unit(f, r1); + u = test_create_unit(test_create_faction(0), r1); + u->building = b; + set_level(u, SK_PERCEPTION, 3); + region_set_owner(b->region, f, 0); + prepare_report(&ctx, f); + CuAssertPtrEquals(tc, r1, ctx.first); + CuAssertPtrEquals(tc, NULL, ctx.last); + CuAssertIntEquals(tc, seen_unit, r1->seen.mode); + CuAssertIntEquals(tc, seen_lighthouse, r2->seen.mode); + CuAssertIntEquals(tc, seen_neighbour, r3->seen.mode); + test_cleanup(); +} - spell.sp->sptyp |= BUILDINGSPELL; - check_spell_syntax(tc, "kc typed", &spell, " ZAUBERE \"Testzauber\" BURG "); - spell.sp->sptyp = 0; +static void test_prepare_report(CuTest *tc) { + report_context ctx; + faction *f; + region *r; - set_parameter(spell, "b"); - check_spell_syntax(tc, "b", &spell, " ZAUBERE \"Testzauber\" "); + test_setup(); + f = test_create_faction(0); + r = test_create_region(0, 0, 0); - set_parameter(spell, "s"); - check_spell_syntax(tc, "s", &spell, " ZAUBERE \"Testzauber\" "); + prepare_report(&ctx, f); + CuAssertPtrEquals(tc, 0, ctx.first); + CuAssertPtrEquals(tc, 0, ctx.last); + CuAssertIntEquals(tc, seen_none, r->seen.mode); + finish_reports(&ctx); - set_parameter(spell, "s+"); - check_spell_syntax(tc, "s+", &spell, " ZAUBERE \"Testzauber\" [ ...]"); + test_create_unit(f, r); + prepare_report(&ctx, f); + CuAssertPtrEquals(tc, r, ctx.first); + CuAssertPtrEquals(tc, 0, ctx.last); + CuAssertIntEquals(tc, seen_unit, r->seen.mode); + finish_reports(&ctx); + CuAssertIntEquals(tc, seen_none, r->seen.mode); + finish_reports(&ctx); - set_parameter(spell, "u"); - check_spell_syntax(tc, "u", &spell, " ZAUBERE \"Testzauber\" "); + r = test_create_region(2, 0, 0); + CuAssertPtrEquals(tc, r, regions->next); + prepare_report(&ctx, f); + CuAssertPtrEquals(tc, regions, ctx.first); + CuAssertPtrEquals(tc, r, ctx.last); + CuAssertIntEquals(tc, seen_none, r->seen.mode); + test_cleanup(); +} - set_parameter(spell, "r"); - check_spell_syntax(tc, "r", &spell, " ZAUBERE \"Testzauber\" "); +static void test_seen_neighbours(CuTest *tc) { + report_context ctx; + faction *f; + region *r1, *r2; - set_parameter(spell, "bc"); - free(spell.sp->syntax); - spell.sp->syntax = _strdup("hodor"); - check_spell_syntax(tc, "bc hodor", &spell, " ZAUBERE \"Testzauber\" "); - free(spell.sp->syntax); - spell.sp->syntax = 0; + test_setup(); + f = test_create_faction(0); + r1 = test_create_region(0, 0, 0); + r2 = test_create_region(1, 0, 0); - set_parameter(spell, "c?"); - free(spell.sp->syntax); - spell.sp->syntax = _strdup("hodor"); - check_spell_syntax(tc, "c?", &spell, " ZAUBERE \"Testzauber\" []"); - free(spell.sp->syntax); - spell.sp->syntax = 0; + test_create_unit(f, r1); + prepare_report(&ctx, f); + CuAssertPtrEquals(tc, r1, ctx.first); + CuAssertPtrEquals(tc, 0, ctx.last); + CuAssertIntEquals(tc, seen_unit, r1->seen.mode); + CuAssertIntEquals(tc, seen_neighbour, r2->seen.mode); + finish_reports(&ctx); + test_cleanup(); +} - set_parameter(spell, "kc+"); - check_spell_syntax(tc, "kc+", &spell, - " ZAUBERE \"Testzauber\" ( REGION | EINHEIT [ ...] | SCHIFF \n [ ...] | BURG [ ...] )"); +static void test_seen_travelthru(CuTest *tc) { + report_context ctx; + faction *f; + unit *u; + region *r1, *r2, *r3; - cleanup_spell_fixture(&spell); + test_setup(); + f = test_create_faction(0); + r1 = test_create_region(0, 0, 0); + r2 = test_create_region(1, 0, 0); + r3 = test_create_region(2, 0, 0); + + u = test_create_unit(f, r1); + CuAssertPtrEquals(tc, r1, f->first); + CuAssertPtrEquals(tc, r1, f->last); + travelthru_add(r2, u); + CuAssertPtrEquals(tc, r1, f->first); + CuAssertPtrEquals(tc, r3, f->last); + prepare_report(&ctx, f); + CuAssertPtrEquals(tc, r1, ctx.first); + CuAssertPtrEquals(tc, 0, ctx.last); + CuAssertIntEquals(tc, seen_unit, r1->seen.mode); + CuAssertIntEquals(tc, seen_travel, r2->seen.mode); + CuAssertIntEquals(tc, seen_neighbour, r3->seen.mode); + finish_reports(&ctx); + test_cleanup(); } CuSuite *get_reports_suite(void) { CuSuite *suite = CuSuiteNew(); - SUITE_ADD_TEST(suite, test_cr_unit); + SUITE_ADD_TEST(suite, test_prepare_report); + SUITE_ADD_TEST(suite, test_seen_neighbours); + SUITE_ADD_TEST(suite, test_seen_travelthru); + SUITE_ADD_TEST(suite, test_prepare_lighthouse); + SUITE_ADD_TEST(suite, test_prepare_lighthouse_owners); + SUITE_ADD_TEST(suite, test_prepare_lighthouse_capacity); + SUITE_ADD_TEST(suite, test_prepare_travelthru); SUITE_ADD_TEST(suite, test_reorder_units); SUITE_ADD_TEST(suite, test_seen_faction); SUITE_ADD_TEST(suite, test_regionid); - SUITE_ADD_TEST(suite, test_write_spaces); - SUITE_ADD_TEST(suite, test_write_many_spaces); SUITE_ADD_TEST(suite, test_sparagraph); - SUITE_ADD_TEST(suite, test_write_travelthru); SUITE_ADD_TEST(suite, test_write_unit); - SUITE_ADD_TEST(suite, test_write_spell_syntax); + SUITE_ADD_TEST(suite, test_arg_resources); return suite; } diff --git a/src/seen.c b/src/seen.c deleted file mode 100644 index 928b3f55e..000000000 --- a/src/seen.c +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright (c) 1998-2015, Enno Rehling -Katja Zedel - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -**/ - -#include -#include -#include "seen.h" - -#include -#include - -#include -#include - -#define MAXSEEHASH 0x1000 -seen_region *reuse; - -seen_region **seen_init(void) -{ - return (seen_region **)calloc(MAXSEEHASH, sizeof(seen_region *)); -} - -void seen_done(seen_region * seehash[]) -{ - int i; - for (i = 0; i != MAXSEEHASH; ++i) { - seen_region *sd = seehash[i]; - if (sd == NULL) - continue; - while (sd->nextHash != NULL) - sd = sd->nextHash; - sd->nextHash = reuse; - reuse = seehash[i]; - seehash[i] = NULL; - } - free(seehash); -} - -void free_seen(void) -{ - while (reuse) { - seen_region *r = reuse; - reuse = reuse->nextHash; - free(r); - } -} - -void -link_seen(seen_region * seehash[], const region * first, const region * last) -{ - const region *r = first; - seen_region *sr = NULL; - - if (first == last) - return; - - do { - sr = find_seen(seehash, r); - r = r->next; - } while (sr == NULL && r != last); - - while (r != last) { - seen_region *sn = find_seen(seehash, r); - if (sn != NULL) { - sr->next = sn; - sr = sn; - } - r = r->next; - } - if (sr) sr->next = 0; -} - -seen_region *find_seen(struct seen_region *seehash[], const region * r) -{ - unsigned int index = reg_hashkey(r) & (MAXSEEHASH - 1); - seen_region *find = seehash[index]; - while (find) { - if (find->r == r) { - return find; - } - find = find->nextHash; - } - return NULL; -} - -void seenhash_map(struct seen_region *seen[], void(*cb)(seen_region *, void *), void *cbdata) { - int i; - for (i = 0; i != MAXSEEHASH; ++i) { - seen_region *sr = seen[i]; - while (sr != NULL) { - cb(sr, cbdata); - sr = sr->nextHash; - } - } -} - -typedef struct cb_interval { - region *first; - region *last; -} cb_interval; - -static void cb_get_interval(seen_region *sr, void *cbdata) { - cb_interval *iv = (cb_interval *)cbdata; - region *r = sr->r; - if (iv->first == NULL || r->index < iv->first->index) { - iv->first = r; - } - if (iv->last != NULL && r->index >= iv->last->index) { - iv->last = r->next; - } -} - -/* this function adds the neighbour regions of the ones we have seen - * to the interval, which may be outside of [faction.first, faction.last) - */ -void get_seen_interval(struct seen_region *seen[], struct region **firstp, struct region **lastp) -{ - cb_interval interval; - - interval.first = *firstp; - interval.last = *lastp; - seenhash_map(seen, cb_get_interval, &interval); - *firstp = interval.first; - *lastp = interval.last; -} - -seen_region *add_seen(struct seen_region *seehash[], struct region *r, seen_t mode, bool dis) -{ - seen_region *find = find_seen(seehash, r); - if (find == NULL) { - unsigned int index = reg_hashkey(r) & (MAXSEEHASH - 1); - if (!reuse) - reuse = (seen_region *)calloc(1, sizeof(struct seen_region)); - find = reuse; - reuse = reuse->nextHash; - find->nextHash = seehash[index]; - find->mode = mode; - seehash[index] = find; - find->r = r; - } - else if (find->mode < mode) { - find->mode = mode; - } - find->disbelieves |= dis; - return find; -} - -seen_region *faction_add_seen(faction *f, region *r, seen_t mode) { - assert(f->seen); -#ifdef SMART_INTERVALS - update_interval(f, r); -#endif - return add_seen(f->seen, r, mode, false); -} diff --git a/src/seen.h b/src/seen.h deleted file mode 100644 index 1f0197cc7..000000000 --- a/src/seen.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once -/* -Copyright (c) 1998-2015, Enno Rehling -Katja Zedel - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -**/ - -#ifndef H_SEEN_REGION -#define H_SEEN_REGION - -struct region; -struct faction; -struct seen_region; - -#ifdef __cplusplus -extern "C" { -#endif - - typedef enum { - see_none, - see_neighbour, - see_lighthouse, - see_travel, - see_far, - see_unit, - see_battle - } seen_t; - - typedef struct seen_region { - struct seen_region *nextHash; - struct seen_region *next; - struct region *r; - seen_t mode; - bool disbelieves; /* potion of truth */ - } seen_region; - -struct seen_region **seen_init(void); -void seen_done(struct seen_region *seehash[]); -void free_seen(void); -void link_seen(struct seen_region *seehash[], const struct region * first, const struct region * last); -struct seen_region *find_seen(struct seen_region *seehash[], const struct region * r); -void get_seen_interval(struct seen_region *seen[], struct region **firstp, struct region **lastp); -seen_region *add_seen(struct seen_region *seehash[], struct region *r, seen_t mode, bool dis); -void link_seen(struct seen_region *seehash[], const struct region *first, const struct region *last); -void seenhash_map(struct seen_region *seen[], void(*cb)(struct seen_region *, void *), void *cbdata); -struct seen_region *faction_add_seen(struct faction *f, struct region *r, seen_t mode); -#ifdef __cplusplus -} -#endif -#endif diff --git a/src/seen.test.c b/src/seen.test.c deleted file mode 100644 index 504d79ada..000000000 --- a/src/seen.test.c +++ /dev/null @@ -1,202 +0,0 @@ -#include -#include -#include "seen.h" -#include "reports.h" -#include "travelthru.h" - -#include -#include -#include - -#include -#include - -static void setup_seen(int x, int y) { - int dir; - - for (dir = 0; dir != MAXDIRECTIONS; ++dir) { - test_create_region(x+delta_x[dir], y+delta_y[dir], 0); - } -} - -static void test_add_seen(CuTest *tc) { - region *r; - seen_region **seen, *sr; - - test_cleanup(); - seen = seen_init(); - r = test_create_region(0, 0, 0); - sr = add_seen(seen, r, see_travel, false); - CuAssertPtrEquals(tc, r, sr->r); - CuAssertIntEquals(tc, see_travel, sr->mode); - CuAssertIntEquals(tc, false, sr->disbelieves); - CuAssertPtrEquals(tc, 0, sr->next); - CuAssertPtrEquals(tc, 0, sr->nextHash); - CuAssertPtrEquals(tc, sr, find_seen(seen, r)); - sr = add_seen(seen, r, see_neighbour, true); - CuAssertIntEquals(tc, true, sr->disbelieves); - CuAssertIntEquals(tc, see_travel, sr->mode); - sr = add_seen(seen, r, see_unit, false); - CuAssertIntEquals(tc, true, sr->disbelieves); - CuAssertIntEquals(tc, see_unit, sr->mode); - seen_done(seen); - test_cleanup(); -} - -static void test_faction_add_seen(CuTest *tc) { - faction *f; - seen_region *sr; - - test_cleanup(); - f = test_create_faction(0); - f->seen = seen_init(); - test_create_region(0, 0, 0); - test_create_region(0, 1, 0); - sr = faction_add_seen(f, regions, see_unit); - CuAssertIntEquals(tc, false, sr->disbelieves); - CuAssertPtrEquals(tc, regions, f->first); - CuAssertPtrEquals(tc, regions, f->last); - seen_done(f->seen); - test_cleanup(); -} - -static void test_prepare_seen(CuTest *tc) { - region *r; - faction *f; - unit *u; - - test_cleanup(); - f = test_create_faction(0); - r = test_create_region(0, 0, 0); - u = test_create_unit(f, r); - f->seen = seen_init(); - faction_add_seen(f, r, see_unit); - setup_seen(0, 0); - r = test_create_region(2, 2, 0); - setup_seen(2, 2); - travelthru_add(r, u); - - init_reports(); - prepare_seen(f); - CuAssertPtrEquals(tc, regions, f->first); - CuAssertPtrEquals(tc, 0, f->last); - seen_done(f->seen); - test_cleanup(); -} - -static void test_seen_travelthru(CuTest *tc) { - seen_region *sr; - region *r; - faction *f; - unit *u; - - test_cleanup(); - setup_seen(0, 0); - r = test_create_region(0, 0, 0); - f = test_create_faction(0); - u = test_create_unit(f, 0); - travelthru_add(r, u); - init_reports(); - view_default(f->seen, r, f); - get_seen_interval(f->seen, &f->first, &f->last); - link_seen(f->seen, f->first, f->last); - CuAssertPtrEquals(tc, regions, f->first); - CuAssertPtrEquals(tc, 0, f->last); - sr = find_seen(f->seen, regions); - CuAssertPtrEquals(tc, regions, sr->r); - CuAssertIntEquals(tc, see_neighbour, sr->mode); - sr = find_seen(f->seen, r); - CuAssertPtrEquals(tc, r, sr->r); - CuAssertIntEquals(tc, see_travel, sr->mode); - seen_done(f->seen); - test_cleanup(); -} - -static void test_seen_region(CuTest *tc) { - seen_region **seen, *sr; - region *r; - - test_cleanup(); - setup_seen(0, 0); - r = test_create_region(0, 0, 0); - seen = seen_init(); - add_seen(seen, r, see_unit, false); - sr = find_seen(seen, r); - CuAssertPtrEquals(tc, r, sr->r); - seen_done(seen); - test_cleanup(); -} - -static void test_seen_interval_backward(CuTest *tc) { - region *r, *first, *last; - seen_region **seen; - - test_cleanup(); - r = test_create_region(0, 0, 0); - setup_seen(0, 0); - seen = seen_init(); - add_seen(seen, r, see_unit, false); - view_default(seen, r, 0); - first = r; - last = 0; - get_seen_interval(seen, &first, &last); - CuAssertPtrEquals(tc, regions, first); - CuAssertPtrEquals(tc, 0, last); - seen_done(seen); - test_cleanup(); -} - -static void test_seen_interval_forward(CuTest *tc) { - region *r, *first, *last; - seen_region **seen; - - test_cleanup(); - setup_seen(0, 0); - r = test_create_region(0, 0, 0); - seen = seen_init(); - add_seen(seen, r, see_unit, true); - view_default(seen, r, 0); - first = r; - last = 0; - get_seen_interval(seen, &first, &last); - CuAssertPtrEquals(tc, regions, first); - CuAssertPtrEquals(tc, 0, last); - seen_done(seen); - test_cleanup(); -} - -static void cb_testmap(seen_region *sr, void *cbdata) { - int *ip = (int *)cbdata; - *ip += sr->r->y; -} - -static void test_seenhash_map(CuTest *tc) { - region *r; - seen_region **seen; - int i = 0; - - test_cleanup(); - seen = seen_init(); - r = test_create_region(1, 1, 0); - add_seen(seen, r, see_unit, false); - r = test_create_region(2, 2, 0); - add_seen(seen, r, see_unit, false); - seenhash_map(seen, cb_testmap, &i); - CuAssertIntEquals(tc, 3, i); - seen_done(seen); - test_cleanup(); -} - -CuSuite *get_seen_suite(void) -{ - CuSuite *suite = CuSuiteNew(); - SUITE_ADD_TEST(suite, test_add_seen); - SUITE_ADD_TEST(suite, test_faction_add_seen); - SUITE_ADD_TEST(suite, test_prepare_seen); - SUITE_ADD_TEST(suite, test_seen_travelthru); - SUITE_ADD_TEST(suite, test_seen_region); - SUITE_ADD_TEST(suite, test_seen_interval_backward); - SUITE_ADD_TEST(suite, test_seen_interval_forward); - SUITE_ADD_TEST(suite, test_seenhash_map); - return suite; -} diff --git a/src/settings.h b/src/settings.h index c44bc0f2a..b77e4687a 100644 --- a/src/settings.h +++ b/src/settings.h @@ -10,10 +10,6 @@ without prior permission by the authors of Eressea. */ -/* - * Contains defines for the "free" game (Eressea) . - * Include this file from settings.h to make eressea work. - */ #define ENTERTAINFRACTION 20 #define TEACHDIFFERENCE 2 #define GUARD_DISABLES_RECRUIT 1 @@ -24,7 +20,7 @@ #undef NEWATSROI /* Vermehrungsrate Bauern in 1/10000. -* TODO: Evt. Berechnungsfehler, reale Vermehrungsraten scheinen höher. */ +* TODO: Evt. Berechnungsfehler, reale Vermehrungsraten scheinen hoeher. */ #define PEASANTGROWTH 10 #define PEASANTLUCK 10 @@ -41,22 +37,21 @@ /* experimental gameplay features (that don't affect the savefile) */ /* TODO: move these settings to settings.h or into configuration files */ -#define GOBLINKILL /* Goblin-Spezialklau kann tödlich enden */ -#define INSECT_POTION /* Spezialtrank für Insekten */ -#define ORCIFICATION /* giving snotlings to the peasants gets counted */ +#define GOBLINKILL /* Goblin-Spezialklau kann toedlich enden */ +#define INSECT_POTION /* Spezialtrank fuer Insekten */ #define TREESIZE (8) /* space used by trees (in #peasants) */ #define PEASANTFORCE 0.75 /* Chance einer Vermehrung trotz 90% Auslastung */ - /* Gebäudegröße = Minimalbelagerer */ + /* Gebaeudegroesse = Minimalbelagerer */ #define SIEGEFACTOR 2 /** Magic */ #define MAXMAGICIANS 3 #define MAXALCHEMISTS 3 -#define ENCCHANCE 10 /* %-Chance für einmalige Zufallsbegegnung */ -#define BAGCAPACITY 20000 /* soviel paßt in einen Bag of Holding */ +#define ENCCHANCE 10 /* %-Chance fuer einmalige Zufallsbegegnung */ +#define BAGCAPACITY 20000 /* soviel passt in einen Bag of Holding */ #define PERSON_WEIGHT 1000 /* weight of a "normal" human unit */ #define STAMINA_AFFECTS_HP 1<<0 diff --git a/src/spells.c b/src/spells.c index e455f7395..57b1da3a5 100644 --- a/src/spells.c +++ b/src/spells.c @@ -15,6 +15,7 @@ #include #include +#include "guard.h" #include "spy.h" #include "vortex.h" #include "laws.h" @@ -46,18 +47,17 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include /* util includes */ +#include #include #include #include @@ -80,7 +80,6 @@ #include /* libc includes */ -#include #include #include #include @@ -108,10 +107,6 @@ static double zero_effect = 0.0; -attrib_type at_wdwpyramid = { - "wdwpyramid", NULL, NULL, NULL, a_writevoid, a_readvoid -}; - /* ----------------------------------------------------------------------- */ static void report_spell(unit * mage, region * r, message * msg) @@ -451,7 +446,7 @@ report_effect(region * r, unit * mage, message * seen, message * unseen) * Vertrauten sehen, und durch den Vertrauten zaubern, allerdings nur * mit seiner halben Stufe. Je nach Vertrautem erhaelt der Magier * evtl diverse Skillmodifikationen. Der Typ des Vertrauten ist - * zufaellig bestimmt, wird aber durch Magiegebiet und Rasse beeinflußt. + * zufaellig bestimmt, wird aber durch Magiegebiet und Rasse beeinflu�t. * "Tierische" Vertraute brauchen keinen Unterhalt. * * Ein paar Moeglichkeiten: @@ -969,7 +964,7 @@ static int sp_blessstonecircle(castorder * co) b = p->param[0]->data.b; - if (b->type != bt_find("stonecircle")) { + if (!is_building_type(b->type, "stonecircle")) { ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "error_notstonecircle", "building", b)); return 0; @@ -1263,6 +1258,7 @@ add_ironweapon(const struct item_type *type, const struct item_type *rusty, float chance) { iron_weapon *iweapon = malloc(sizeof(iron_weapon)); + assert_alloc(iweapon); iweapon->type = type; iweapon->rusty = rusty; iweapon->chance = chance; @@ -1501,16 +1497,23 @@ static int sp_create_irongolem(castorder * co) int cast_level = co->level; double force = co->force; int number = lovar(force * 8 * RESOURCE_QUANTITY); - if (number < 1) + static int cache; + static const race * golem_rc; + + if (rc_changed(&cache)) { + golem_rc = rc_find("irongolem"); + } + + if (number < 1) { number = 1; + } if (r->terrain == newterrain(T_SWAMP)) { cmistake(mage, co->order, 188, MSG_MAGIC); return 0; } - u2 = - create_unit(r, mage->faction, number, rc_find("irongolem"), 0, NULL, mage); + u2 = create_unit(r, mage->faction, number, golem_rc, 0, NULL, mage); set_level(u2, SK_ARMORER, 1); set_level(u2, SK_WEAPONSMITH, 1); @@ -1523,7 +1526,7 @@ static int sp_create_irongolem(castorder * co) ADDMSG(&mage->faction->msgs, msg_message("magiccreate_effect", "region command unit amount object", mage->region, co->order, mage, number, - LOC(mage->faction->locale, rc_name_s(rc_find("irongolem"), (u2->number == 1) ? NAME_SINGULAR : NAME_PLURAL)))); + LOC(mage->faction->locale, rc_name_s(golem_rc, (u2->number == 1) ? NAME_SINGULAR : NAME_PLURAL)))); return cast_level; } @@ -1563,6 +1566,12 @@ static int sp_create_stonegolem(castorder * co) unit *mage = co->magician.u; int cast_level = co->level; int number = lovar(co->force * 5 * RESOURCE_QUANTITY); + static int cache; + static const race * golem_rc; + + if (rc_changed(&cache)) { + golem_rc = rc_find("stonegolem"); + } if (number < 1) number = 1; @@ -1572,7 +1581,7 @@ static int sp_create_stonegolem(castorder * co) } u2 = - create_unit(r, mage->faction, number, rc_find("stonegolem"), 0, NULL, mage); + create_unit(r, mage->faction, number, golem_rc, 0, NULL, mage); set_level(u2, SK_ROAD_BUILDING, 1); set_level(u2, SK_BUILDING, 1); @@ -1584,13 +1593,13 @@ static int sp_create_stonegolem(castorder * co) ADDMSG(&mage->faction->msgs, msg_message("magiccreate_effect", "region command unit amount object", mage->region, co->order, mage, number, - LOC(mage->faction->locale, rc_name_s(rc_find("stonegolem"), (u2->number == 1) ? NAME_SINGULAR : NAME_PLURAL)))); + LOC(mage->faction->locale, rc_name_s(golem_rc, (u2->number == 1) ? NAME_SINGULAR : NAME_PLURAL)))); return cast_level; } /* ------------------------------------------------------------- */ -/* Name: Große Duerre +/* Name: Gro�e Duerre * Stufe: 17 * Kategorie: Region, negativ * Gebiet: Gwyrrd @@ -1898,7 +1907,7 @@ static int sp_treewalkexit(castorder * co) return 0; } - /* Koordinaten setzen und Region loeschen fuer Überpruefung auf + /* Koordinaten setzen und Region loeschen fuer �berpruefung auf * Gueltigkeit */ rt = pa->param[0]->data.r; tax = rt->x; @@ -2011,7 +2020,7 @@ static int sp_treewalkexit(castorder * co) */ static int sp_holyground(castorder * co) { - static const curse_type *ctype = NULL; + const curse_type *ctype = NULL; region *r = co_get_region(co); unit *mage = co->magician.u; int cast_level = co->level; @@ -2020,9 +2029,7 @@ static int sp_holyground(castorder * co) report_spell(mage, r, msg); msg_release(msg); - if (!ctype) { - ctype = ct_find("holyground"); - } + ctype = ct_find("holyground"); create_curse(mage, &r->attribs, ctype, power * power, 1, zero_effect, 0); a_removeall(&r->attribs, &at_deathcount); @@ -2053,7 +2060,7 @@ static int sp_homestone(castorder * co) double force = co->force; double effect; message *msg; - if (!mage->building || mage->building->type != bt_find("castle")) { + if (!mage->building || !is_building_type(mage->building->type, "castle")) { cmistake(mage, co->order, 197, MSG_MAGIC); return 0; } @@ -2185,9 +2192,9 @@ static int sp_ironkeeper(castorder * co) /*keeper->age = cast_level + 2; */ setstatus(keeper, ST_AVOID); /* kaempft nicht */ - guard(keeper, GUARD_MINING); + setguard(keeper, true); fset(keeper, UFL_ISNEW); - /* Parteitarnen, damit man nicht sofort weiß, wer dahinter steckt */ + /* Parteitarnen, damit man nicht sofort wei�, wer dahinter steckt */ if (rule_stealth_anon()) { fset(keeper, UFL_ANON_FACTION); } @@ -2375,7 +2382,6 @@ void patzer_peasantmob(const castorder * co) create_unit(r, f, n, get_race(RC_PEASANT), 0, LOC(f->locale, "angry_mob"), NULL); fset(u, UFL_ISNEW); - /* guard(u, GUARD_ALL); hier zu frueh! Befehl BEWACHE setzten */ addlist(&u->orders, create_order(K_GUARD, lang, NULL)); set_order(&u->thisorder, default_order(lang)); a = a_new(&at_unitdissolve); @@ -2566,7 +2572,7 @@ void patzer_fumblecurse(const castorder * co) * * Wirkung: * In einer Wueste, Sumpf oder Gletscher gezaubert kann innerhalb der - * naechsten 6 Runden ein bis 6 Dracheneinheiten bis Groeße Wyrm + * naechsten 6 Runden ein bis 6 Dracheneinheiten bis Groe�e Wyrm * entstehen. * * Mit Stufe 12-15 erscheinen Jung- oder normaler Drachen, mit Stufe @@ -2719,6 +2725,26 @@ static int sp_firewall(castorder * co) * (SPELLLEVEL | TESTCANSEE) */ +static const race *unholy_race(const race *rc) { + static int cache; + static const race * rc_skeleton, *rc_zombie, *rc_ghoul; + if (rc_changed(&cache)) { + rc_skeleton = get_race(RC_SKELETON); + rc_zombie = get_race(RC_ZOMBIE); + rc_ghoul = get_race(RC_GHOUL); + } + if (rc == rc_skeleton) { + return get_race(RC_SKELETON_LORD); + } + if (rc == rc_zombie) { + return get_race(RC_ZOMBIE_LORD); + } + if (rc == rc_ghoul) { + return get_race(RC_GHOUL_LORD); + } + return NULL; +} + static int sp_unholypower(castorder * co) { region * r = co_get_region(co); @@ -2741,17 +2767,8 @@ static int sp_unholypower(castorder * co) u = pa->param[i]->data.u; - switch (old_race(u_race(u))) { - case RC_SKELETON: - target_race = get_race(RC_SKELETON_LORD); - break; - case RC_ZOMBIE: - target_race = get_race(RC_ZOMBIE_LORD); - break; - case RC_GHOUL: - target_race = get_race(RC_GHOUL_LORD); - break; - default: + target_race = unholy_race(u_race(u)); + if (!target_race) { cmistake(mage, co->order, 284, MSG_MAGIC); continue; } @@ -2800,7 +2817,7 @@ static int change_hitpoints(unit * u, int value) hp += value; - /* Jede Person benötigt mindestens 1 HP */ + /* Jede Person ben�tigt mindestens 1 HP */ if (hp < u->number) { if (hp < 0) { /* Einheit tot */ hp = 0; @@ -3205,15 +3222,14 @@ static int sp_magicboost(castorder * co) double power = co->force; double effect; trigger *tsummon; - static const curse_type *ct_auraboost; - static const curse_type *ct_magicboost; + const curse_type *ct_auraboost; + const curse_type *ct_magicboost; + + ct_auraboost = ct_find("auraboost"); + ct_magicboost = ct_find("magicboost"); + assert(ct_auraboost != NULL); + assert(ct_magicboost != NULL); - if (!ct_auraboost) { - ct_auraboost = ct_find("auraboost"); - ct_magicboost = ct_find("magicboost"); - assert(ct_auraboost != NULL); - assert(ct_magicboost != NULL); - } /* fehler, wenn schon ein boost */ if (is_cursed(mage->attribs, C_MBOOST, 0)) { report_failure(mage, co->order); @@ -3221,8 +3237,7 @@ static int sp_magicboost(castorder * co) } effect = 6; - c = create_curse(mage, &mage->attribs, ct_magicboost, power, 10, effect, 1); - + create_curse(mage, &mage->attribs, ct_magicboost, power, 10, effect, 1); /* one aura boost with 200% aura now: */ effect = 200; c = create_curse(mage, &mage->attribs, ct_auraboost, power, 4, effect, 1); @@ -3725,7 +3740,7 @@ static int sp_rallypeasantmob(castorder * co) rsetpeasants(r, rpeasants(r) + u->number); rsetmoney(r, rmoney(r) + get_money(u)); set_money(u, 0); - setguard(u, GUARD_NONE); + setguard(u, false); set_number(u, 0); erfolg = cast_level; } @@ -3748,7 +3763,7 @@ static int sp_rallypeasantmob(castorder * co) * Gebiet: Cerddor * Wirkung: * Wiegelt 60% bis 90% der Bauern einer Region auf. Bauern werden ein - * großer Mob, der zur Monsterpartei gehoert und die Region bewacht. + * gro�er Mob, der zur Monsterpartei gehoert und die Region bewacht. * Regionssilber sollte auch nicht durch Unterhaltung gewonnen werden * koennen. * @@ -3792,7 +3807,7 @@ static int sp_raisepeasantmob(castorder * co) create_unit(r, monsters, n, get_race(RC_PEASANT), 0, LOC(monsters->locale, "furious_mob"), NULL); fset(u, UFL_ISNEW); - guard(u, GUARD_ALL); + setguard(u, true); a = a_new(&at_unitdissolve); a->data.ca[0] = 1; /* An rpeasants(r). */ a->data.ca[1] = 15; /* 15% */ @@ -4009,13 +4024,13 @@ static int sp_recruit(castorder * co) return 0; } /* Immer noch zuviel auf niedrigen Stufen. Deshalb die Rekrutierungskosten - * mit einfliessen lassen und dafuer den Exponenten etwas groeßer. + * mit einfliessen lassen und dafuer den Exponenten etwas groe�er. * Wenn die Rekrutierungskosten deutlich hoeher sind als der Faktor, * ist das Verhaeltniss von ausgegebene Aura pro Bauer bei Stufe 2 * ein mehrfaches von Stufe 1, denn in beiden Faellen gibt es nur 1 * Bauer, nur die Kosten steigen. */ n = (pow(force, 1.6) * 100) / f->race->recruitcost; - if (rc->recruit_multi != 0) { + if (rc->recruit_multi > 0) { double multp = (double)maxp / rc->recruit_multi; n = _min(multp, n); n = _max(n, 1); @@ -4040,7 +4055,7 @@ static int sp_recruit(castorder * co) } /* ------------------------------------------------------------- */ -/* Name: Wanderprediger - Große Anwerbung +/* Name: Wanderprediger - Gro�e Anwerbung * Stufe: 14 * Gebiet: Cerddor * Wirkung: @@ -4096,8 +4111,8 @@ static int sp_bigrecruit(castorder * co) * Gebiet: Cerddor * Wirkung: * Erliegt die Einheit dem Zauber, so wird sie dem Magier alles - * erzaehlen, was sie ueber die gefragte Region weiß. Ist in der Region - * niemand ihrer Partei, so weiß sie nichts zu berichten. Auch kann + * erzaehlen, was sie ueber die gefragte Region wei�. Ist in der Region + * niemand ihrer Partei, so wei� sie nichts zu berichten. Auch kann * sie nur das erzaehlen, was sie selber sehen koennte. * Flags: * (UNITSPELL | TESTCANSEE) @@ -4147,7 +4162,7 @@ static int sp_pump(castorder * co) } u = - create_unit(rt, mage->faction, RS_FARVISION, get_race(RC_SPELL), 0, + create_unit(rt, mage->faction, 1, get_race(RC_SPELL), 0, "spell/pump", NULL); u->age = 2; set_level(u, SK_PERCEPTION, effskill(target, SK_PERCEPTION, 0)); @@ -4160,7 +4175,7 @@ static int sp_pump(castorder * co) * Stufe: 6 * Gebiet: Cerddor * Wirkung: - * Betoert eine Einheit, so das sie ihm den groeßten Teil ihres Bargelds + * Betoert eine Einheit, so das sie ihm den groe�ten Teil ihres Bargelds * und 50% ihres Besitzes schenkt. Sie behaelt jedoch immer soviel, wie * sie zum ueberleben braucht. Wirkt gegen Magieresistenz. * _min(Stufe*1000$, u->money - maintenace) @@ -4317,7 +4332,7 @@ static int sp_headache(castorder * co) if (target->number == 0 || pa->param[0]->flag == TARGET_NOTFOUND) return 0; - /* finde das groeßte Talent: */ + /* finde das groe�te Talent: */ for (i = 0; i != target->skill_size; ++i) { skill *sv = target->skills + i; if (smax == NULL || skill_compare(sv, smax) > 0) { @@ -4463,7 +4478,7 @@ int sp_puttorest(castorder * co) return co->level; } -/* Name: Traumschloeßchen +/* Name: Traumschloe�chen * Stufe: 3 * Kategorie: Region, Gebaeude, positiv * Gebiet: Illaun @@ -4498,7 +4513,7 @@ int sp_icastle(castorder * co) b = new_building(bt_illusion, r, mage->faction->locale); - /* Groeße festlegen. */ + /* Groe�e festlegen. */ if (type == bt_illusion) { b->size = (rng_int() % (int)((power * power) + 1) * 10); } @@ -4676,7 +4691,7 @@ int sp_baddreams(castorder * co) * Kategorie: * Wirkung: * Dieser Zauber ermoeglicht es dem Traeumer, den Schlaf aller aliierten - * Einheiten in der Region so zu beeinflussen, daß sie fuer einige Zeit + * Einheiten in der Region so zu beeinflussen, da� sie fuer einige Zeit * einen Bonus von 1 Talentstufe in allen Talenten * bekommen. Der Zauber wirkt erst im Folgemonat. * Flags: @@ -4791,7 +4806,7 @@ int sp_dreamreading(castorder * co) } u2 = - create_unit(u->region, mage->faction, RS_FARVISION, get_race(RC_SPELL), 0, + create_unit(u->region, mage->faction, 1, get_race(RC_SPELL), 0, "spell/dreamreading", NULL); set_number(u2, 1); u2->age = 2; /* Nur fuer diese Runde. */ @@ -5670,7 +5685,7 @@ int sp_viewreality(castorder * co) region *rt = rl2->data; if (!is_cursed(rt->attribs, C_ASTRALBLOCK, 0)) { u = - create_unit(rt, mage->faction, RS_FARVISION, get_race(RC_SPELL), 0, + create_unit(rt, mage->faction, 1, get_race(RC_SPELL), 0, "spell/viewreality", NULL); set_level(u, SK_PERCEPTION, co->level / 2); u->age = 2; @@ -5973,8 +5988,8 @@ int sp_movecastle(castorder * co) u = unext; } - if ((b->type == bt_find("caravan") || b->type == bt_find("dam") - || b->type == bt_find("tunnel"))) { + if ((is_building_type(b->type, "caravan") || is_building_type(b->type, "dam") + || is_building_type(b->type, "tunnel"))) { direction_t d; for (d = 0; d != MAXDIRECTIONS; ++d) { if (rroad(r, d)) { @@ -6275,21 +6290,21 @@ int sp_q_antimagie(castorder * co) { unit *u = pa->param[0]->data.u; ap = &u->attribs; - ts = unitid(u); + ts = itoa36(u->no); break; } case SPP_BUILDING: { building *b = pa->param[0]->data.b; ap = &b->attribs; - ts = buildingid(b); + ts = itoa36(b->no); break; } case SPP_SHIP: { ship *sh = pa->param[0]->data.sh; ap = &sh->attribs; - ts = shipid(sh); + ts = itoa36(sh->no); break; } default: @@ -6368,21 +6383,21 @@ int sp_break_curse(castorder * co) { unit *u = pa->param[0]->data.u; ap = &u->attribs; - ts = unitid(u); + ts = itoa36(u->no); break; } case SPP_BUILDING: { building *b = pa->param[0]->data.b; ap = &b->attribs; - ts = buildingid(b); + ts = itoa36(b->no); break; } case SPP_SHIP: { ship *sh = pa->param[0]->data.sh; ap = &sh->attribs; - ts = shipid(sh); + ts = itoa36(sh->no); break; } default: @@ -6702,7 +6717,6 @@ void register_spells(void) { register_borders(); - at_register(&at_wdwpyramid); at_register(&at_deathcloud_compat); /* init_firewall(); */ diff --git a/src/spells/borders.c b/src/spells/borders.c index 2c222a9dd..04f7e15f4 100644 --- a/src/spells/borders.c +++ b/src/spells/borders.c @@ -8,10 +8,8 @@ #include #include #include -#include #include #include -#include #include #include diff --git a/src/spells/buildingcurse.c b/src/spells/buildingcurse.c index d3b5ddf36..01b0435ab 100644 --- a/src/spells/buildingcurse.c +++ b/src/spells/buildingcurse.c @@ -12,7 +12,6 @@ */ #include -#include #include "buildingcurse.h" /* kernel includes */ diff --git a/src/spells/combatspells.c b/src/spells/combatspells.c index 0ee3755b3..da7e7085a 100644 --- a/src/spells/combatspells.c +++ b/src/spells/combatspells.c @@ -10,7 +10,6 @@ without prior permission by the authors of Eressea. */ #include -#include #include "combatspells.h" /* kernel includes */ @@ -81,7 +80,7 @@ static const char *spell_damage(int sp) { switch (sp) { case 0: - /* meist tödlich 20-65 HP */ + /* meist t�dlich 20-65 HP */ return "5d10+15"; case 1: /* sehr variabel 4-48 HP */ @@ -90,7 +89,7 @@ static const char *spell_damage(int sp) /* leicht verwundet 4-18 HP */ return "2d8+2"; case 3: - /* fast immer tödlich 30-50 HP */ + /* fast immer t�dlich 30-50 HP */ return "5d5+25"; case 4: /* verwundet 11-26 HP */ @@ -382,11 +381,11 @@ int sp_combatrosthauch(struct castorder * co) ql_free(fgs); if (k == 0) { - /* keine Waffen mehr da, die zerstört werden könnten */ + /* keine Waffen mehr da, die zerst�rt werden k�nnten */ message *msg = msg_message("rust_effect_1", "mage", fi->unit); message_all(b, msg); msg_release(msg); - fi->magic = 0; /* kämpft nichtmagisch weiter */ + fi->magic = 0; /* k�mpft nichtmagisch weiter */ level = 0; } else { @@ -453,7 +452,7 @@ int sp_speed(struct castorder * co) allies = count_allies(fi->side, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE, ALLY_ANY); - /* maximal 2*allies Versuche ein Opfer zu finden, ansonsten bestände + /* maximal 2*allies Versuche ein Opfer zu finden, ansonsten best�nde * die Gefahr eine Endlosschleife*/ allies *= 2; @@ -546,7 +545,7 @@ int sp_mindblast_temp(struct castorder * co) assert(dt.fighter); du = dt.fighter->unit; - if (fval(du, UFL_MARK)) { + if (du->flags & UFL_MARK) { /* not this one again */ continue; } @@ -564,7 +563,7 @@ int sp_mindblast_temp(struct castorder * co) } force -= du->number; } - fset(du, UFL_MARK); + du->flags |= UFL_MARK; reset = 1; enemies -= du->number; } @@ -572,7 +571,7 @@ int sp_mindblast_temp(struct castorder * co) if (reset) { unit *u; for (u = b->region->units; u; u = u->next) { - freset(u, UFL_MARK); + u->flags &= ~UFL_MARK; } } @@ -612,7 +611,7 @@ int sp_mindblast(struct castorder * co) assert(dt.fighter); du = dt.fighter->unit; - if (fval(du, UFL_MARK)) { + if (du->flags & UFL_MARK) { /* not this one again */ continue; } @@ -640,7 +639,7 @@ int sp_mindblast(struct castorder * co) else { /* only works against humanoids, don't try others. but do remove them * from 'force' once or we may never terminate. */ - fset(du, UFL_MARK); + du->flags |= UFL_MARK; reset = 1; } enemies -= du->number; @@ -649,7 +648,7 @@ int sp_mindblast(struct castorder * co) if (reset) { unit *u; for (u = b->region->units; u; u = u->next) { - freset(u, UFL_MARK); + u->flags &= ~UFL_MARK; } } @@ -866,8 +865,8 @@ static fighter *summon_allies(const fighter *fi, const race *rc, int number) { u->hp = u->number * unit_max_hp(u); - if (fval(mage, UFL_ANON_FACTION)) { - fset(u, UFL_ANON_FACTION); + if (mage->flags & UFL_ANON_FACTION) { + u->flags |= UFL_ANON_FACTION; } a = a_new(&at_unitdissolve); @@ -932,8 +931,8 @@ int sp_shadowknights(struct castorder * co) u->hp = u->number * unit_max_hp(u); - if (fval(mage, UFL_ANON_FACTION)) { - fset(u, UFL_ANON_FACTION); + if (mage->flags & UFL_ANON_FACTION) { + u->flags |= UFL_ANON_FACTION; } a = a_new(&at_unitdissolve); @@ -959,13 +958,7 @@ int sp_strong_wall(struct castorder * co) unit *mage = fi->unit; building *burg; double effect; - static bool init = false; message *msg; - static const curse_type *strongwall_ct; - if (!init) { - init = true; - strongwall_ct = ct_find("strongwall"); - } if (!mage->building) { return 0; @@ -973,7 +966,7 @@ int sp_strong_wall(struct castorder * co) burg = mage->building; effect = power / 4; - create_curse(mage, &burg->attribs, strongwall_ct, power, 1, effect, 0); + create_curse(mage, &burg->attribs, ct_find("strongwall"), power, 1, effect, 0); msg = msg_message("sp_strongwalls_effect", "mage building", mage, mage->building); @@ -1022,7 +1015,7 @@ int sp_chaosrow(struct castorder * co) continue; if (power <= 0.0) break; - /* force sollte wegen des _max(0,x) nicht unter 0 fallen können */ + /* force sollte wegen des _max(0,x) nicht unter 0 fallen k�nnen */ if (is_magic_resistant(mage, df->unit, 0)) continue; @@ -1074,7 +1067,7 @@ int sp_chaosrow(struct castorder * co) } /* Gesang der Furcht (Kampfzauber) */ -/* Panik (Präkampfzauber) */ +/* Panik (Pr�kampfzauber) */ int sp_flee(struct castorder * co) { @@ -1120,13 +1113,13 @@ int sp_flee(struct castorder * co) if (force < 0) break; - if (df->person[n].flags & FL_PANICED) { /* bei SPL_SONG_OF_FEAR möglich */ + if (df->person[n].flags & FL_PANICED) { /* bei SPL_SONG_OF_FEAR m�glich */ df->person[n].attack -= 1; --force; ++panik; } else if (!(df->person[n].flags & FL_COURAGE) - || !fval(u_race(df->unit), RCF_UNDEAD)) { + || !(u_race(df->unit)->flags & RCF_UNDEAD)) { if (!is_magic_resistant(mage, df->unit, 0)) { df->person[n].flags |= FL_PANICED; ++panik; @@ -1171,7 +1164,7 @@ int sp_hero(struct castorder * co) allies = count_allies(fi->side, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE, ALLY_ANY); - /* maximal 2*allies Versuche ein Opfer zu finden, ansonsten bestände + /* maximal 2*allies Versuche ein Opfer zu finden, ansonsten best�nde * die Gefahr eine Endlosschleife*/ allies *= 2; @@ -1228,7 +1221,7 @@ int sp_berserk(struct castorder * co) allies = count_allies(fi->side, FIGHT_ROW, BEHIND_ROW - 1, SELECT_ADVANCE, ALLY_ANY); - /* maximal 2*allies Versuche ein Opfer zu finden, ansonsten bestände + /* maximal 2*allies Versuche ein Opfer zu finden, ansonsten best�nde * die Gefahr eine Endlosschleife*/ allies *= 2; @@ -1425,7 +1418,7 @@ int sp_reeling_arrows(struct castorder * co) } /* Magier weicht dem Kampf aus. Wenn er sich bewegen kann, zieht er in - * eine Nachbarregion, wobei ein NACH berücksichtigt wird. Ansonsten + * eine Nachbarregion, wobei ein NACH ber�cksichtigt wird. Ansonsten * bleibt er stehen und nimmt nicht weiter am Kampf teil. */ int sp_denyattack(struct castorder * co) { @@ -1438,17 +1431,16 @@ int sp_denyattack(struct castorder * co) region *r = b->region; message *m; - /* Fliehende Einheiten verlassen auf jeden Fall Gebäude und Schiffe. */ - if (!fval(r->terrain, SEA_REGION)) { + /* Fliehende Einheiten verlassen auf jeden Fall Geb�ude und Schiffe. */ + if (!(r->terrain->flags & SEA_REGION)) { leave(mage, false); } /* und bewachen nicht */ - setguard(mage, GUARD_NONE); + setguard(mage, false); /* irgendwie den langen befehl sperren */ - /* fset(fi, FIG_ATTACKED); */ - /* wir tun so, als wäre die Person geflohen */ - fset(fi, FIG_NOLOOT); + /* wir tun so, als w�re die Person geflohen */ + fi->flags |= FIG_NOLOOT; fi->run.hp = mage->hp; fi->run.number = mage->number; /* fighter leeren */ @@ -1486,7 +1478,7 @@ int sp_armorshield(struct castorder * co) message_all(b, m); msg_release(m); - /* gibt Rüstung +effect für duration Treffer */ + /* gibt R�stung +effect f�r duration Treffer */ switch (sp->id) { case SPL_ARMORSHIELD: @@ -1545,7 +1537,7 @@ int sp_fumbleshield(struct castorder * co) message_all(b, m); msg_release(m); - /* der erste Zauber schlägt mit 100% fehl */ + /* der erste Zauber schl�gt mit 100% fehl */ switch (sp->id) { case SPL_DRAIG_FUMBLESHIELD: @@ -1611,7 +1603,7 @@ int sp_reanimate(struct castorder * co) && u_race(tf->unit) != get_race(RC_DAEMON) && (chance(c))) { assert(tf->alive < tf->unit->number); - /* t.fighter->person[].hp beginnt mit t.index = 0 zu zählen, + /* t.fighter->person[].hp beginnt mit t.index = 0 zu z�hlen, * t.fighter->alive ist jedoch die Anzahl lebender in der Einheit, * also sind die hp von t.fighter->alive * t.fighter->hitpoints[t.fighter->alive-1] und der erste Tote @@ -1674,7 +1666,7 @@ static int heal_fighters(quicklist * fgs, int *power, bool heal_monsters) break; /* Untote kann man nicht heilen */ - if (df->unit->number == 0 || fval(u_race(df->unit), RCF_NOHEAL)) + if (df->unit->number == 0 || (u_race(df->unit)->flags & RCF_NOHEAL)) continue; /* wir heilen erstmal keine Monster */ @@ -1717,8 +1709,8 @@ int sp_healing(struct castorder * co) message *msg; bool use_item = has_ao_healing(mage); - /* bis zu 11 Personen pro Stufe (einen HP müssen sie ja noch - * haben, sonst wären sie tot) können geheilt werden */ + /* bis zu 11 Personen pro Stufe (einen HP m�ssen sie ja noch + * haben, sonst w�ren sie tot) k�nnen geheilt werden */ if (use_item) { healhp *= 2; @@ -1764,7 +1756,7 @@ int sp_undeadhero(struct castorder * co) int force = (int)get_force(power, 0); double c = 0.50 + 0.02 * power; - /* Liste aus allen Kämpfern */ + /* Liste aus allen K�mpfern */ fgs = fighters(b, fi->side, FIGHT_ROW, AVOID_ROW, FS_ENEMY | FS_HELP); scramble_fighters(fgs); @@ -1782,7 +1774,7 @@ int sp_undeadhero(struct castorder * co) if (df->alive + df->run.number < du->number) { int j = 0; - /* Wieviele Untote können wir aus dieser Einheit wecken? */ + /* Wieviele Untote k�nnen wir aus dieser Einheit wecken? */ for (n = df->alive + df->run.number; n != du->number; n++) { if (chance(c)) { ++j; @@ -1806,7 +1798,7 @@ int sp_undeadhero(struct castorder * co) unit_setinfo(u, NULL); } setstatus(u, du->status); - setguard(u, GUARD_NONE); + setguard(u, false); for (ilist = &du->items; *ilist;) { item *itm = *ilist; int loot = itm->number * j / du->number; @@ -1824,8 +1816,8 @@ int sp_undeadhero(struct castorder * co) } /* inherit stealth from magician */ - if (fval(mage, UFL_ANON_FACTION)) { - fset(u, UFL_ANON_FACTION); + if (mage->flags & UFL_ANON_FACTION) { + u->flags |= UFL_ANON_FACTION; } /* transfer dead people to new unit, set hitpoints to those of old unit */ diff --git a/src/spells/flyingship.c b/src/spells/flyingship.c index c58ec270c..2057b72e0 100644 --- a/src/spells/flyingship.c +++ b/src/spells/flyingship.c @@ -1,6 +1,4 @@ #include -#include -#include #include "flyingship.h" #include @@ -28,8 +26,8 @@ * Stufe: 6 * * Wirkung: -* Laeßt ein Schiff eine Runde lang fliegen. Wirkt nur auf Boote -* bis Kapazität 50. +* Lae�t ein Schiff eine Runde lang fliegen. Wirkt nur auf Boote +* bis Kapazit�t 50. * Kombinierbar mit "Guenstige Winde", aber nicht mit "Sturmwind". * * Flag: @@ -82,18 +80,20 @@ int sp_flying_ship(castorder * co) /* melden, 1x pro Partei */ for (u = r->units; u; u = u->next) - freset(u->faction, FFL_SELECT); + u->faction->flags &= ~FFL_SELECT; for (u = r->units; u; u = u->next) { /* das sehen natuerlich auch die Leute an Land */ - if (!fval(u->faction, FFL_SELECT)) { - fset(u->faction, FFL_SELECT); - if (!m) + if (!(u->faction->flags & FFL_SELECT)) { + u->faction->flags |= FFL_SELECT; + if (!m) { m = msg_message("flying_ship_result", "mage ship", mage, sh); + } add_message(&u->faction->msgs, m); } } - if (m) + if (m) { msg_release(m); + } return cast_level; } @@ -121,7 +121,7 @@ static int flyingship_age(curse * c) { ship *sh = (ship *)c->data.v; if (sh && c->duration == 1) { - freset(sh, SF_FLYING); + sh->flags &= ~SF_FLYING; return 1; } return 0; @@ -148,29 +148,26 @@ bool flying_ship(const ship * sh) static curse *shipcurse_flyingship(ship * sh, unit * mage, double power, int duration) { - static const curse_type *ct_flyingship = NULL; - if (!ct_flyingship) { - ct_flyingship = ct_find("flyingship"); - assert(ct_flyingship); - } - if (curse_active(get_curse(sh->attribs, ct_flyingship))) { - return NULL; - } - else if (is_cursed(sh->attribs, C_SHIP_SPEEDUP, 0)) { - return NULL; - } - else { - /* mit C_SHIP_NODRIFT haben wir kein Problem */ - curse *c = - create_curse(mage, &sh->attribs, ct_flyingship, power, duration, 0.0, 0); - if (c) { - c->data.v = sh; - if (c->duration > 0) { - sh->flags |= SF_FLYING; - } + curse *c; + const curse_type *ct_flyingship = ct_find("flyingship"); + assert(ct_flyingship); + if (sh->attribs) { + if (curse_active(get_curse(sh->attribs, ct_flyingship))) { + return NULL; + } + if (is_cursed(sh->attribs, C_SHIP_SPEEDUP, 0)) { + return NULL; } - return c; } + /* mit C_SHIP_NODRIFT haben wir kein Problem */ + c = create_curse(mage, &sh->attribs, ct_flyingship, power, duration, 0.0, 0); + if (c) { + c->data.v = sh; + if (c->duration > 0) { + sh->flags |= SF_FLYING; + } + } + return c; } int levitate_ship(ship * sh, unit * mage, double power, int duration) diff --git a/src/spells/flyingship.h b/src/spells/flyingship.h index 087357b9e..8b7bf0874 100644 --- a/src/spells/flyingship.h +++ b/src/spells/flyingship.h @@ -22,4 +22,5 @@ extern "C" { } #endif -#endif \ No newline at end of file +#endif + diff --git a/src/spells/magicresistance.c b/src/spells/magicresistance.c index 3587a1be6..7b0c1413d 100644 --- a/src/spells/magicresistance.c +++ b/src/spells/magicresistance.c @@ -1,9 +1,10 @@ #include -#include #include #include #include +#include + static struct message *cinfo_magicresistance(const void *obj, objtype_t typ, const struct curse * c, int self) { if (typ == TYP_UNIT) { diff --git a/src/spells/magicresistance.test.c b/src/spells/magicresistance.test.c index 4b0d69388..e9cc98e34 100644 --- a/src/spells/magicresistance.test.c +++ b/src/spells/magicresistance.test.c @@ -1,5 +1,4 @@ #include -#include #include #include #include diff --git a/src/spells/regioncurse.c b/src/spells/regioncurse.c index 382b13b86..3d7593484 100644 --- a/src/spells/regioncurse.c +++ b/src/spells/regioncurse.c @@ -12,7 +12,6 @@ */ #include -#include #include "regioncurse.h" #include "magic.h" @@ -50,7 +49,7 @@ static message *cinfo_cursed_by_the_gods(const void *obj, objtype_t typ, unused_arg(self); assert(typ == TYP_REGION); - if (fval(r->terrain, SEA_REGION)) { + if (r->terrain->flags & SEA_REGION) { return msg_message("curseinfo::godcurseocean", "id", c->no); } return msg_message("curseinfo::godcurse", "id", c->no); diff --git a/src/spells/shipcurse.c b/src/spells/shipcurse.c index 75e07a4ca..59cc534d4 100644 --- a/src/spells/shipcurse.c +++ b/src/spells/shipcurse.c @@ -12,8 +12,6 @@ */ #include -#include -#include #include "shipcurse.h" /* kernel includes */ diff --git a/src/spells/unitcurse.c b/src/spells/unitcurse.c index c29935479..6e769145e 100644 --- a/src/spells/unitcurse.c +++ b/src/spells/unitcurse.c @@ -12,7 +12,6 @@ */ #include -#include #include "unitcurse.h" /* kernel includes */ @@ -22,7 +21,6 @@ #include #include #include -#include /* util includes */ #include diff --git a/src/spy.c b/src/spy.c index 9b8fe4601..5fdd806cc 100644 --- a/src/spy.c +++ b/src/spy.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 1998-2015, Enno Rehling Katja Zedel @@ -17,14 +17,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "spy.h" +#include "guard.h" #include "laws.h" #include "move.h" #include "reports.h" #include "study.h" /* kernel includes */ +#include #include #include #include @@ -43,11 +44,13 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* util includes */ #include #include +#include #include -#include #include #include +#include + /* libc includes */ #include #include @@ -97,13 +100,13 @@ void spy_message(int spy, const unit * u, const unit * target) first = 0; } else { - strncat(buf, ", ", sizeof(buf) - 1); + strlcat(buf, ", ", sizeof(buf)); } - strncat(buf, (const char *)skillname((skill_t)sv->id, u->faction->locale), - sizeof(buf) - 1); - strncat(buf, " ", sizeof(buf) - 1); - strncat(buf, itoa10(eff_skill(target, sv, target->region)), - sizeof(buf) - 1); + strlcat(buf, (const char *)skillname((skill_t)sv->id, u->faction->locale), + sizeof(buf)); + strlcat(buf, " ", sizeof(buf)); + strlcat(buf, itoa10(eff_skill(target, sv, target->region)), + sizeof(buf)); } } if (found) { @@ -296,7 +299,7 @@ int setstealth_cmd(unit * u, struct order *ord) break; } else if (findparam(s, u->faction->locale) == P_NOT) { - freset(u, UFL_ANON_FACTION); + u->flags |= ~UFL_ANON_FACTION; break; } } @@ -413,18 +416,18 @@ static void sink_ship(region * r, ship * sh, unit * saboteur) /* slight optimization to avoid dereferencing u->faction each time */ if (f != u->faction) { f = u->faction; - freset(f, FFL_SELECT); + f->flags |= ~FFL_SELECT; } } /* figure out what a unit's chances of survival are: */ - if (!fval(r->terrain, SEA_REGION)) { + if (!(r->terrain->flags & SEA_REGION)) { probability = CANAL_SWIMMER_CHANCE; } else { for (d = 0; d != MAXDIRECTIONS; ++d) { region *rn = rconnect(r, d); - if (rn && !fval(rn->terrain, SEA_REGION) && !move_blocked(NULL, r, rn)) { + if (rn && !(rn->terrain->flags & SEA_REGION) && !move_blocked(NULL, r, rn)) { safety = rn; probability = OCEAN_SWIMMER_CHANCE; break; @@ -435,7 +438,7 @@ static void sink_ship(region * r, ship * sh, unit * saboteur) unit *u = *ui; /* inform this faction about the sinking ship: */ - if (!fval(u->faction, FFL_SELECT)) { + if (!(u->faction->flags & FFL_SELECT)) { fset(u->faction, FFL_SELECT); if (sink_msg == NULL) { sink_msg = msg_message("sink_msg", "ship region", sh, r); @@ -463,7 +466,7 @@ static void sink_ship(region * r, ship * sh, unit * saboteur) } leave_ship(u); if (r != safety) { - setguard(u, GUARD_NONE); + setguard(u, false); } while (u->items) { i_remove(&u->items, u->items); diff --git a/src/spy.h b/src/spy.h index 72694d4b1..d3ee0c728 100644 --- a/src/spy.h +++ b/src/spy.h @@ -25,6 +25,7 @@ extern "C" { struct unit; struct region; struct strlist; + struct order; extern int setstealth_cmd(struct unit *u, struct order *ord); extern int spy_cmd(struct unit *u, struct order *ord); diff --git a/src/spy.test.c b/src/spy.test.c index b843306f1..299e4b3a6 100644 --- a/src/spy.test.c +++ b/src/spy.test.c @@ -32,7 +32,7 @@ typedef struct { } spy_fixture; static void setup_spy(spy_fixture *fix) { - test_cleanup(); + test_setup(); fix->r = test_create_region(0, 0, NULL); fix->spy = test_create_unit(test_create_faction(NULL), fix->r); fix->victim = test_create_unit(test_create_faction(NULL), fix->r); @@ -88,7 +88,7 @@ static void test_all_spy_message(CuTest *tc) { static void setup_sabotage(void) { struct locale *lang; - test_cleanup(); + test_setup(); lang = get_or_create_locale("de"); locale_setstring(lang, parameters[P_SHIP], "SCHIFF"); locale_setstring(lang, parameters[P_ANY], "ALLE"); diff --git a/src/sqlite.c b/src/sqlite.c index be5f501ac..42bfdb3b5 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -3,13 +3,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include diff --git a/src/study.c b/src/study.c index f0a27606c..1dd4da8b8 100644 --- a/src/study.c +++ b/src/study.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 1998-2015, Enno Rehling Katja Zedel @@ -22,6 +22,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include "study.h" +#include "laws.h" #include "move.h" #include "monster.h" #include "alchemy.h" @@ -94,6 +95,9 @@ magic_t getmagicskill(const struct locale * lang) /* familiars and toads are not migrants */ bool is_migrant(unit * u) { + static int cache; + static const race *toad_rc; + if (u_race(u) == u->faction->race) return false; @@ -101,16 +105,21 @@ bool is_migrant(unit * u) return false; if (is_familiar(u)) return false; - if (u_race(u) == get_race(RC_TOAD)) - return false; - - return true; + if (rc_changed(&cache)) { + toad_rc = get_race(RC_TOAD); + } + return u_race(u) != toad_rc; } /* ------------------------------------------------------------- */ bool magic_lowskill(unit * u) { - return (u_race(u) == get_race(RC_TOAD)) ? true : false; + static const race *toad_rc; + static int cache; + if (rc_changed(&cache)) { + toad_rc = get_race(RC_TOAD); + } + return u_race(u) == toad_rc; } /* ------------------------------------------------------------- */ @@ -277,21 +286,20 @@ teach_unit(unit * teacher, unit * student, int nteaching, skill_t sk, int teach_cmd(unit * u, struct order *ord) { - static const curse_type *gbdream_ct = NULL; plane *pl; region *r = u->region; skill_t sk_academy = NOSKILL; int teaching, i, j, count, academy = 0; - if (gbdream_ct == 0) - gbdream_ct = ct_find("gbdream"); - if (gbdream_ct) { - if (get_curse(u->region->attribs, gbdream_ct)) { - ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "gbdream_noteach", "")); - return 0; + if (u->region->attribs) { + const curse_type *gbdream_ct = ct_find("gbdream"); + if (gbdream_ct) { + if (get_curse(u->region->attribs, gbdream_ct)) { + ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "gbdream_noteach", "")); + return 0; + } } } - if ((u_race(u)->flags & RCF_NOTEACH) || fval(u, UFL_WERE)) { cmistake(u, ord, 274, MSG_EVENT); return 0; @@ -431,7 +439,7 @@ int teach_cmd(unit * u, struct order *ord) strncat(zOrder, " ", sz - 1); --sz; } - sz -= strlcpy(zOrder + 4096 - sz, unitid(u2), sz); + sz -= strlcpy(zOrder + 4096 - sz, itoa36(u2->no), sz); if (getkeyword(u2->thisorder) != K_STUDY) { ADDMSG(&u->faction->msgs, @@ -524,6 +532,16 @@ static double study_speedup(unit * u, skill_t s, study_rule_t rule) return 1.0; } +static bool ExpensiveMigrants(void) +{ + static bool rule; + static int cache; + if (config_changed(&cache)) { + rule = config_get_int("study.expensivemigrants", 0) != 0; + } + return rule; +} + int study_cmd(unit * u, order * ord) { region *r = u->region; @@ -539,6 +557,12 @@ int study_cmd(unit * u, order * ord) int maxalchemy = 0; int speed_rule = (study_rule_t)config_get_int("study.speedup", 0); bool learn_newskills = config_get_int("study.newskills", 1) != 0; + static const race *rc_snotling; + static int rc_cache; + + if (rc_changed(&rc_cache)) { + rc_snotling = get_race(RC_SNOTLING); + } if (!unit_can_study(u)) { ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "error_race_nolearn", "race", @@ -568,7 +592,7 @@ int study_cmd(unit * u, order * ord) } /* snotlings koennen Talente nur bis T8 lernen */ - if (u_race(u) == get_race(RC_SNOTLING)) { + if (u_race(u) == rc_snotling) { if (get_level(u, sk) >= 8) { cmistake(u, ord, 308, MSG_EVENT); return 0; @@ -759,7 +783,7 @@ int study_cmd(unit * u, order * ord) a_remove(&u->attribs, a); a = NULL; } - fset(u, UFL_LONGACTION | UFL_NOTMOVING); + u->flags |= (UFL_LONGACTION | UFL_NOTMOVING); /* Anzeigen neuer Traenke */ /* Spruchlistenaktualiesierung ist in Regeneration */ @@ -793,7 +817,11 @@ int study_cmd(unit * u, order * ord) } static int produceexp_days(void) { - return config_get_int("study.produceexp", 10); + static int config, rule; + if (config_changed(&config)) { + rule = config_get_int("study.produceexp", 10); + } + return rule; } void produceexp_ex(struct unit *u, skill_t sk, int n, learn_fun learn) @@ -856,7 +884,11 @@ void demon_skillchange(unit *u) if (fval(u, UFL_HUNGER)) { /* hungry demons only go down, never up in skill */ - int rule_hunger = config_get_int("hunger.demon.skill", 0) != 0; + static int config; + static bool rule_hunger; + if (config_changed(&config)) { + rule_hunger = config_get_int("hunger.demon.skill", 0) != 0; + } if (rule_hunger) { upchance = 0; downchance = 15; diff --git a/src/study.h b/src/study.h index e136d7345..20903583a 100644 --- a/src/study.h +++ b/src/study.h @@ -45,7 +45,7 @@ extern "C" { void demon_skillchange(struct unit *u); -#define MAXTEACHERS 20 +#define MAXTEACHERS 32 #define TEACHNUMBER 10 typedef struct teaching_info { struct unit *teachers[MAXTEACHERS]; diff --git a/src/study.test.c b/src/study.test.c index 7e0eb8744..47976930d 100644 --- a/src/study.test.c +++ b/src/study.test.c @@ -70,7 +70,7 @@ static void setup_study(study_fixture *fix, skill_t sk) { struct locale *lang; assert(fix); - test_cleanup(); + test_setup(); config_set("study.random_progress", "0"); test_create_world(); r = findregion(0, 0); @@ -138,7 +138,7 @@ static void test_study_bug_2194(CuTest *tc) { struct locale * loc; building * b; - test_cleanup(); + test_setup(); random_source_inject_constant(0.0); init_resources(); loc = get_or_create_locale("de"); @@ -195,7 +195,7 @@ static void test_produceexp(CuTest *tc) { unit *u; g_tc = tc; - test_cleanup(); + test_setup(); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); scale_number(u, 2); config_set("study.produceexp", "20"); @@ -210,7 +210,7 @@ static void test_academy_building(CuTest *tc) { building * b; message * msg; - test_cleanup(); + test_setup(); mt_register(mt_new_va("teach_asgood", "unit:unit", "region:region", "command:order", "student:unit", 0)); random_source_inject_constant(0.0); @@ -253,7 +253,7 @@ static void test_academy_building(CuTest *tc) { void test_learn_skill_single(CuTest *tc) { unit *u; skill *sv; - test_cleanup(); + test_setup(); config_set("study.random_progress", "0"); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); learn_skill(u, SK_ALCHEMY, STUDYDAYS); @@ -272,7 +272,7 @@ void test_learn_skill_single(CuTest *tc) { void test_learn_skill_multi(CuTest *tc) { unit *u; skill *sv; - test_cleanup(); + test_setup(); config_set("study.random_progress", "0"); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); scale_number(u, 10); @@ -291,11 +291,11 @@ void test_learn_skill_multi(CuTest *tc) { static void test_demon_skillchanges(CuTest *tc) { unit * u; - race * rc; - test_cleanup(); + const race * rc; + test_setup(); rc = test_create_race("demon"); - CuAssertPtrEquals(tc, rc, get_race(RC_DAEMON)); - u = test_create_unit(test_create_faction(rc), 0); + CuAssertPtrEquals(tc, (void *)rc, (void *)get_race(RC_DAEMON)); + u = test_create_unit(test_create_faction(rc), test_create_region(0, 0, 0)); CuAssertPtrNotNull(tc, u); set_level(u, SK_CROSSBOW, 1); demon_skillchange(u); @@ -305,7 +305,7 @@ static void test_demon_skillchanges(CuTest *tc) { static void test_study_cmd(CuTest *tc) { unit *u; - test_cleanup(); + test_setup(); init_resources(); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); u->thisorder = create_order(K_STUDY, u->faction->locale, "CROSSBOW"); @@ -318,15 +318,58 @@ static void test_study_cmd(CuTest *tc) { test_cleanup(); } +static void test_study_magic(CuTest *tc) { + unit *u; + faction *f; + const struct locale *lang; + const struct resource_type *rtype; + + test_setup(); + init_resources(); + f = test_create_faction(0); + u = test_create_unit(f, test_create_region(0, 0, 0)); + lang = f->locale; + CuAssertPtrNotNull(tc, rtype = get_resourcetype(R_SILVER)); + u->thisorder = create_order(K_STUDY, lang, "%s", skillnames[SK_MAGIC]); + study_cmd(u, u->thisorder); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "error178")); + free_order(u->thisorder); + + test_clear_messages(f); + u->thisorder = create_order(K_STUDY, lang, "%s %s", skillnames[SK_MAGIC], magic_school[M_GWYRRD]); + study_cmd(u, u->thisorder); + CuAssertPtrNotNull(tc, test_find_messagetype(f->msgs, "error65")); + + test_clear_messages(f); + i_change(&u->items, rtype->itype, 100); + study_cmd(u, u->thisorder); + CuAssertIntEquals(tc, M_GWYRRD, f->magiegebiet); + CuAssertIntEquals(tc, 0, i_get(u->items, rtype->itype)); + CuAssertPtrNotNull(tc, get_mage(u)); + CuAssertPtrEquals(tc, 0, test_find_messagetype(f->msgs, "error65")); + CuAssertIntEquals(tc, M_GWYRRD, get_mage(u)->magietyp); + + /* the static cost array in study_cost prevents this test: + test_clear_messages(f); + config_set("skills.cost.magic", "50"); + i_change(&u->items, rtype->itype, 50); + study_cmd(u, u->thisorder); + CuAssertPtrEquals(tc, 0, test_find_messagetype(f->msgs, "error65")); + */ + + test_cleanup(); +} + static void test_study_cost(CuTest *tc) { unit *u; const struct item_type *itype; - test_cleanup(); + + test_setup(); init_resources(); itype = get_resourcetype(R_SILVER)->itype; u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); scale_number(u, 2); - u->thisorder = create_order(K_STUDY, u->faction->locale, "ALCHEMY"); + u->thisorder = create_order(K_STUDY, u->faction->locale, skillnames[SK_ALCHEMY]); i_change(&u->items, itype, u->number * study_cost(u, SK_ALCHEMY)); learn_inject(); study_cmd(u, u->thisorder); @@ -340,7 +383,7 @@ static void test_study_cost(CuTest *tc) { static void test_teach_cmd(CuTest *tc) { unit *u, *ut; - test_cleanup(); + test_setup(); init_resources(); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); scale_number(u, 10); @@ -360,7 +403,7 @@ static void test_teach_cmd(CuTest *tc) { static void test_teach_two(CuTest *tc) { unit *u1, *u2, *ut; - test_cleanup(); + test_setup(); init_resources(); u1 = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); scale_number(u1, 5); @@ -390,7 +433,7 @@ static void test_teach_two_skills(CuTest *tc) { faction *f; region *r; - test_cleanup(); + test_setup(); init_resources(); f = test_create_faction(0); r = test_create_region(0, 0, 0); @@ -420,7 +463,7 @@ static void test_teach_two_skills(CuTest *tc) { static void test_teach_one_to_many(CuTest *tc) { unit *u, *ut; - test_cleanup(); + test_setup(); init_resources(); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); scale_number(u, 20); @@ -440,7 +483,7 @@ static void test_teach_one_to_many(CuTest *tc) { static void test_teach_many_to_one(CuTest *tc) { unit *u, *u1, *u2; - test_cleanup(); + test_setup(); init_resources(); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); scale_number(u, 20); @@ -467,7 +510,7 @@ static void test_teach_many_to_many(CuTest *tc) { region *r; faction *f; - test_cleanup(); + test_setup(); init_resources(); f = test_create_faction(0); r = test_create_region(0, 0, 0); @@ -505,6 +548,7 @@ CuSuite *get_study_suite(void) CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_study_cmd); SUITE_ADD_TEST(suite, test_study_cost); + SUITE_ADD_TEST(suite, test_study_magic); SUITE_ADD_TEST(suite, test_teach_cmd); SUITE_ADD_TEST(suite, test_teach_two); SUITE_ADD_TEST(suite, test_teach_one_to_many); diff --git a/src/summary.c b/src/summary.c index 6378f3d7f..2311b1994 100644 --- a/src/summary.c +++ b/src/summary.c @@ -1,4 +1,4 @@ -/* +/* * +-------------------+ Christian Schlittchen * | | Enno Rehling * | Eressea PBEM host | Katja Zedel @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -32,6 +31,7 @@ #include #include +#include #include #include #include @@ -58,7 +58,6 @@ typedef struct summary { int landregionen; int regionen_mit_spielern; int landregionen_mit_spielern; - int orkifizierte_regionen; int inactive_volcanos; int active_volcanos; int spielerpferde; @@ -78,28 +77,34 @@ int update_nmrs(void) int i, newplayers = 0; faction *f; int turn = global.data_turn; + int timeout = NMRTimeout(); - if (nmrs == NULL) - nmrs = malloc(sizeof(int) * (NMRTimeout() + 1)); - for (i = 0; i <= NMRTimeout(); ++i) { - nmrs[i] = 0; + if (timeout>0) { + if (nmrs == NULL) { + nmrs = malloc(sizeof(int) * (timeout + 1)); + } + for (i = 0; i <= timeout; ++i) { + nmrs[i] = 0; + } } - + for (f = factions; f; f = f->next) { if (fval(f, FFL_ISNEW)) { ++newplayers; } else if (!fval(f, FFL_NOIDLEOUT|FFL_CURSED)) { int nmr = turn - f->lastorders + 1; - if (nmr < 0 || nmr > NMRTimeout()) { - log_error("faction %s has %d NMR", factionid(f), nmr); - nmr = _max(0, nmr); - nmr = _min(nmr, NMRTimeout()); + if (timeout>0) { + if (nmr < 0 || nmr > timeout) { + log_error("faction %s has %d NMR", itoa36(f->no), nmr); + nmr = _max(0, nmr); + nmr = _min(nmr, timeout); + } + if (nmr > 0) { + log_debug("faction %s has %d NMR", itoa36(f->no), nmr); + } + ++nmrs[nmr]; } - if (nmr > 0) { - log_debug("faction %s has %d NMR", factionid(f), nmr); - } - ++nmrs[nmr]; } } return newplayers; @@ -141,11 +146,18 @@ static char *gamedate2(const struct locale *lang) { static char buf[256]; gamedate gd; + const char *week = "a_week", *month = "a_month"; get_gamedate(turn, &gd); + if (weeknames2) { + week = weeknames2[gd.week]; + } + if (monthnames) { + month = monthnames[gd.month]; + } sprintf(buf, "in %s des Monats %s im Jahre %d %s.", - LOC(lang, weeknames2[gd.week]), - LOC(lang, monthnames[gd.month]), + LOC(lang, week), + LOC(lang, month), gd.year, agename ? LOC(lang, agename) : ""); return buf; } @@ -179,6 +191,7 @@ void report_summary(summary * s, summary * o, bool full) int i, newplayers = 0; faction *f; char zText[MAX_PATH]; + int timeout = NMRTimeout(); if (full) { join_path(basepath(), "parteien.full", zText, sizeof(zText)); @@ -207,12 +220,11 @@ void report_summary(summary * s, summary * o, bool full) fprintf(F, " Helden: %s\n", pcomp(s->heroes, o->heroes)); if (full) { - fprintf(F, "Regionen: %d\n", listlen(regions)); + fprintf(F, "Regionen: %d\n", (int)listlen(regions)); fprintf(F, "Bewohnte Regionen: %d\n", s->inhabitedregions); fprintf(F, "Landregionen: %d\n", s->landregionen); fprintf(F, "Spielerregionen: %d\n", s->regionen_mit_spielern); fprintf(F, "Landspielerregionen: %d\n", s->landregionen_mit_spielern); - fprintf(F, "Orkifizierte Regionen: %d\n", s->orkifizierte_regionen); fprintf(F, "Inaktive Vulkane: %d\n", s->inactive_volcanos); fprintf(F, "Aktive Vulkane: %d\n\n", s->active_volcanos); } @@ -295,12 +307,14 @@ void report_summary(summary * s, summary * o, bool full) newplayers = update_nmrs(); - for (i = 0; i <= NMRTimeout(); ++i) { - if (i == NMRTimeout()) { - fprintf(F, "+ NMR:\t\t %d\n", nmrs[i]); - } - else { - fprintf(F, "%d NMR:\t\t %d\n", i, nmrs[i]); + if (nmrs) { + for (i = 0; i <= timeout; ++i) { + if (i == timeout) { + fprintf(F, "+ NMR:\t\t %d\n", nmrs[i]); + } + else { + fprintf(F, "%d NMR:\t\t %d\n", i, nmrs[i]); + } } } if (age) { @@ -314,18 +328,18 @@ void report_summary(summary * s, summary * o, bool full) fprintf(F, "Neue Spieler:\t %d\n", newplayers); if (full) { - if (factions) + if (factions) { fprintf(F, "\nParteien:\n\n"); - - for (f = factions; f; f = f->next) { - out_faction(F, f); + for (f = factions; f; f = f->next) { + out_faction(F, f); + } } - if (NMRTimeout() && full) { + if (timeout>0 && full) { fprintf(F, "\n\nFactions with NMRs:\n"); - for (i = NMRTimeout(); i > 0; --i) { + for (i = timeout; i > 0; --i) { for (f = factions; f; f = f->next) { - if (i == NMRTimeout()) { + if (i == timeout) { if (turn - f->lastorders >= i) { out_faction(F, f); } @@ -350,6 +364,15 @@ void report_summary(summary * s, summary * o, bool full) nmrs = NULL; } +void free_summary(summary *sum) { + while (sum->languages) { + struct language *next = sum->languages->next; + free(sum->languages); + sum->languages = next; + } + free(sum); +} + summary *make_summary(void) { faction *f; @@ -396,9 +419,6 @@ summary *make_summary(void) if (r->units) { s->landregionen_mit_spielern++; } - if (fval(r, RF_ORCIFIED)) { - s->orkifizierte_regionen++; - } if (r->terrain == newterrain(T_VOLCANO)) { s->inactive_volcanos++; } diff --git a/src/summary.h b/src/summary.h index aa1491a21..ea8daeee1 100644 --- a/src/summary.h +++ b/src/summary.h @@ -19,7 +19,7 @@ extern "C" { void report_summary(struct summary *n, struct summary *o, bool full); struct summary *make_summary(void); - + void free_summary(struct summary *sum); int update_nmrs(void); extern int* nmrs; diff --git a/src/summary.test.c b/src/summary.test.c new file mode 100644 index 000000000..93c4d4c84 --- /dev/null +++ b/src/summary.test.c @@ -0,0 +1,31 @@ +#include + +#include "summary.h" +#include "calendar.h" + +#include +#include "tests.h" + +#include + +static void test_summary(CuTest * tc) +{ + struct summary *sum; + test_setup(); + test_create_faction(0); + test_create_faction(0); + sum = make_summary(); + report_summary(sum, sum, true); + CuAssertIntEquals(tc, 0, remove("parteien.full")); + CuAssertIntEquals(tc, 0, remove("datum")); + CuAssertIntEquals(tc, 0, remove("turn")); + free_summary(sum); + test_cleanup(); +} + +CuSuite *get_summary_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_summary); + return suite; +} diff --git a/src/teleport.c b/src/teleport.c index 5b7f71831..74176f6af 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -176,14 +176,16 @@ bool is_astral(const region * r) plane *get_astralplane(void) { plane *astralspace = 0; - int rule_astralplane = config_get_int("modules.astralspace", 1); - + static int config; + static bool rule_astralplane; + + if (config_changed(&config)) { + rule_astralplane = config_get_int("modules.astralspace", 1) != 0; + } if (!rule_astralplane) { return NULL; } - if (!astralspace) { - astralspace = getplanebyname("Astralraum"); - } + astralspace = getplanebyname("Astralraum"); if (!astralspace) { astralspace = create_new_plane(1, "Astralraum", TE_CENTER_X - 500, TE_CENTER_X + 500, diff --git a/src/test_eressea.c b/src/test_eressea.c index 4ea68180c..71cf008f2 100644 --- a/src/test_eressea.c +++ b/src/test_eressea.c @@ -60,8 +60,6 @@ int RunAllTests(int argc, char *argv[]) { /* self-test */ ADD_SUITE(tests); - ADD_SUITE(callback); - ADD_SUITE(seen); ADD_SUITE(json); ADD_SUITE(jsonconf); ADD_SUITE(direction); @@ -76,6 +74,7 @@ int RunAllTests(int argc, char *argv[]) ADD_SUITE(bsdstring); ADD_SUITE(functions); ADD_SUITE(gamedata); + ADD_SUITE(language); ADD_SUITE(parser); ADD_SUITE(password); ADD_SUITE(umlaut); @@ -100,6 +99,7 @@ int RunAllTests(int argc, char *argv[]) ADD_SUITE(magic); ADD_SUITE(alchemy); ADD_SUITE(reports); + ADD_SUITE(region); ADD_SUITE(save); ADD_SUITE(ship); ADD_SUITE(spellbook); @@ -110,18 +110,26 @@ int RunAllTests(int argc, char *argv[]) ADD_SUITE(ally); ADD_SUITE(messages); /* gamecode */ - ADD_SUITE(prefix); + ADD_SUITE(guard); + ADD_SUITE(report); + ADD_SUITE(creport); + ADD_SUITE(summary); + ADD_SUITE(names); ADD_SUITE(battle); + ADD_SUITE(volcano); ADD_SUITE(donations); ADD_SUITE(travelthru); ADD_SUITE(economy); ADD_SUITE(flyingship); ADD_SUITE(give); ADD_SUITE(laws); + ADD_SUITE(lighthouse); ADD_SUITE(market); ADD_SUITE(monsters); ADD_SUITE(move); ADD_SUITE(piracy); + ADD_SUITE(prefix); + ADD_SUITE(renumber); ADD_SUITE(key); ADD_SUITE(stealth); ADD_SUITE(otherfaction); @@ -156,7 +164,6 @@ int RunAllTests(int argc, char *argv[]) } int main(int argc, char ** argv) { - log_to_file(LOG_CPERROR, stderr); ++argv; --argc; if (argc > 0 && strcmp("--list", argv[0]) == 0) { diff --git a/src/tests.c b/src/tests.c index 120d62e12..15ae677fe 100644 --- a/src/tests.c +++ b/src/tests.c @@ -1,7 +1,6 @@ #include #include "tests.h" #include "keyword.h" -#include "seen.h" #include "prefix.h" #include "reports.h" @@ -24,13 +23,14 @@ #include #include #include +#include #include #include #include +#include #include -#include #include #include #include @@ -93,16 +93,14 @@ struct locale * test_create_locale(void) { for (i = 0; i != MAXKEYWORDS; ++i) { locale_setstring(loc, mkname("keyword", keywords[i]), keywords[i]); } - for (i = 0; i != MAXSKILLS; ++i) { - locale_setstring(loc, mkname("skill", skillnames[i]), skillnames[i]); - } for (i = 0; i != MAXPARAMS; ++i) { locale_setstring(loc, parameters[i], parameters[i]); test_translate_param(loc, i, parameters[i]); } - init_parameters(loc); - init_keywords(loc); - init_skills(loc); + for (i = 0; i != MAXMAGIETYP; ++i) { + locale_setstring(loc, mkname("school", magic_school[i]), magic_school[i]); + } + init_locale(loc); } return loc; } @@ -118,16 +116,57 @@ struct faction *test_create_faction(const struct race *rc) struct unit *test_create_unit(struct faction *f, struct region *r) { const struct race * rc = f ? f->race : 0; - assert(f || !r); + assert(f && r); if (!rc) rc = rc_get_or_create("human"); return create_unit(r, f, 1, rc ? rc : rc_get_or_create("human"), 0, 0, 0); } -void test_cleanup(void) -{ - int i; +static void log_list(void *udata, int flags, const char *module, const char *format, va_list args) { + strlist **slp = (strlist **)udata; + addstrlist(slp, format); +} +struct log_t * test_log_start(int flags, strlist **slist) { + return log_create(flags, slist, log_list); +} + +void test_log_stop(struct log_t *log, struct strlist *slist) { + freestrlist(slist); + log_destroy(log); +} + +void test_log_stderr(int flags) { + static struct log_t *stderrlog; + if (flags) { + if (stderrlog) { + log_error("stderr logging is still active. did you call test_cleanup?"); + log_destroy(stderrlog); + } + stderrlog = log_to_file(flags, stderr); + } + else { + if (stderrlog) { + log_destroy(stderrlog); + } + else { + log_warning("stderr logging is inactive. did you call test_cleanup twice?"); + } + stderrlog = 0; + } + +} + +static void test_reset(void) { + int i; + turn = 0; default_locale = 0; + + if (errno) { + int error = errno; + errno = 0; + log_error("errno: %d (%s)", error, strerror(error)); + } + free_gamedata(); free_terrains(); free_resources(); @@ -140,7 +179,6 @@ void test_cleanup(void) free_shiptypes(); free_races(); free_spellbooks(); - free_seen(); free_prefixes(); mt_clear(); for (i = 0; i != MAXSKILLS; ++i) { @@ -149,13 +187,30 @@ void test_cleanup(void) for (i = 0; i != MAXKEYWORDS; ++i) { enable_keyword(i, true); } + random_source_reset(); + if (errno) { int error = errno; errno = 0; log_error("errno: %d (%s)", error, strerror(error)); } +} - random_source_reset(); +void test_setup_test(CuTest *tc, const char *file, int line) { + test_log_stderr(LOG_CPERROR); + test_reset(); + if (tc) { + log_debug("start test: %s", tc->name); + } + else { + log_debug("start test in %s:%d", file, line); + } +} + +void test_cleanup(void) +{ + test_reset(); + test_log_stderr(0); } terrain_type * @@ -168,7 +223,9 @@ test_create_terrain(const char * name, unsigned int flags) building * test_create_building(region * r, const building_type * btype) { - building * b = new_building(btype ? btype : test_create_buildingtype("castle"), r, default_locale); + building * b; + assert(r); + b = new_building(btype ? btype : test_create_buildingtype("castle"), r, default_locale); b->size = b->type->maxsize > 0 ? b->type->maxsize : 1; return b; } @@ -191,6 +248,7 @@ ship_type * test_create_shiptype(const char * name) stype->damage = 1; if (!stype->construction) { stype->construction = calloc(1, sizeof(construction)); + assert_alloc(stype->construction); stype->construction->maxsize = 5; stype->construction->minskill = 1; stype->construction->reqsize = 1; @@ -259,6 +317,7 @@ spell * test_create_spell(void) sp = create_spell("testspell", 0); sp->components = (spell_component *)calloc(4, sizeof(spell_component)); + assert_alloc(sp->components); sp->components[0].amount = 1; sp->components[0].type = get_resourcetype(R_SILVER); sp->components[0].cost = SPC_FIX; @@ -377,17 +436,38 @@ const char * test_get_messagetype(const message *msg) { return name; } -struct message * test_find_messagetype(struct message_list *msgs, const char *name) { +struct message * test_find_messagetype_ex(struct message_list *msgs, const char *name, struct message *prev) +{ struct mlist *ml; if (!msgs) return 0; for (ml = msgs->begin; ml; ml = ml->next) { if (strcmp(name, test_get_messagetype(ml->msg)) == 0) { - return ml->msg; + if (prev) { + if (ml->msg == prev) { + prev = NULL; + } + } + else { + return ml->msg; + } } } return 0; } +struct message * test_find_messagetype(struct message_list *msgs, const char *name) +{ + return test_find_messagetype_ex(msgs, name, NULL); +} + +void test_clear_messagelist(message_list **msgs) { + if (*msgs) { + free_messagelist((*msgs)->begin); + free(*msgs); + *msgs = NULL; + } +} + void test_clear_messages(faction *f) { if (f->msgs) { free_messagelist(f->msgs->begin); diff --git a/src/tests.h b/src/tests.h index d18ff6456..c99147e6a 100644 --- a/src/tests.h +++ b/src/tests.h @@ -26,10 +26,19 @@ extern "C" { struct spellparameter; struct spell; struct locale; + struct strlist; + struct log_t; struct CuTest; + void test_setup_test(struct CuTest *tc, const char *file, int line); +#define test_setup() test_setup_test(NULL, __FILE__, __LINE__) +#define test_setup_ex(tc) test_setup_test(tc, __FILE__, __LINE__) + void test_cleanup(void); + void test_log_stderr(int on); + struct log_t * test_log_start(int flags, struct strlist **slist); + void test_log_stop(struct log_t *log, struct strlist *slist); struct locale * test_create_locale(void); struct terrain_type * test_create_terrain(const char * name, unsigned int flags); @@ -51,9 +60,11 @@ extern "C" { int RunAllTests(void); void test_translate_param(const struct locale *lang, param_t param, const char *text); const char * test_get_messagetype(const struct message *msg); + struct message * test_find_messagetype_ex(struct message_list *msgs, const char *name, struct message *prev); struct message * test_find_messagetype(struct message_list *msgs, const char *name); struct message * test_get_last_message(struct message_list *mlist); void test_clear_messages(struct faction *f); + void test_clear_messagelist(struct message_list **msgs); void assert_message(struct CuTest * tc, struct message *msg, char *name, int numpar); void assert_pointer_parameter(struct CuTest * tc, struct message *msg, int index, void *arg); diff --git a/src/tests.test.c b/src/tests.test.c index 3a9732609..9dd47e4d1 100644 --- a/src/tests.test.c +++ b/src/tests.test.c @@ -12,7 +12,7 @@ static void test_resources(CuTest *tc) { resource_type *rtype; - test_cleanup(); + test_setup(); init_resources(); CuAssertPtrNotNull(tc, rt_find("hp")); CuAssertPtrEquals(tc, rt_find("hp"), (void *)get_resourcetype(R_LIFE)); @@ -36,7 +36,7 @@ static void test_resources(CuTest *tc) { static void test_recreate_world(CuTest * tc) { - test_cleanup(); + test_setup(); CuAssertPtrEquals(tc, 0, get_locale("de")); CuAssertPtrEquals(tc, 0, (void *)rt_find("horse")); diff --git a/src/travelthru.c b/src/travelthru.c index 32607ae5c..5e6cac41b 100644 --- a/src/travelthru.c +++ b/src/travelthru.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 1998-2015, Enno Rehling Katja Zedel @@ -64,6 +64,8 @@ attrib_type at_travelunit = { */ void travelthru_add(region * r, unit * u) { + region *next[MAXDIRECTIONS]; + int d; attrib *a; quicklist *ql; @@ -80,12 +82,14 @@ void travelthru_add(region * r, unit * u) ql_push(&ql, u); a->data.v = ql; -#ifdef SMART_INTERVALS /* the first and last region of the faction gets reset, because travelthrough * could be in regions that are located before the [first, last] interval, * and recalculation is needed */ update_interval(u->faction, r); -#endif + get_neighbours(r, next); + for (d=0;d!=MAXDIRECTIONS;++d) { + update_interval(u->faction, next[d]); + } } bool travelthru_cansee(const struct region *r, const struct faction *f, const struct unit *u) { diff --git a/src/travelthru.h b/src/travelthru.h index 4e43dd25a..16452869a 100644 --- a/src/travelthru.h +++ b/src/travelthru.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #ifndef H_TRAVELTHRU #define H_TRAVELTHRU diff --git a/src/travelthru.test.c b/src/travelthru.test.c index 74ab29b7e..be87743d2 100644 --- a/src/travelthru.test.c +++ b/src/travelthru.test.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/triggers/CMakeLists.txt b/src/triggers/CMakeLists.txt index 18561f521..d6670a95b 100644 --- a/src/triggers/CMakeLists.txt +++ b/src/triggers/CMakeLists.txt @@ -11,7 +11,6 @@ killunit.c shock.c timeout.c triggers.c -unguard.c unitmessage.c ) FOREACH(_FILE ${_FILES}) diff --git a/src/triggers/changefaction.c b/src/triggers/changefaction.c index 13785dfb9..37d993f4a 100644 --- a/src/triggers/changefaction.c +++ b/src/triggers/changefaction.c @@ -17,12 +17,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "changefaction.h" /* kernel includes */ #include -#include #include /* util includes */ diff --git a/src/triggers/changerace.c b/src/triggers/changerace.c index 0e7fc997e..f38b7f3d5 100644 --- a/src/triggers/changerace.c +++ b/src/triggers/changerace.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "changerace.h" /* kernel includes */ diff --git a/src/triggers/changerace.h b/src/triggers/changerace.h index 1b08110b3..e6b19dcb0 100644 --- a/src/triggers/changerace.h +++ b/src/triggers/changerace.h @@ -26,6 +26,7 @@ extern "C" { struct trigger_type; struct trigger; struct unit; + struct race; extern struct trigger_type tt_changerace; diff --git a/src/triggers/clonedied.c b/src/triggers/clonedied.c index 37693fdbf..642b50ab0 100644 --- a/src/triggers/clonedied.c +++ b/src/triggers/clonedied.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "clonedied.h" #include "magic.h" diff --git a/src/triggers/createcurse.c b/src/triggers/createcurse.c index d0d65571b..040a4e7b7 100644 --- a/src/triggers/createcurse.c +++ b/src/triggers/createcurse.c @@ -17,11 +17,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "createcurse.h" /* kernel includes */ -#include #include #include diff --git a/src/triggers/createunit.c b/src/triggers/createunit.c index 6e98901ca..5952c88bc 100644 --- a/src/triggers/createunit.c +++ b/src/triggers/createunit.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "createunit.h" /* kernel includes */ @@ -25,7 +24,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include /* util includes */ #include diff --git a/src/triggers/createunit.h b/src/triggers/createunit.h index 31649b868..d2337d306 100644 --- a/src/triggers/createunit.h +++ b/src/triggers/createunit.h @@ -28,6 +28,7 @@ extern "C" { struct region; struct faction; struct unit; + struct race; extern struct trigger_type tt_createunit; diff --git a/src/triggers/gate.c b/src/triggers/gate.c index 2a9c5693d..e681efc04 100644 --- a/src/triggers/gate.c +++ b/src/triggers/gate.c @@ -10,14 +10,12 @@ without prior permission by the authors of Eressea. */ #include -#include #include "gate.h" /* kernel includes */ #include #include #include -#include /* util includes */ #include diff --git a/src/triggers/giveitem.c b/src/triggers/giveitem.c index d4a56162b..6b0e8f8c7 100644 --- a/src/triggers/giveitem.c +++ b/src/triggers/giveitem.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "giveitem.h" /* kernel includes */ diff --git a/src/triggers/killunit.c b/src/triggers/killunit.c index 23275a6af..22ad27896 100644 --- a/src/triggers/killunit.c +++ b/src/triggers/killunit.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "killunit.h" #include diff --git a/src/triggers/shock.c b/src/triggers/shock.c index 75904e346..7c54676e0 100644 --- a/src/triggers/shock.c +++ b/src/triggers/shock.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "shock.h" #include "magic.h" @@ -84,7 +83,7 @@ static void do_shock(unit * u, const char *reason) } /* Dies ist ein Hack, um das skillmod und familiar-Attribut beim Mage - * zu löschen wenn der Familiar getötet wird. Da sollten wir über eine + * zu l�schen wenn der Familiar get�tet wird. Da sollten wir �ber eine * saubere Implementation nachdenken. */ if (strcmp(reason, "trigger") == 0) { @@ -118,7 +117,7 @@ static void shock_write(const trigger * t, struct storage *store) next = next->next; } if (next && u) { - log_error("more than one shock-attribut for %s on a unit. FIXED.\n", unitid(u)); + log_error("more than one shock-attribut for %s on a unit. FIXED.\n", itoa36(u->no)); write_unit_reference(NULL, store); } else { diff --git a/src/triggers/shock.test.c b/src/triggers/shock.test.c index 77bc192dc..058dfaae3 100644 --- a/src/triggers/shock.test.c +++ b/src/triggers/shock.test.c @@ -12,8 +12,8 @@ static void test_shock(CuTest *tc) { unit *u; trigger *tt; - test_cleanup(); + test_setup(); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); create_mage(u, M_GRAY); set_level(u, SK_MAGIC, 5); @@ -32,8 +32,8 @@ static void test_shock(CuTest *tc) { static void test_shock_low(CuTest *tc) { unit *u; trigger *tt; - test_cleanup(); + test_setup(); u = test_create_unit(test_create_faction(0), test_create_region(0, 0, 0)); create_mage(u, M_GRAY); set_level(u, SK_MAGIC, 5); diff --git a/src/triggers/timeout.c b/src/triggers/timeout.c index 06fa18363..10e4d08be 100644 --- a/src/triggers/timeout.c +++ b/src/triggers/timeout.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include #include "timeout.h" /* util includes */ diff --git a/src/triggers/triggers.c b/src/triggers/triggers.c index 152fdcb58..433201abd 100644 --- a/src/triggers/triggers.c +++ b/src/triggers/triggers.c @@ -17,7 +17,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ #include -#include /* triggers includes */ #include @@ -25,7 +24,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include #include #include @@ -46,7 +44,6 @@ void register_triggers(void) tt_register(&tt_createcurse); tt_register(&tt_createunit); tt_register(&tt_gate); - tt_register(&tt_unguard); tt_register(&tt_giveitem); tt_register(&tt_killunit); tt_register(&tt_shock); diff --git a/src/triggers/unguard.c b/src/triggers/unguard.c deleted file mode 100644 index e6471f977..000000000 --- a/src/triggers/unguard.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - +-------------------+ Christian Schlittchen - | | Enno Rehling - | Eressea PBEM host | Katja Zedel - | (c) 1998 - 2003 | Henning Peters - | | Ingo Wilken - +-------------------+ Stefan Reich - - This program may not be used, modified or distributed - without prior permission by the authors of Eressea. - */ -#include -#include -#include "unguard.h" - -/* kernel includes */ -#include -#include -#include -#include - -/* util includes */ -#include -#include -#include -#include -#include - -/* libc includes */ -#include - -static int unguard_handle(trigger * t, void *data) -{ - building *b = (building *)t->data.v; - - if (b) { - fset(b, BLD_UNGUARDED); - } - else { - log_error("could not perform unguard::handle()\n"); - return -1; - } - unused_arg(data); - return 0; -} - -static void unguard_write(const trigger * t, struct storage *store) -{ - write_building_reference((building *)t->data.v, store); -} - -static int unguard_read(trigger * t, gamedata *data) -{ - int rb = read_reference(&t->data.v, data, read_building_reference, - resolve_building); - if (rb == 0 && !t->data.v) { - return AT_READ_FAIL; - } - return AT_READ_OK; -} - -struct trigger_type tt_unguard = { - "building", - NULL, - NULL, - unguard_handle, - unguard_write, - unguard_read -}; - -trigger *trigger_unguard(building * b) -{ - trigger *t = t_new(&tt_unguard); - t->data.v = (void *)b; - return t; -} diff --git a/src/triggers/unguard.h b/src/triggers/unguard.h deleted file mode 100644 index f36f527f8..000000000 --- a/src/triggers/unguard.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - +-------------------+ Christian Schlittchen - | | Enno Rehling - | Eressea PBEM host | Katja Zedel - | (c) 1998 - 2003 | Henning Peters - | | Ingo Wilken - +-------------------+ Stefan Reich - - This program may not be used, modified or distributed - without prior permission by the authors of Eressea. -*/ - -#ifndef UNGUARD_H -#define UNGUARD_H -#ifdef __cplusplus -extern "C" { -#endif - -/* all types we use are defined here to reduce dependencies */ - struct trigger_type; - struct trigger; - struct region; - struct building; - - extern struct trigger_type tt_unguard; - - extern struct trigger *trigger_unguard(struct building *b); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/src/triggers/unitmessage.c b/src/triggers/unitmessage.c index 2d869fc49..0c1e80124 100644 --- a/src/triggers/unitmessage.c +++ b/src/triggers/unitmessage.c @@ -8,7 +8,6 @@ without prior permission by the authors of Eressea. */ #include -#include #include "unitmessage.h" /* kernel includes */ diff --git a/src/upkeep.c b/src/upkeep.c index 5d114c74e..198ce73df 100644 --- a/src/upkeep.c +++ b/src/upkeep.c @@ -58,27 +58,28 @@ static void help_feed(unit * donor, unit * u, int *need_p) *need_p = need; } +static const char *hunger_damage(const race *rc) { + const char * damage = get_param(rc->parameters, "hunger.damage"); + if (!damage) { + damage = config_get("hunger.damage"); + } + if (!damage) { + damage = "1d12+12"; + } + return damage; +} + static bool hunger(int number, unit * u) { region *r = u->region; int dead = 0, hpsub = 0; int hp = u->hp / u->number; - static const char *damage = 0; - static const char *rcdamage = 0; - static const race *rc = 0; + const char *damage = 0; - if (!damage) { - damage = config_get("hunger.damage"); - if (damage == NULL) - damage = "1d12+12"; - } - if (rc != u_race(u)) { - rcdamage = get_param(u_race(u)->parameters, "hunger.damage"); - rc = u_race(u); - } + damage = hunger_damage(u_race(u)); while (number--) { - int dam = dice_rand(rcdamage ? rcdamage : damage); + int dam = dice_rand(damage); if (dam >= hp) { ++dead; } @@ -114,7 +115,12 @@ void get_food(region * r) unit *u; int peasantfood = rpeasants(r) * 10; int food_rules = config_get_int("rules.food.flags", 0); - + static const race *rc_demon; + static int rc_cache; + + if (rc_changed(&rc_cache)) { + rc_demon = get_race(RC_DAEMON); + } if (food_rules & FOOD_IS_FREE) { return; } @@ -227,7 +233,7 @@ void get_food(region * r) * bei fehlenden Bauern den Dämon hungern lassen */ for (u = r->units; u; u = u->next) { - if (u_race(u) == get_race(RC_DAEMON)) { + if (u_race(u) == rc_demon) { int hungry = u->number; /* use peasantblood before eating the peasants themselves */ @@ -249,7 +255,7 @@ void get_food(region * r) if (donor == u) donor = r->units; while (donor != NULL) { - if (u_race(donor) == get_race(RC_DAEMON) && donor != u) { + if (u_race(donor) == rc_demon && donor != u) { if (get_effect(donor, pt_blood)) { /* if he's in our faction, drain him: */ if (donor->faction == u->faction) diff --git a/src/upkeep.test.c b/src/upkeep.test.c index bba43a95f..e84402d4b 100644 --- a/src/upkeep.test.c +++ b/src/upkeep.test.c @@ -1,4 +1,4 @@ -#include +#include #include "upkeep.h" #include @@ -19,7 +19,7 @@ void test_upkeep_default(CuTest * tc) faction *f1, *f2; const item_type *i_silver; - test_cleanup(); + test_setup(); test_create_world(); i_silver = it_find("money"); @@ -50,7 +50,7 @@ void test_upkeep_hunger_damage(CuTest * tc) faction *f1; const item_type *i_silver; - test_cleanup(); + test_setup(); test_create_world(); i_silver = it_find("money"); @@ -75,16 +75,17 @@ void test_upkeep_from_pool(CuTest * tc) unit *u1, *u2; const item_type *i_silver; - test_cleanup(); + test_setup(); test_create_world(); i_silver = it_find("money"); assert(i_silver); r = findregion(0, 0); + assert(r); u1 = test_create_unit(test_create_faction(test_create_race("human")), r); assert(u1); u2 = test_create_unit(u1->faction, r); - assert(r && u1 && u2); + assert(u2); config_set("rules.food.flags", "0"); i_change(&u1->items, i_silver, 30); @@ -108,7 +109,7 @@ void test_upkeep_from_friend(CuTest * tc) faction *f1, *f2; const item_type *i_silver; - test_cleanup(); + test_setup(); test_create_world(); i_silver = it_find("money"); @@ -142,7 +143,7 @@ void test_upkeep_free(CuTest * tc) unit *u; const item_type *i_silver; - test_cleanup(); + test_setup(); test_create_world(); i_silver = it_find("money"); diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 46dce6801..7eda87132 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -11,7 +11,7 @@ bsdstring.test.c functions.test.c gamedata.test.c # goodies.test.c -# language.test.c +language.test.c # lists.test.c # log.test.c # message.test.c @@ -46,6 +46,7 @@ language.c lists.c log.c message.c +mt19937ar.c nrmessage.c parser.c password.c diff --git a/src/util/assert.h b/src/util/assert.h new file mode 100644 index 000000000..79abce73e --- /dev/null +++ b/src/util/assert.h @@ -0,0 +1,7 @@ +#ifndef UTIL_ASSERT_H +#define UTIL_ASSERT_H + +#include + +#define assert_alloc(expr) assert((expr) || !"out of memory") +#endif diff --git a/src/util/attrib.c b/src/util/attrib.c index c22570356..4bdf35bfa 100644 --- a/src/util/attrib.c +++ b/src/util/attrib.c @@ -28,6 +28,119 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include +#include + +int read_attribs(gamedata *data, attrib **alist, void *owner) { + int result; + if (data->version < ATHASH_VERSION) { + result = a_read_orig(data, alist, owner); + } + else { + result = a_read(data, alist, owner); + } + if (result == AT_READ_DEPR) { + /* handle deprecated attributes */ + attrib *a = *alist; + while (a) { + if (a->type->upgrade) { + a->type->upgrade(alist, a); + } + a = a->nexttype; + } + } + return result; +} + +void write_attribs(storage *store, attrib *alist, const void *owner) +{ +#if RELEASE_VERSION < ATHASH_VERSION + a_write_orig(store, alist, owner); +#else + a_write(store, alist, owner); +#endif +} + +int a_readint(attrib * a, void *owner, struct gamedata *data) +{ + int n; + READ_INT(data->store, &n); + if (a) a->data.i = n; + return AT_READ_OK; +} + +void a_writeint(const attrib * a, const void *owner, struct storage *store) +{ + WRITE_INT(store, a->data.i); +} + +int a_readshorts(attrib * a, void *owner, struct gamedata *data) +{ + int n; + READ_INT(data->store, &n); + a->data.sa[0] = (short)n; + READ_INT(data->store, &n); + a->data.sa[1] = (short)n; + return AT_READ_OK; +} + +void a_writeshorts(const attrib * a, const void *owner, struct storage *store) +{ + WRITE_INT(store, a->data.sa[0]); + WRITE_INT(store, a->data.sa[1]); +} + +int a_readchars(attrib * a, void *owner, struct gamedata *data) +{ + int i; + for (i = 0; i != 4; ++i) { + int n; + READ_INT(data->store, &n); + a->data.ca[i] = (char)n; + } + return AT_READ_OK; +} + +void a_writechars(const attrib * a, const void *owner, struct storage *store) +{ + int i; + + for (i = 0; i != 4; ++i) { + WRITE_INT(store, a->data.ca[i]); + } +} + +#define DISPLAYSIZE 8192 +int a_readstring(attrib * a, void *owner, struct gamedata *data) +{ + char buf[DISPLAYSIZE]; + char * result = 0; + int e; + size_t len = 0; + do { + e = READ_STR(data->store, buf, sizeof(buf)); + if (result) { + result = realloc(result, len + DISPLAYSIZE - 1); + strcpy(result + len, buf); + len += DISPLAYSIZE - 1; + } + else { + result = _strdup(buf); + } + } while (e == ENOMEM); + a->data.v = result; + return AT_READ_OK; +} + +void a_writestring(const attrib * a, const void *owner, struct storage *store) +{ + assert(a->data.v); + WRITE_STR(store, (const char *)a->data.v); +} + +void a_finalizestring(attrib * a) +{ + free(a->data.v); +} #define MAXATHASH 61 static attrib_type *at_hash[MAXATHASH]; @@ -412,6 +525,7 @@ void a_write_orig(struct storage *store, const attrib * attribs, const void *own WRITE_TOK(store, "end"); } -void free_attribs(void) { +void attrib_done(void) { cb_clear(&cb_deprecated); + memset(at_hash, 0, sizeof at_hash); } diff --git a/src/util/attrib.h b/src/util/attrib.h index b41ac2bcf..d93ce1240 100644 --- a/src/util/attrib.h +++ b/src/util/attrib.h @@ -66,6 +66,9 @@ extern "C" { extern void at_register(attrib_type * at); extern void at_deprecate(const char * name, int(*reader)(attrib *, void *, struct gamedata *)); + void write_attribs(struct storage *store, struct attrib *alist, const void *owner); + int read_attribs(struct gamedata *store, struct attrib **alist, void *owner); + extern attrib *a_select(attrib * a, const void *data, bool(*compare) (const attrib *, const void *)); extern attrib *a_find(attrib * a, const attrib_type * at); @@ -81,7 +84,21 @@ extern "C" { int a_read(struct gamedata *data, attrib ** attribs, void *owner); void a_write(struct storage *store, const attrib * attribs, const void *owner); - void free_attribs(void); + int a_readint(struct attrib *a, void *owner, struct gamedata *); + void a_writeint(const struct attrib *a, const void *owner, + struct storage *store); + int a_readshorts(struct attrib *a, void *owner, struct gamedata *); + void a_writeshorts(const struct attrib *a, const void *owner, + struct storage *store); + int a_readchars(struct attrib *a, void *owner, struct gamedata *); + void a_writechars(const struct attrib *a, const void *owner, + struct storage *store); + int a_readstring(struct attrib *a, void *owner, struct gamedata *); + void a_writestring(const struct attrib *a, const void *owner, + struct storage *); + void a_finalizestring(struct attrib *a); + + void attrib_done(void); #define DEFAULT_AGE NULL #define DEFAULT_INIT NULL diff --git a/src/util/attrib.test.c b/src/util/attrib.test.c index 0f189015a..7fa2ef82c 100644 --- a/src/util/attrib.test.c +++ b/src/util/attrib.test.c @@ -1,8 +1,13 @@ #include #include "attrib.h" +#include + +#include +#include #include #include +#include static void test_attrib_new(CuTest * tc) { @@ -16,7 +21,6 @@ static void test_attrib_new(CuTest * tc) CuAssertPtrEquals(tc, 0, a); } - static void test_attrib_add(CuTest * tc) { attrib_type at_foo = { "foo" }; @@ -52,7 +56,6 @@ static void test_attrib_remove_self(CuTest * tc) { a_removeall(&alist, NULL); } - static void test_attrib_removeall(CuTest * tc) { const attrib_type at_foo = { "foo" }; const attrib_type at_bar = { "bar" }; @@ -110,6 +113,86 @@ static void test_attrib_nexttype(CuTest * tc) a_removeall(&alist, &at_bar); } +static void test_attrib_rwstring(CuTest *tc) { + gamedata data; + storage store; + attrib a = { 0 }; + + test_setup(); + a.data.v = _strdup("Hello World"); + mstream_init(&data.strm); + gamedata_init(&data, &store, RELEASE_VERSION); + a_writestring(&a, NULL, &store); + a_finalizestring(&a); + data.strm.api->rewind(data.strm.handle); + a_readstring(&a, NULL, &data); + CuAssertStrEquals(tc, "Hello World", (const char *)a.data.v); + mstream_done(&data.strm); + gamedata_done(&data); + test_cleanup(); +} + +static void test_attrib_rwint(CuTest *tc) { + gamedata data; + storage store; + attrib a = { 0 }; + + test_setup(); + a.data.i = 42; + mstream_init(&data.strm); + gamedata_init(&data, &store, RELEASE_VERSION); + a_writeint(&a, NULL, &store); + a.data.i = 0; + data.strm.api->rewind(data.strm.handle); + a_readint(&a, NULL, &data); + CuAssertIntEquals(tc, 42, a.data.i); + mstream_done(&data.strm); + gamedata_done(&data); + test_cleanup(); +} + +static void test_attrib_rwchars(CuTest *tc) { + gamedata data; + storage store; + attrib a = { 0 }; + + test_setup(); + a.data.ca[0] = 1; + a.data.ca[3] = 42; + mstream_init(&data.strm); + gamedata_init(&data, &store, RELEASE_VERSION); + a_writeint(&a, NULL, &store); + memset(a.data.ca, 0, 4); + data.strm.api->rewind(data.strm.handle); + a_readint(&a, NULL, &data); + CuAssertIntEquals(tc, 1, a.data.ca[0]); + CuAssertIntEquals(tc, 42, a.data.ca[3]); + mstream_done(&data.strm); + gamedata_done(&data); + test_cleanup(); +} + +static void test_attrib_rwshorts(CuTest *tc) { + gamedata data; + storage store; + attrib a = { 0 }; + a.data.sa[0] = -4; + a.data.sa[1] = 42; + + test_setup(); + mstream_init(&data.strm); + gamedata_init(&data, &store, RELEASE_VERSION); + a_writeint(&a, NULL, &store); + memset(a.data.ca, 0, 4); + data.strm.api->rewind(data.strm.handle); + a_readint(&a, NULL, &data); + CuAssertIntEquals(tc, -4, a.data.sa[0]); + CuAssertIntEquals(tc, 42, a.data.sa[1]); + mstream_done(&data.strm); + gamedata_done(&data); + test_cleanup(); +} + CuSuite *get_attrib_suite(void) { CuSuite *suite = CuSuiteNew(); @@ -119,5 +202,9 @@ CuSuite *get_attrib_suite(void) SUITE_ADD_TEST(suite, test_attrib_removeall); SUITE_ADD_TEST(suite, test_attrib_remove_self); SUITE_ADD_TEST(suite, test_attrib_nexttype); + SUITE_ADD_TEST(suite, test_attrib_rwstring); + SUITE_ADD_TEST(suite, test_attrib_rwint); + SUITE_ADD_TEST(suite, test_attrib_rwchars); + SUITE_ADD_TEST(suite, test_attrib_rwshorts); return suite; } diff --git a/src/util/bsdstring.test.c b/src/util/bsdstring.test.c index 0fffd187c..b5fe81156 100644 --- a/src/util/bsdstring.test.c +++ b/src/util/bsdstring.test.c @@ -32,7 +32,7 @@ static void test_strlcpy(CuTest * tc) CuAssertIntEquals(tc, 4, (int)strlcpy(buffer, "herp", 4)); CuAssertStrEquals(tc, "her", buffer); - CuAssertIntEquals(tc, 4, (int)strlcpy(buffer, "herp", 8)); + CuAssertIntEquals(tc, 4, (int)strlcpy(buffer, "herp", 8)); //-V666 CuAssertStrEquals(tc, "herp", buffer); CuAssertIntEquals(tc, 0x7f, buffer[5]); diff --git a/src/util/crmessage.c b/src/util/crmessage.c index d15228510..98afe0f05 100644 --- a/src/util/crmessage.c +++ b/src/util/crmessage.c @@ -32,6 +32,15 @@ typedef struct tsf_list { static tsf_list *tostringfs; +void crmessage_done(void) { + tsf_list **tsp = &tostringfs; + while (*tsp) { + tsf_list *ts = *tsp; + *tsp = ts->next; + free(ts); + } +} + static tostring_f tsf_find(const char *name) { if (name != NULL) { diff --git a/src/util/crmessage.h b/src/util/crmessage.h index be6b67367..3cd71d71c 100644 --- a/src/util/crmessage.h +++ b/src/util/crmessage.h @@ -22,6 +22,8 @@ extern "C" { struct message; struct message_type; + void crmessage_done(void); + typedef int(*tostring_f) (variant data, char *buffer, const void *userdata); void tsf_register(const char *name, tostring_f fun); /* registers a new type->string-function */ diff --git a/src/util/event.c b/src/util/event.c index ad5a9e725..cdf178aec 100644 --- a/src/util/event.c +++ b/src/util/event.c @@ -244,7 +244,7 @@ void tt_register(trigger_type * tt) trigger_type *tt_find(const char *name) { trigger_type *tt = triggertypes; - while (tt && strcmp(tt->name, name)) + while (tt && strcmp(tt->name, name)!=0) tt = tt->next; return tt; } diff --git a/src/util/filereader.c b/src/util/filereader.c index ee5ec398c..3223ca2ab 100644 --- a/src/util/filereader.c +++ b/src/util/filereader.c @@ -18,7 +18,7 @@ static void unicode_warning(const char *bp) log_warning("invalid sequence in UTF-8 string: %s\n", bp); } -INLINE_FUNCTION int eatwhite(const char *ptr, size_t * total_size) +static int eatwhite(const char *ptr, size_t * total_size) { int ret = 0; diff --git a/src/util/functions.c b/src/util/functions.c index 82792faaf..3776820eb 100644 --- a/src/util/functions.c +++ b/src/util/functions.c @@ -51,4 +51,5 @@ void register_function(pf_generic fun, const char *name) void free_functions(void) { cb_clear(&cb_functions); -} \ No newline at end of file +} + diff --git a/src/util/gamedata.h b/src/util/gamedata.h index e75f7d681..bb1632838 100644 --- a/src/util/gamedata.h +++ b/src/util/gamedata.h @@ -5,6 +5,42 @@ #include +#define INTPAK_VERSION 329 /* in binary, ints can get packed. starting with E2/572 */ +#define NOZEROIDS_VERSION 330 /* 2008-05-16 zero is not a valid ID for anything (including factions) */ +#define NOBORDERATTRIBS_VERSION 331 /* 2008-05-17 connection::attribs has been moved to userdata */ +#define UIDHASH_VERSION 332 /* 2008-05-22 borders use the region.uid to store */ +#define REGIONOWNER_VERSION 333 /* 2009-05-14 regions have owners and morale */ +#define ALLIANCELEADER_VERSION 333 /* alliances have a leader */ +#define CURSEFLOAT_VERSION 334 /* all curse-effects are float */ +#define MOURNING_VERSION 335 /* mourning peasants */ +#define FOSS_VERSION 336 /* the open source release */ +#define OWNER_2_VERSION 337 /* region owners contain an alliance */ +#define FIX_WATCHERS_VERSION 338 /* fixed storage of watchers */ +#define UNIQUE_SPELLS_VERSION 339 /* turn 775, spell names are now unique globally, not just per school */ +#define SPELLBOOK_VERSION 340 /* turn 775, full spellbooks are stored for factions */ +#define NOOVERRIDE_VERSION 341 /* turn 775, full spellbooks are stored for factions */ +#define INTFLAGS_VERSION 342 /* turn 876, FFL_NPC is now bit 25, flags is an int */ +#define SAVEGAMEID_VERSION 343 /* instead of XMLNAME, save the game.id parameter from the config */ +#define BUILDNO_VERSION 344 /* storing the build number in the save */ +#define AUTO_RACENAME_VERSION 345 /* NPC units with name==NULL will automatically get their race for a name */ +#define JSON_REPORT_VERSION 346 /* bit 3 in f->options flags the json report */ +#define EXPLICIT_CURSE_ISNEW_VERSION 347 /* CURSE_ISNEW is not reset in read/write, but in age() */ +#define SPELL_LEVEL_VERSION 348 /* f->max_spelllevel gets stored, not calculated */ +#define OWNER_3_VERSION 349 /* regions store last owner, not last alliance */ +#define ATTRIBOWNER_VERSION 351 /* all attrib_type functions know who owns the attribute */ +#define BADCRYPT_VERSION 351 /* passwords are broken, 969.dat only. */ +#define NOCRYPT_VERSION 352 /* passwords are plaintext again */ +#define ATHASH_VERSION 353 /* attribute-type hash, not name */ +#define NOWATCH_VERSION 354 /* plane->watchers is gone */ +/* unfinished: */ +#define CRYPT_VERSION 400 /* passwords are encrypted */ + +#define RELEASE_VERSION NOWATCH_VERSION /* current datafile */ +#define MIN_VERSION INTPAK_VERSION /* minimal datafile we support */ +#define MAX_VERSION RELEASE_VERSION /* change this if we can need to read the future datafile, and we can do so */ + +#define STREAM_VERSION 2 /* internal encoding of binary files */ + struct storage; typedef struct gamedata { diff --git a/src/util/language.c b/src/util/language.c index 03d65c164..d8b899742 100644 --- a/src/util/language.c +++ b/src/util/language.c @@ -22,11 +22,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "log.h" #include "strings.h" #include "umlaut.h" +#include "assert.h" #include #include #include -#include #include #define SMAXHASH 2048 @@ -84,6 +84,7 @@ locale *get_or_create_locale(const char *name) } } *lp = l = (locale *)calloc(sizeof(locale), 1); + assert_alloc(l); l->hashkey = hkey; l->name = _strdup(name); l->index = nextlocaleindex++; diff --git a/src/util/language.h b/src/util/language.h index a8d9096e7..a90398cc0 100644 --- a/src/util/language.h +++ b/src/util/language.h @@ -30,33 +30,34 @@ extern "C" { struct locale; struct critbit_tree; + extern const char *localenames[]; + extern struct locale *default_locale; + extern struct locale *locales; + extern struct locale *nextlocale(const struct locale *lang); + /** managing multiple locales: **/ - extern struct locale *get_locale(const char *name); - extern struct locale *get_or_create_locale(const char *key); + struct locale *get_locale(const char *name); + struct locale *get_or_create_locale(const char *key); void init_locales(void); void free_locales(void); void reset_locales(void); /** operations on locales: **/ - extern void locale_setstring(struct locale *lang, const char *key, + void locale_setstring(struct locale *lang, const char *key, const char *value); - extern const char *locale_getstring(const struct locale *lang, + const char *locale_getstring(const struct locale *lang, const char *key); - extern const char *locale_string(const struct locale *lang, const char *key, bool warn); /* does fallback */ - extern unsigned int locale_index(const struct locale *lang); - extern const char *locale_name(const struct locale *lang); + const char *locale_string(const struct locale *lang, const char *key, bool warn); /* does fallback */ + unsigned int locale_index(const struct locale *lang); + const char *locale_name(const struct locale *lang); - extern const char *mkname(const char *namespc, const char *key); - extern char *mkname_buf(const char *namespc, const char *key, char *buffer); + const char *mkname(const char *namespc, const char *key); + char *mkname_buf(const char *namespc, const char *key, char *buffer); - extern void make_locales(const char *str); + void make_locales(const char *str); #define LOC(lang, s) (lang?locale_string(lang, s, true):s) - extern struct locale *default_locale; - extern struct locale *locales; - extern struct locale *nextlocale(const struct locale *lang); - enum { UT_PARAMS, UT_KEYWORDS, diff --git a/src/util/language.test.c b/src/util/language.test.c new file mode 100644 index 000000000..236eac497 --- /dev/null +++ b/src/util/language.test.c @@ -0,0 +1,24 @@ +#include +#include "language.h" + +#include +#include + +extern const char *directions[]; + +static void test_language(CuTest *tc) +{ + const char *str; + test_setup(); + default_locale = test_create_locale(); + str = directions[1]; + CuAssertStrEquals(tc, str, locale_getstring(default_locale, str)); + test_cleanup(); +} + +CuSuite *get_language_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_language); + return suite; +} diff --git a/src/util/lists.c b/src/util/lists.c index 36cd0f066..d61327fa0 100644 --- a/src/util/lists.c +++ b/src/util/lists.c @@ -16,12 +16,13 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ -#include -#include - #include #include "lists.h" +#include +#include +#include + typedef struct void_list { struct void_list *next; void *data; @@ -121,3 +122,22 @@ unsigned int listlen(void *l) for (p = (void_list *)l, i = 0; p; p = p->next, i++); return i; } +/* - String Listen --------------------------------------------- */ +void addstrlist(strlist ** SP, const char *s) +{ + strlist *slist = malloc(sizeof(strlist)); + slist->next = NULL; + slist->s = _strdup(s); + addlist(SP, slist); +} + +void freestrlist(strlist * s) +{ + strlist *q, *p = s; + while (p) { + q = p->next; + free(p->s); + free(p); + p = q; + } +} diff --git a/src/util/lists.h b/src/util/lists.h index a9efab218..8b9b093df 100644 --- a/src/util/lists.h +++ b/src/util/lists.h @@ -24,6 +24,13 @@ extern "C" { #include + typedef struct strlist { + struct strlist *next; + char *s; + } strlist; + + void addstrlist(strlist ** SP, const char *s); + void freestrlist(strlist * s); void addlist(void *l1, void *p1); void translist(void *l1, void *l2, void *p); #ifndef MALLOCDBG diff --git a/src/util/log.c b/src/util/log.c index 1d3724c50..759efba39 100644 --- a/src/util/log.c +++ b/src/util/log.c @@ -137,6 +137,7 @@ static int check_dupe(const char *format, int level) static char last_message[32]; /* STATIC_XCALL: used across calls */ static int dupes = 0; /* STATIC_XCALL: used across calls */ if (strncmp(last_message, format, sizeof(last_message)) == 0) { + // TODO: C6054: String 'last_message' might not be zero - terminated. ++dupes; return 1; } @@ -219,7 +220,7 @@ void log_fatal(const char *format, ...) va_end(args); } -void log_error(const char *format, ...) +void log_error(const char *format, ...) //-V524 { va_list args; va_start(args, format); diff --git a/src/util/message.c b/src/util/message.c index 073371b54..f19fc3313 100644 --- a/src/util/message.c +++ b/src/util/message.c @@ -32,7 +32,7 @@ const char *mt_name(const message_type * mtype) return mtype->name; } -arg_type *argtypes = NULL; +static arg_type *argtypes = NULL; void register_argtype(const char *name, void(*free_arg) (variant), @@ -47,7 +47,7 @@ variant(*copy_arg) (variant), variant_type type) argtypes = atype; } -static arg_type *find_argtype(const char *name) +arg_type *find_argtype(const char *name) { arg_type *atype = argtypes; while (atype != NULL) { @@ -83,7 +83,7 @@ message_type *mt_new(const char *name, const char *args[]) mtype->pnames = NULL; mtype->types = NULL; } - if (args != NULL) + if (args != NULL) { for (i = 0; args[i]; ++i) { const char *x = args[i]; const char *spos = strchr(x, ':'); @@ -102,6 +102,7 @@ message_type *mt_new(const char *name, const char *args[]) assert(mtype->types[i]); } } + } return mtype; } @@ -245,3 +246,12 @@ struct message *msg_addref(struct message *msg) ++msg->refcount; return msg; } + +void message_done(void) { + arg_type **atp = &argtypes; + while (*atp) { + arg_type *at = *atp; + *atp = at->next; + free(at); + } +} diff --git a/src/util/message.h b/src/util/message.h index b76f281a8..5937fb83e 100644 --- a/src/util/message.h +++ b/src/util/message.h @@ -40,28 +40,31 @@ extern "C" { int refcount; } message; + void message_done(void); + void mt_clear(void); - struct message_type *mt_new(const char *name, const char **args); + struct message_type *mt_new(const char *name, const char *args[]); struct message_type *mt_new_va(const char *name, ...); /* mt_new("simple_sentence", "subject:string", "predicate:string", * "object:string", "lang:locale", NULL); */ - extern struct message *msg_create(const struct message_type *type, + struct message *msg_create(const struct message_type *type, variant args[]); /* msg_create(&mt_simplesentence, "enno", "eats", "chocolate", &locale_de); * parameters must be in the same order as they were for mt_new! */ - extern void msg_release(struct message *msg); - extern struct message *msg_addref(struct message *msg); + void msg_release(struct message *msg); + struct message *msg_addref(struct message *msg); - extern const char *mt_name(const struct message_type *mtype); + const char *mt_name(const struct message_type *mtype); /** message_type registry (optional): **/ - extern const struct message_type *mt_register(struct message_type *); - extern const struct message_type *mt_find(const char *); + const struct message_type *mt_register(struct message_type *); + const struct message_type *mt_find(const char *); - extern void register_argtype(const char *name, void(*free_arg) (variant), + void register_argtype(const char *name, void(*free_arg) (variant), variant(*copy_arg) (variant), variant_type); + arg_type *find_argtype(const char *name); void(*msg_log_create) (const struct message * msg); diff --git a/src/util/mt19937ar.c b/src/util/mt19937ar.c new file mode 100644 index 000000000..4fbd3f70d --- /dev/null +++ b/src/util/mt19937ar.c @@ -0,0 +1,172 @@ +/* + A C-program for MT19937, with initialization improved 2002/1/26. + Coded by Takuji Nishimura and Makoto Matsumoto. + + Before using, initialize the state by using init_genrand(seed) + or init_by_array(init_key, key_length). + + Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + Any feedback is very welcome. + http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html + email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) +*/ + +#include + +/* Period parameters */ +#define N 624 +#define M 397 +#define MATRIX_A 0x9908b0dfUL /* constant vector a */ +#define UPPER_MASK 0x80000000UL /* most significant w-r bits */ +#define LOWER_MASK 0x7fffffffUL /* least significant r bits */ + +static unsigned long mt[N]; /* the array for the state vector */ +static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */ + +/* initializes mt[N] with a seed */ +void init_genrand(unsigned long s) +{ + mt[0]= s & 0xffffffffUL; + for (mti=1; mti> 30)) + mti); + /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ + /* In the previous versions, MSBs of the seed affect */ + /* only MSBs of the array mt[]. */ + /* 2002/01/09 modified by Makoto Matsumoto */ + mt[mti] &= 0xffffffffUL; + /* for >32 bit machines */ + } +} + +/* initialize by an array with array-length */ +/* init_key is the array for initializing keys */ +/* key_length is its length */ +/* slight change for C++, 2004/2/26 */ +void init_by_array(unsigned long init_key[], int key_length) +{ + int i, j, k; + init_genrand(19650218UL); + i=1; j=0; + k = (N>key_length ? N : key_length); + for (; k; k--) { + mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL)) + + init_key[j] + j; /* non linear */ + mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ + i++; j++; + if (i>=N) { mt[0] = mt[N-1]; i=1; } + if (j>=key_length) j=0; + } + for (k=N-1; k; k--) { + mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL)) + - i; /* non linear */ + mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ + i++; + if (i>=N) { mt[0] = mt[N-1]; i=1; } + } + + mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */ +} + +/* generates a random number on [0,0xffffffff]-interval */ +unsigned long genrand_int32(void) +{ + unsigned long y; + static unsigned long mag01[2]={0x0UL, MATRIX_A}; + /* mag01[x] = x * MATRIX_A for x=0,1 */ + + if (mti >= N) { /* generate N words at one time */ + int kk; + + if (mti == N+1) /* if init_genrand() has not been called, */ + init_genrand(5489UL); /* a default initial seed is used */ + + for (kk=0;kk> 1) ^ mag01[y & 0x1UL]; + } + for (;kk> 1) ^ mag01[y & 0x1UL]; + } + y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK); + mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1UL]; + + mti = 0; + } + + y = mt[mti++]; + + /* Tempering */ + y ^= (y >> 11); + y ^= (y << 7) & 0x9d2c5680UL; + y ^= (y << 15) & 0xefc60000UL; + y ^= (y >> 18); + + return y; +} + +/* generates a random number on [0,0x7fffffff]-interval */ +long genrand_int31(void) +{ + return (long)(genrand_int32()>>1); +} + +/* generates a random number on [0,1]-real-interval */ +double genrand_real1(void) +{ + return genrand_int32()*(1.0/4294967295.0); + /* divided by 2^32-1 */ +} + +/* generates a random number on [0,1)-real-interval */ +double genrand_real2(void) +{ + return genrand_int32()*(1.0/4294967296.0); + /* divided by 2^32 */ +} + +/* generates a random number on (0,1)-real-interval */ +double genrand_real3(void) +{ + return (((double)genrand_int32()) + 0.5)*(1.0/4294967296.0); + /* divided by 2^32 */ +} + +/* generates a random number on [0,1) with 53-bit resolution*/ +double genrand_res53(void) +{ + unsigned long a=genrand_int32()>>5, b=genrand_int32()>>6; + return(a*67108864.0+b)*(1.0/9007199254740992.0); +} +/* These real versions are due to Isaku Wada, 2002/01/09 added */ diff --git a/src/util/mtrand.h b/src/util/mtrand.h new file mode 100644 index 000000000..6387cd76d --- /dev/null +++ b/src/util/mtrand.h @@ -0,0 +1,61 @@ +/* + A C-program for MT19937, with initialization improved 2002/1/26. + Coded by Takuji Nishimura and Makoto Matsumoto. + + Before using, initialize the state by using init_genrand(seed) + or init_by_array(init_key, key_length). + + Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + Any feedback is very welcome. + http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html + email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) +*/ + +/* initializes mt[N] with a seed */ +void init_genrand(unsigned long s); +/* initialize by an array with array-length */ +void init_by_array(unsigned long init_key[], int key_length); +/* generates a random number on [0,0xffffffff]-interval */ +unsigned long genrand_int32(void); +/* generates a random number on [0,0x7fffffff]-interval */ +long genrand_int31(void); +/* generates a random number on [0,1]-real-interval */ +double genrand_real1(void); +/* generates a random number on [0,1)-real-interval */ +double genrand_real2(void); +/* generates a random number on (0,1)-real-interval */ +double genrand_real3(void); +/* generates a random number on [0,1) with 53-bit resolution*/ +double genrand_res53(void); + +/* These real versions are due to Isaku Wada, 2002/01/09 added */ diff --git a/src/util/nrmessage.h b/src/util/nrmessage.h index 5d775be9e..122b1f1a8 100644 --- a/src/util/nrmessage.h +++ b/src/util/nrmessage.h @@ -12,6 +12,9 @@ #ifndef H_UTIL_NRMESSAGE #define H_UTIL_NRMESSAGE + +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/src/util/parser.c b/src/util/parser.c index 741fd573f..0fbde6769 100644 --- a/src/util/parser.c +++ b/src/util/parser.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -250,7 +251,7 @@ unsigned int atoip(const char *s) int n; assert(s); - n = atoi(s); + n = isdigit(s[0]) ? atoi(s) : 0; if (n < 0) n = 0; diff --git a/src/util/parser.h b/src/util/parser.h index 839968480..802fc56cb 100644 --- a/src/util/parser.h +++ b/src/util/parser.h @@ -10,6 +10,9 @@ #ifndef UTIL_PARSER_H #define UTIL_PARSER_H + +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/src/util/parser.test.c b/src/util/parser.test.c index da0d8dacb..c7ac0bb05 100644 --- a/src/util/parser.test.c +++ b/src/util/parser.test.c @@ -2,8 +2,16 @@ #include "parser.h" #include +#include #include +static void test_atoip(CuTest *tc) { + CuAssertIntEquals(tc, 0, atoip("ALLES")); + CuAssertIntEquals(tc, 0, errno); + CuAssertIntEquals(tc, 42, atoip("42")); + CuAssertIntEquals(tc, 0, atoip("-1")); +} + static void test_parse_token(CuTest *tc) { char lbuf[8]; const char *tok; @@ -103,12 +111,6 @@ static void test_getstrtoken(CuTest *tc) { CuAssertPtrEquals(tc, NULL, (void *)getstrtoken()); } -static void test_atoip(CuTest *tc) { - CuAssertIntEquals(tc, 42, atoip("42")); - CuAssertIntEquals(tc, 0, atoip("-42")); - CuAssertIntEquals(tc, 0, atoip("NOPE")); -} - CuSuite *get_parser_suite(void) { CuSuite *suite = CuSuiteNew(); diff --git a/src/util/rand.c b/src/util/rand.c index 1825340fe..f5c8a28bc 100644 --- a/src/util/rand.c +++ b/src/util/rand.c @@ -18,6 +18,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "rand.h" +#include "mtrand.h" #include "rng.h" #include @@ -27,13 +28,21 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include +int lovar(double xpct_x2) +{ + int n = (int)(xpct_x2 * 500) + 1; + if (n == 0) + return 0; + return (rng_int() % n + rng_int() % n) / 1000; +} + /* NormalRand aus python, random.py geklaut, dort ist Referenz auf * den Algorithmus. mu = Mittelwert, sigma = Standardabweichung. * http://de.wikipedia.org/wiki/Standardabweichung#Diskrete_Gleichverteilung.2C_W.C3.BCrfel */ double normalvariate(double mu, double sigma) { - static const double NV_MAGICCONST = 1.7155277699214135; /* STATIC_CONST: a constant */ + static const double NV_MAGICCONST = 1.7155277699214135; double z; for (;;) { double u1 = rng_double(); @@ -67,9 +76,6 @@ bool chance(double x) return rng_double() < x; } -extern double genrand_real2(void); - - typedef struct random_source { double (*double_source) (void); } random_source; @@ -97,13 +103,13 @@ void random_source_inject_constant(double value) { r_source = &constant_provider; } -static int i = 0; static double *values; -static int value_size = 0; +static int value_size; +static int value_index; static double array_source (void) { - assert(i 0); value_size = size; if (values) @@ -119,7 +126,7 @@ void random_source_inject_array(double inject[], int size) { for (i=0; i < size; ++i) { values[i] = inject[i]; } - i = 0; + value_index = 0; r_source = &array_provider; } diff --git a/src/util/rand.h b/src/util/rand.h index e9e5d19ee..9fb3f2f69 100644 --- a/src/util/rand.h +++ b/src/util/rand.h @@ -23,13 +23,14 @@ extern "C" { #endif /* in dice.c: */ - extern int dice_rand(const char *str); - extern int dice(int count, int value); + int dice_rand(const char *str); + int dice(int count, int value); /* in rand.c: */ - extern double normalvariate(double mu, double sigma); - extern int ntimespprob(int n, double p, double mod); - extern bool chance(double x); + int lovar(double xpct_x2); + double normalvariate(double mu, double sigma); + int ntimespprob(int n, double p, double mod); + bool chance(double x); /* a random source that generates numbers in [0, 1). By calling the random_source_inject... functions you can set a special random source, diff --git a/src/util/rng.h b/src/util/rng.h index 1bc3e48ed..c16433200 100644 --- a/src/util/rng.h +++ b/src/util/rng.h @@ -9,25 +9,18 @@ */ #ifndef UTIL_RNG_H #define UTIL_RNG_H + +#define RNG_MT + #ifdef __cplusplus extern "C" { #endif -#define RNG_MT + /* generates a random number on [0,1)-real-interval */ + double rng_injectable_double(void); #ifdef RNG_MT - /* initializes mt[N] with a seed */ - extern void init_genrand(unsigned long s); - - /* generates a random number on [0,0xffffffff]-interval */ - extern unsigned long genrand_int32(void); - - /* generates a random number on [0,1)-real-interval */ - extern double rng_injectable_double(void); - - /* generates a random number on [0,0x7fffffff]-interval */ - long genrand_int31(void); - +# include "mtrand.h" # define rng_init(seed) init_genrand(seed) # define rng_int (int)genrand_int31 # define rng_uint (unsigned int)genrand_int32 diff --git a/src/util/strings.c b/src/util/strings.c index b3801d52f..4e7e17aa4 100644 --- a/src/util/strings.c +++ b/src/util/strings.c @@ -18,6 +18,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include +#include "strings.h" +#include "assert.h" + /* libc includes */ #include #include @@ -34,7 +37,9 @@ char *set_string(char **s, const char *neu) strcpy(*s, neu); } else { - *s = realloc(*s, strlen(neu) + 1); + char *rs = realloc(*s, strlen(neu) + 1); + assert_alloc(rs); + *s = rs; strcpy(*s, neu); } return *s; diff --git a/src/util/strings.h b/src/util/strings.h index 7178cf179..05a435e2c 100644 --- a/src/util/strings.h +++ b/src/util/strings.h @@ -18,6 +18,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef STRINGS_H #define STRINGS_H + +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/src/util/translation.c b/src/util/translation.c index 16d3e684f..829a1fe05 100644 --- a/src/util/translation.c +++ b/src/util/translation.c @@ -1,4 +1,4 @@ -/* +/* +-------------------+ Christian Schlittchen | | Enno Rehling | Eressea PBEM host | Katja Zedel @@ -16,9 +16,9 @@ #include "bsdstring.h" #include "critbit.h" #include "log.h" +#include "assert.h" -/* libc includes */ -#include + /* libc includes */ #include #include #include @@ -48,6 +48,7 @@ void opstack_push(opstack ** stackp, variant data) opstack *stack = *stackp; if (stack == NULL) { stack = (opstack *)malloc(sizeof(opstack)); + assert_alloc(stack); stack->size = 2; stack->begin = malloc(sizeof(variant) * stack->size); stack->top = stack->begin; @@ -58,10 +59,7 @@ void opstack_push(opstack ** stackp, variant data) void *tmp; stack->size += stack->size; tmp = realloc(stack->begin, sizeof(variant) * stack->size); - if (!tmp) { - log_error("realloc out of memory"); - abort(); - } + assert_alloc(tmp); stack->begin = (variant *)tmp; stack->top = stack->begin + pos; } diff --git a/src/util/translation.h b/src/util/translation.h index 01c19a72d..76206021b 100644 --- a/src/util/translation.h +++ b/src/util/translation.h @@ -12,6 +12,9 @@ #ifndef H_UTIL_TRANSLATION #define H_UTIL_TRANSLATION + +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/src/util/umlaut.c b/src/util/umlaut.c index abbd59372..6be0bdde5 100644 --- a/src/util/umlaut.c +++ b/src/util/umlaut.c @@ -19,6 +19,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "umlaut.h" +#include "assert.h" #include "log.h" #include "unicode.h" @@ -31,7 +32,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. typedef struct tref { struct tref *nexthash; ucs4_t ucs; - void *node; + struct tnode *node; } tref; #define LEAF 1 /* leaf node for a word. always matches */ @@ -41,6 +42,7 @@ typedef struct tnode { struct tref *next[NODEHASHSIZE]; unsigned char flags; variant id; + int refcount; } tnode; char * transliterate(char * out, size_t size, const char * in) @@ -113,10 +115,16 @@ char * transliterate(char * out, size_t size, const char * in) return *src ? 0 : out; } -void addtoken(void ** root, const char *str, variant id) +tnode * mknode(void) { + tnode * node = calloc(1, sizeof(tnode)); + node->refcount = 1; + return node; +} + +void addtoken(tnode ** root, const char *str, variant id) { tnode * tk; - static const struct replace { /* STATIC_CONST: constant value */ + static const struct replace { ucs4_t ucs; const char str[3]; } replace[] = { @@ -127,7 +135,7 @@ void addtoken(void ** root, const char *str, variant id) assert(root && str); if (!*root) { - tk = *root = calloc(1, sizeof(tnode)); + tk = *root = mknode(); } else { tk = *root; @@ -160,7 +168,7 @@ void addtoken(void ** root, const char *str, variant id) next = next->nexthash; if (!next) { tref *ref; - tnode *node = (tnode *)calloc(1, sizeof(tnode)); // TODO: what is the reason for this empty node to exist? + tnode *node = mknode(); // TODO: what is the reason for this empty node to exist? if (ucs < 'a' || ucs > 'z') { lcs = towlower((wint_t)ucs); @@ -183,8 +191,10 @@ void addtoken(void ** root, const char *str, variant id) index = lcs % NODEHASHSIZE; #endif ref = (tref *)malloc(sizeof(tref)); + assert_alloc(ref); ref->ucs = lcs; ref->node = node; + ++node->refcount; ref->nexthash = tk->next[index]; tk->next[index] = ref; } @@ -210,23 +220,25 @@ void addtoken(void ** root, const char *str, variant id) } } -void freetokens(void * root) +void freetokens(tnode * root) { - tnode * node = (tnode *)root; + tnode * node = root; int i; for (i = 0; node && i != NODEHASHSIZE; ++i) { if (node->next[i]) { - tref ** refs = &node->next[i]; - freetokens(node->next[i]->node); - while (*refs) { - tref * ref = *refs; - *refs = ref->nexthash; -// free(ref->node); + tref * ref = node->next[i]; + while (ref) { + tref * next = ref->nexthash; + freetokens(ref->node); free(ref); + ref = next; } + node->next[i] = 0; } } - free(node); + if (--node->refcount == 0) { + free(node); + } } int findtoken(const void * root, const char *key, variant * result) diff --git a/src/util/umlaut.h b/src/util/umlaut.h index 1e6baecb4..d64df7609 100644 --- a/src/util/umlaut.h +++ b/src/util/umlaut.h @@ -29,10 +29,11 @@ extern "C" { #define E_TOK_NOMATCH (-1) #define E_TOK_SUCCESS 0 #define NODEHASHSIZE 8 + struct tnode; int findtoken(const void *tk, const char *str, variant * result); - void addtoken(void **root, const char *str, variant id); - void freetokens(void *root); + void addtoken(struct tnode **root, const char *str, variant id); + void freetokens(struct tnode *root); char * transliterate(char * out, size_t size, const char * in); diff --git a/src/util/umlaut.test.c b/src/util/umlaut.test.c index f9f8f5d15..959960509 100644 --- a/src/util/umlaut.test.c +++ b/src/util/umlaut.test.c @@ -26,10 +26,45 @@ static void test_transliterate(CuTest * tc) CuAssertStrEquals(tc, "h?", buffer); } +static void test_transliterations(CuTest *tc) { + const char * umlauts = "\xc3\xa4\xc3\xb6\xc3\xbc\xc3\x9f"; /* auml ouml uuml szlig nul */ + struct tnode * tokens = 0; + variant id; + int result; + + id.i = 3; + addtoken(&tokens, umlauts, id); + /* transliteration is the real magic */ + result = findtoken(tokens, "AEoeUEss", &id); + CuAssertIntEquals(tc, E_TOK_SUCCESS, result); + CuAssertIntEquals(tc, 3, id.i); + + result = findtoken(tokens, umlauts, &id); + CuAssertIntEquals(tc, E_TOK_SUCCESS, result); + CuAssertIntEquals(tc, 3, id.i); + + freetokens(tokens); +} + +static void test_directions(CuTest * tc) +{ + struct tnode * tokens = 0; + variant id; + int result; + + id.i = 2; + addtoken(&tokens, "nw", id); + addtoken(&tokens, "northwest", id); + + result = findtoken(tokens, "northw", &id); + CuAssertIntEquals(tc, E_TOK_SUCCESS, result); + CuAssertIntEquals(tc, 2, id.i); + freetokens(tokens); +} + static void test_umlaut(CuTest * tc) { - const char * umlauts = "\xc3\xa4\xc3\xb6\xc3\xbc\xc3\x9f"; /* auml ouml uuml szlig nul */ - void * tokens = 0; + struct tnode *tokens = 0; variant id; int result; @@ -41,8 +76,7 @@ static void test_umlaut(CuTest * tc) addtoken(&tokens, "herpderp", id); id.i = 2; addtoken(&tokens, "derp", id); - id.i = 3; - addtoken(&tokens, umlauts, id); + addtoken(&tokens, "d", id); /* we can find substrings if they are significant */ result = findtoken(tokens, "herp", &id); @@ -57,25 +91,30 @@ static void test_umlaut(CuTest * tc) CuAssertIntEquals(tc, E_TOK_SUCCESS, findtoken(tokens, "DERP", &id)); CuAssertIntEquals(tc, 2, id.i); - result = findtoken(tokens, umlauts, &id); - CuAssertIntEquals(tc, E_TOK_SUCCESS, result); - CuAssertIntEquals(tc, 3, id.i); - - /* transliteration is the real magic */ - result = findtoken(tokens, "AEoeUEss", &id); - CuAssertIntEquals(tc, E_TOK_SUCCESS, result); - CuAssertIntEquals(tc, 3, id.i); - result = findtoken(tokens, "herp-a-derp", &id); CuAssertIntEquals(tc, E_TOK_NOMATCH, result); freetokens(tokens); } +static void test_leak(CuTest *tc) { + struct tnode *tokens = NULL; + variant token; + + token.i = 42; + addtoken(&tokens, "NO", token); + addtoken(&tokens, "nw", token); + CuAssertIntEquals(tc, E_TOK_SUCCESS, findtoken(tokens, "n", &token)); + freetokens(tokens); +} + CuSuite *get_umlaut_suite(void) { CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_umlaut); + SUITE_ADD_TEST(suite, test_directions); SUITE_ADD_TEST(suite, test_transliterate); + SUITE_ADD_TEST(suite, test_transliterations); + SUITE_ADD_TEST(suite, test_leak); return suite; } diff --git a/src/util/unicode.c b/src/util/unicode.c index f7ea2653b..161983ba7 100644 --- a/src/util/unicode.c +++ b/src/util/unicode.c @@ -14,6 +14,7 @@ #include #include #include +#include #define B00000000 0x00 #define B10000000 0x80 @@ -31,6 +32,50 @@ #define B00000011 0x03 #define B00000001 0x01 +int unicode_utf8_trim(utf8_t *buf) +{ + int result = 0, ts = 0; + utf8_t *op = buf, *ip = buf, *lc = buf; + while (*ip) { + size_t size = 1; + wint_t wc = *ip; + if (wc & 0x80) { + ucs4_t ucs = 0; + if (ip[1]) { + int ret = unicode_utf8_to_ucs4(&ucs, ip, &size); + if (ret != 0) { + return ret; + } + wc = (wint_t)ucs; + } + else { + wc = *op = '?'; + size = 1; + ++result; + } + } + if (op == buf && iswspace(wc)) { + ++result; + } + else if (iswprint(wc)) { + if (op != ip) { + memmove(op, ip, size); + } + op += size; + if (iswspace(wc)) ++ts; + else { + lc = op; + ts = 0; + } + } else { + ++result; + } + ip += size; + } + *lc = '\0'; + return result + ts; +} + int unicode_utf8_tolower(utf8_t * op, size_t outlen, const utf8_t * ip) { while (*ip) { @@ -49,7 +94,7 @@ int unicode_utf8_tolower(utf8_t * op, size_t outlen, const utf8_t * ip) } low = towlower((wint_t)ucs); if (low == ucs) { - memcpy(op, ip, size); + memmove(op, ip, size); ip += size; op += size; outlen -= size; diff --git a/src/util/unicode.h b/src/util/unicode.h index df68ade02..4fd860e45 100644 --- a/src/util/unicode.h +++ b/src/util/unicode.h @@ -25,7 +25,7 @@ extern "C" { #include #define USE_UNICODE - typedef unsigned long ucs4_t; + typedef long ucs4_t; typedef char utf8_t; int unicode_utf8_to_cp437(unsigned char *result, const utf8_t * utf8_string, @@ -41,8 +41,8 @@ extern "C" { int unicode_utf8_strcasecmp(const utf8_t * a, const utf8_t * b); int unicode_latin1_to_utf8(utf8_t * out, size_t * outlen, const char *in, size_t * inlen); - int unicode_utf8_tolower(utf8_t * out, size_t outlen, - const utf8_t * in); + int unicode_utf8_tolower(utf8_t *op, size_t outlen, const utf8_t *ip); + int unicode_utf8_trim(utf8_t *ip); #ifdef __cplusplus } diff --git a/src/util/unicode.test.c b/src/util/unicode.test.c index 410e8e68a..ef07c944c 100644 --- a/src/util/unicode.test.c +++ b/src/util/unicode.test.c @@ -5,6 +5,35 @@ #include #include +static void test_unicode_trim(CuTest * tc) +{ + char buffer[32]; + + strcpy(buffer, "Hello Word"); + CuAssertIntEquals(tc, 0, unicode_utf8_trim(buffer)); + CuAssertStrEquals(tc, "Hello Word", buffer); + + strcpy(buffer, " Hello Word "); + CuAssertIntEquals(tc, 4, unicode_utf8_trim(buffer)); + CuAssertStrEquals(tc, "Hello Word", buffer); + + strcpy(buffer, "Hello Word\n"); + CuAssertIntEquals(tc, 1, unicode_utf8_trim(buffer)); + CuAssertStrEquals(tc, "Hello Word", buffer); + + strcpy(buffer, " Hello Word\t\n"); + CuAssertIntEquals(tc, 4, unicode_utf8_trim(buffer)); + CuAssertStrEquals(tc, "Hello Word", buffer); + + strcpy(buffer, " \t Hello Word"); + CuAssertIntEquals(tc, 3, unicode_utf8_trim(buffer)); + CuAssertStrEquals(tc, "Hello Word", buffer); + + buffer[9] = -61; + CuAssertIntEquals(tc, 1, unicode_utf8_trim(buffer)); + CuAssertStrEquals(tc, "Hello Wor?", buffer); +} + static void test_unicode_tolower(CuTest * tc) { char buffer[32]; @@ -62,10 +91,21 @@ static void test_unicode_utf8_to_other(CuTest *tc) CuAssertIntEquals(tc, 'l', ch); } +static void test_unicode_utf8_to_ucs(CuTest *tc) { + ucs4_t ucs; + size_t sz; + + CuAssertIntEquals(tc, 0, unicode_utf8_to_ucs4(&ucs, "a", &sz)); + CuAssertIntEquals(tc, 'a', ucs); + CuAssertIntEquals(tc, 1, sz); +} + CuSuite *get_unicode_suite(void) { CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_unicode_tolower); + SUITE_ADD_TEST(suite, test_unicode_trim); SUITE_ADD_TEST(suite, test_unicode_utf8_to_other); + SUITE_ADD_TEST(suite, test_unicode_utf8_to_ucs); return suite; } diff --git a/src/util/xml.c b/src/util/xml.c index 80cec1092..644698119 100644 --- a/src/util/xml.c +++ b/src/util/xml.c @@ -14,6 +14,7 @@ /* util includes */ #include "log.h" +#include "assert.h" #ifdef USE_LIBXML2 #include @@ -21,7 +22,6 @@ #endif /* libc includes */ -#include #include #include #include @@ -89,10 +89,20 @@ typedef struct xml_reader { static xml_reader *xmlReaders; +void xml_done(void) { + xml_reader ** xrp = &xmlReaders; + while (*xrp) { + xml_reader *xr = *xrp; + *xrp = xr->next; + free(xr); + } +} + void xml_register_callback(xml_callback callback) { xml_reader *reader = (xml_reader *)malloc(sizeof(xml_reader)); xml_reader **insert = &xmlReaders; + assert_alloc(reader); reader->callback = callback; reader->next = NULL; diff --git a/src/util/xml.h b/src/util/xml.h index b5beee233..921cd3f53 100644 --- a/src/util/xml.h +++ b/src/util/xml.h @@ -21,13 +21,17 @@ extern "C" { /* new xml functions: */ #include - typedef int (*xml_callback) (xmlDocPtr); - extern void xml_register_callback(xml_callback callback); - extern double xml_fvalue(xmlNodePtr node, const char *name, double dflt); - extern int xml_ivalue(xmlNodePtr node, const char *name, int dflt); - extern bool xml_bvalue(xmlNodePtr node, const char *name, bool dflt); + + typedef int (*xml_callback) (xmlDocPtr); + + void xml_register_callback(xml_callback callback); + double xml_fvalue(xmlNodePtr node, const char *name, double dflt); + int xml_ivalue(xmlNodePtr node, const char *name, int dflt); + bool xml_bvalue(xmlNodePtr node, const char *name, bool dflt); #endif - extern int read_xml(const char *filename, const char *catalog); + + void xml_done(void); + int read_xml(const char *filename, const char *catalog); #ifdef __cplusplus } diff --git a/src/volcano.c b/src/volcano.c new file mode 100644 index 000000000..60beeaed7 --- /dev/null +++ b/src/volcano.c @@ -0,0 +1,294 @@ +/* +Copyright (c) 1998-2015, Enno Rehling +Katja Zedel + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +**/ + +#include +#include +#include "volcano.h" + +#include "alchemy.h" + +/* kernel includes */ +#include +#include +#include +#include +#include +#include +#include +#include + +/* attributes includes */ +#include + +/* util includes */ +#include +#include +#include +#include +#include + +/* libc includes */ +#include +#include + +static int nb_armor(const unit * u, int index) +{ + const item *itm; + int av = 0; + int s = 0, a = 0; + + if (!(u_race(u)->battle_flags & BF_EQUIPMENT)) + return 0; + + /* Normale Rüstung */ + + for (itm = u->items; itm; itm = itm->next) { + const armor_type *atype = itm->type->rtype->atype; + if (atype != NULL) { + int *schutz = &a; + if (atype->flags & ATF_SHIELD) + schutz = &s; + if (*schutz <= index) { + *schutz += itm->number; + if (*schutz > index) { + av += atype->prot; + } + } + } + } + return av; +} + +static int +damage_unit(unit * u, const char *dam, bool physical, bool magic) +{ + int *hp, hpstack[20]; + int h; + int i, dead = 0, hp_rem = 0, heiltrank; + double magres = magic_resistance(u); + + assert(u->number); + if (fval(u_race(u), RCF_ILLUSIONARY) || u_race(u) == get_race(RC_SPELL)) { + return 0; + } + + assert(u->number <= u->hp); + h = u->hp / u->number; + /* HP verteilen */ + if (u->number < 20) { + hp = hpstack; + } + else { + hp = malloc(u->number * sizeof(int)); + } + for (i = 0; i < u->number; i++) + hp[i] = h; + h = u->hp - (u->number * h); + for (i = 0; i < h; i++) + hp[i]++; + + /* Schaden */ + for (i = 0; i < u->number; i++) { + int damage = dice_rand(dam); + if (magic) + damage = (int)(damage * (1.0 - magres)); + if (physical) + damage -= nb_armor(u, i); + hp[i] -= damage; + } + + /* Auswirkungen */ + for (i = 0; i < u->number; i++) { + if (hp[i] <= 0) { + heiltrank = 0; + + /* Sieben Leben */ + if (u_race(u) == get_race(RC_CAT) && (chance(1.0 / 7))) { + hp[i] = u->hp / u->number; + hp_rem += hp[i]; + continue; + } + + /* Heiltrank */ + if (oldpotiontype[P_HEAL]) { + if (get_effect(u, oldpotiontype[P_HEAL]) > 0) { + change_effect(u, oldpotiontype[P_HEAL], -1); + heiltrank = 1; + } + else if (i_get(u->items, oldpotiontype[P_HEAL]->itype) > 0) { + i_change(&u->items, oldpotiontype[P_HEAL]->itype, -1); + change_effect(u, oldpotiontype[P_HEAL], 3); + heiltrank = 1; + } + if (heiltrank && (chance(0.50))) { + hp[i] = u->hp / u->number; + hp_rem += hp[i]; + continue; + } + } + dead++; + } + else { + hp_rem += hp[i]; + } + } + + scale_number(u, u->number - dead); + u->hp = hp_rem; + + if (hp != hpstack) { + free(hp); + } + + return dead; +} + +static region *rrandneighbour(region * r) +{ + direction_t i; + region *rc = NULL; + int rr, c = 0; + + /* Nachsehen, wieviele Regionen in Frage kommen */ + + for (i = 0; i != MAXDIRECTIONS; i++) { + c++; + } + /* Zufällig eine auswählen */ + + rr = rng_int() % c; + + /* Durchzählen */ + + c = -1; + for (i = 0; i != MAXDIRECTIONS; i++) { + rc = rconnect(r, i); + c++; + if (c == rr) + break; + } + assert(i != MAXDIRECTIONS); + return rc; +} + +static void +volcano_destruction(region * volcano, region * r, const char *damage) +{ + attrib *a; + unit **up; + int percent = 25, time = 6 + rng_int() % 12; + + rsettrees(r, 2, 0); + rsettrees(r, 1, 0); + rsettrees(r, 0, 0); + + a = a_find(r->attribs, &at_reduceproduction); + if (!a) { + a = a_add(&r->attribs, make_reduceproduction(percent, time)); + } + else { + /* Produktion vierteln ... */ + a->data.sa[0] = (short)percent; + /* Für 6-17 Runden */ + a->data.sa[1] = (short)(a->data.sa[1] + time); + } + + /* Personen bekommen 4W10 Punkte Schaden. */ + + for (up = &r->units; *up;) { + unit *u = *up; + if (u->number) { + int dead = damage_unit(u, damage, true, false); + /* TODO create undead */ + if (dead) { + ADDMSG(&u->faction->msgs, msg_message("volcano_dead", + "unit region dead", u, volcano, dead)); + } + if (!fval(u->faction, FFL_SELECT)) { + fset(u->faction, FFL_SELECT); + ADDMSG(&u->faction->msgs, msg_message("volcanooutbreaknn", + "region", r)); + } + } + if (u == *up) { + up = &u->next; + } + } + + if (r != volcano) { + ADDMSG(&r->msgs, msg_message("volcanooutbreak", + "regionv regionn", volcano, r)); + } + remove_empty_units_in_region(r); +} + +void volcano_outbreak(region * r, region *rn) +{ + unit *u; + faction *f; + + for (f = NULL, u = r->units; u; u = u->next) { + if (f != u->faction) { + f = u->faction; + freset(f, FFL_SELECT); + } + } + + volcano_destruction(r, r, "4d10"); + if (rn) { + volcano_destruction(r, rn, "3d10"); + } +} + +void volcano_update(void) +{ + region *r; + const struct terrain_type *t_active, *t_volcano; + + t_volcano = get_terrain("volcano"); + t_active = get_terrain("activevolcano"); + /* Vulkane qualmen, brechen aus ... */ + for (r = regions; r; r = r->next) { + if (r->terrain == t_active) { + if (a_find(r->attribs, &at_reduceproduction)) { + ADDMSG(&r->msgs, msg_message("volcanostopsmoke", "region", r)); + r->terrain = t_volcano; + } + else { + if (rng_int() % 100 < 12) { + ADDMSG(&r->msgs, msg_message("volcanostopsmoke", "region", r)); + r->terrain = t_volcano; + } + else if (r->uid == 1246051340 || (r->age > 20 && rng_int() % 100 < 8)) { + region *rn; + /* Zufällige Nachbarregion verwüsten */ + rn = rrandneighbour(r); + volcano_outbreak(r, rn); + r->terrain = t_volcano; + } + } + } + else if (r->terrain == t_volcano) { + int volcano_chance = config_get_int("volcano.active.percent", 4); + if (rng_int() % 100 < volcano_chance) { + ADDMSG(&r->msgs, msg_message("volcanostartsmoke", "region", r)); + r->terrain = t_active; + } + } + } +} diff --git a/src/items/phoenixcompass.h b/src/volcano.h similarity index 84% rename from src/items/phoenixcompass.h rename to src/volcano.h index bc194959d..d06c381cc 100644 --- a/src/items/phoenixcompass.h +++ b/src/volcano.h @@ -1,3 +1,4 @@ +#pragma once /* Copyright (c) 1998-2015, Enno Rehling Katja Zedel +#include +#include "volcano.h" + +#include +#include +#include +#include +#include + +#include + +#include + +#include + +static void test_volcano_update(CuTest *tc) { + region *r; + message *m; + const struct terrain_type *t_volcano, *t_active; + + test_setup(); + mt_register(mt_new_va("volcanostopsmoke", "region:region", 0)); + t_volcano = test_create_terrain("volcano", LAND_REGION); + t_active = test_create_terrain("activevolcano", LAND_REGION); + r = test_create_region(0, 0, t_active); + a_add(&r->attribs, make_reduceproduction(25, 10)); + + volcano_update(); + CuAssertPtrNotNull(tc, m = test_find_messagetype(r->msgs, "volcanostopsmoke")); + CuAssertPtrEquals(tc, r, m->parameters[0].v); + CuAssertPtrEquals(tc, (void *)t_volcano, (void *)r->terrain); + + test_cleanup(); +} + +static void test_volcano_outbreak(CuTest *tc) { + region *r, *rn; + unit *u1, *u2; + faction *f; + message *m; + const struct terrain_type *t_volcano, *t_active; + + test_setup(); + mt_register(mt_new_va("volcanooutbreak", "regionv:region", "regionn:region", 0)); + mt_register(mt_new_va("volcano_dead", "unit:unit", "region:region", "dead:int", 0)); + t_volcano = test_create_terrain("volcano", LAND_REGION); + t_active = test_create_terrain("activevolcano", LAND_REGION); + r = test_create_region(0, 0, t_active); + rn = test_create_region(1, 0, t_volcano); + f = test_create_faction(0); + u1 = test_create_unit(f, r); + u1->hp = u1->number; + u2 = test_create_unit(f, rn); + u2->hp = u2->number; + + volcano_outbreak(r, rn); + CuAssertPtrEquals(tc, (void *)t_active, (void *)r->terrain); + CuAssertIntEquals(tc, 0, rtrees(r, 0)); + CuAssertIntEquals(tc, 0, rtrees(r, 1)); + CuAssertIntEquals(tc, 0, rtrees(r, 2)); + CuAssertPtrNotNull(tc, a_find(r->attribs, &at_reduceproduction)); + CuAssertPtrNotNull(tc, a_find(rn->attribs, &at_reduceproduction)); + + CuAssertPtrNotNull(tc, m = test_find_messagetype(rn->msgs, "volcanooutbreak")); + CuAssertPtrEquals(tc, r, m->parameters[0].v); + CuAssertPtrEquals(tc, rn, m->parameters[1].v); + + CuAssertPtrNotNull(tc, m = test_find_messagetype_ex(f->msgs, "volcano_dead", NULL)); + CuAssertPtrEquals(tc, u1, m->parameters[0].v); + CuAssertPtrEquals(tc, r, m->parameters[1].v); + CuAssertIntEquals(tc, 1, m->parameters[2].i); + CuAssertPtrNotNull(tc, m = test_find_messagetype_ex(f->msgs, "volcano_dead", m)); + CuAssertPtrEquals(tc, u2, m->parameters[0].v); + CuAssertPtrEquals(tc, r, m->parameters[1].v); + CuAssertIntEquals(tc, 1, m->parameters[2].i); + test_cleanup(); +} + +CuSuite *get_volcano_suite(void) +{ + CuSuite *suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_volcano_update); + SUITE_ADD_TEST(suite, test_volcano_outbreak); + return suite; +} diff --git a/src/vortex.c b/src/vortex.c index 8aac12aec..725460ce2 100644 --- a/src/vortex.c +++ b/src/vortex.c @@ -2,7 +2,6 @@ #include "vortex.h" #include -#include #include #include @@ -15,8 +14,9 @@ #include #include -#include #include +#include + typedef struct dir_lookup { char *name; @@ -33,10 +33,10 @@ void register_special_direction(struct locale *lang, const char *name) if (token) { void **tokens = get_translations(lang, UT_SPECDIR); variant var; - char *str = _strdup(name); + char *str = strdup(name); var.v = str; - addtoken(tokens, token, var); + addtoken((struct tnode **)tokens, token, var); if (lang == locales) { dir_lookup *dl = malloc(sizeof(dir_lookup)); diff --git a/src/vortex.test.c b/src/vortex.test.c index 78a04535f..21ea6596c 100644 --- a/src/vortex.test.c +++ b/src/vortex.test.c @@ -22,7 +22,7 @@ static void test_move_to_vortex(CuTest *tc) { unit *u; struct locale *lang; - test_cleanup(); + test_setup(); lang = get_or_create_locale("en"); locale_setstring(lang, "vortex", "wirbel"); init_locale(lang); diff --git a/src/wormhole.c b/src/wormhole.c index 916c0509d..6a115a9f7 100644 --- a/src/wormhole.c +++ b/src/wormhole.c @@ -23,7 +23,6 @@ #include #include #include -#include /* util includes */ #include diff --git a/src/wormhole.test.c b/src/wormhole.test.c index 03bf14ab9..ec93c5b4c 100644 --- a/src/wormhole.test.c +++ b/src/wormhole.test.c @@ -22,7 +22,7 @@ static void test_make_wormholes(CuTest *tc) { terrain_type *t_plain; building_type *btype; - test_cleanup(); + test_setup(); t_plain = test_create_terrain("plain", LAND_REGION); btype = test_create_buildingtype("wormhole"); match[0] = r1 = test_create_region(0, 0, t_plain); @@ -44,7 +44,7 @@ static void test_sort_wormhole_regions(CuTest *tc) { terrain_type *t_plain; quicklist *rlist = 0; - test_cleanup(); + test_setup(); t_plain = test_create_terrain("plain", LAND_REGION); r1 = test_create_region(0, 0, t_plain); r2 = test_create_region(1, 0, t_plain); diff --git a/src/xmlreport.c b/src/xmlreport.c deleted file mode 100644 index 43d7cc55b..000000000 --- a/src/xmlreport.c +++ /dev/null @@ -1,801 +0,0 @@ -/* -+-------------------+ Enno Rehling -| Eressea PBEM host | Christian Schlittchen -| (c) 1998 - 2008 | Katja Zedel -+-------------------+ -This program may not be used, modified or distributed -without prior permission by the authors of Eressea. -*/ - -#include -#include -#include "xmlreport.h" - -#define XML_ATL_NAMESPACE (const xmlChar *) "http://www.eressea.de/XML/2008/atlantis" -#define XML_XML_LANG (const xmlChar *) "lang" - -/* modules include */ -#include - -/* attributes include */ -#include -#include -#include -#include -#include - -/* gamecode includes */ -#include "laws.h" -#include "economy.h" -#include "move.h" - -/* kernel includes */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* util includes */ -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef USE_LIBXML2 -/* libxml2 includes */ -#include -#include -#ifdef USE_ICONV -#include -#endif -#endif - -/* libc includes */ -#include -#include -#include -#include -#include -#include - -#define L10N(x) x - -typedef struct xml_context { - xmlDocPtr doc; - xmlNsPtr ns_atl; - xmlNsPtr ns_xml; -} xml_context; - -static xmlNodePtr -xml_link(report_context * ctx, const xmlChar * rel, const xmlChar * ref) -{ - xml_context *xct = (xml_context *) ctx->userdata; - xmlNodePtr node = xmlNewNode(xct->ns_atl, BAD_CAST "link"); - - xmlNewNsProp(node, xct->ns_atl, BAD_CAST "rel", rel); - xmlNewNsProp(node, xct->ns_atl, BAD_CAST "ref", ref); - - return node; -} - -static const xmlChar *xml_ref_unit(const unit * u) -{ - static char idbuf[20]; - _snprintf(idbuf, sizeof(idbuf), "unit_%d", u->no); - return (const xmlChar *)idbuf; -} - -static const xmlChar *xml_ref_faction(const faction * f) -{ - static char idbuf[20]; - _snprintf(idbuf, sizeof(idbuf), "fctn_%d", f->no); - return (const xmlChar *)idbuf; -} - -static const xmlChar *xml_ref_group(const group * g) -{ - static char idbuf[20]; - _snprintf(idbuf, sizeof(idbuf), "grp_%d", g->gid); - return (const xmlChar *)idbuf; -} - -static const xmlChar *xml_ref_prefix(const char *str) -{ - static char idbuf[20]; - _snprintf(idbuf, sizeof(idbuf), "pref_%s", str); - return (const xmlChar *)idbuf; -} - -static const xmlChar *xml_ref_building(const building * b) -{ - static char idbuf[20]; - _snprintf(idbuf, sizeof(idbuf), "bldg_%d", b->no); - return (const xmlChar *)idbuf; -} - -static const xmlChar *xml_ref_ship(const ship * sh) -{ - static char idbuf[20]; - _snprintf(idbuf, sizeof(idbuf), "shp_%d", sh->no); - return (const xmlChar *)idbuf; -} - -static const xmlChar *xml_ref_region(const region * r) -{ - static char idbuf[20]; - _snprintf(idbuf, sizeof(idbuf), "rgn_%d", r->uid); - return (const xmlChar *)idbuf; -} - -static xmlNodePtr xml_inventory(report_context * ctx, item * items, unit * u) -{ - xml_context *xct = (xml_context *) ctx->userdata; - xmlNodePtr node = xmlNewNode(xct->ns_atl, BAD_CAST "items"); - item *itm; - - for (itm = items; itm; itm = itm->next) { - xmlNodePtr child; - const char *name; - int n; - - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "item")); - report_item(u, itm, ctx->f, NULL, &name, &n, true); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", (xmlChar *) name); - xmlNodeAddContent(child, (xmlChar *) itoab(n, 10)); - } - return node; -} - -#ifdef TODO /*spellbooks */ -static xmlNodePtr -xml_spells(report_context * ctx, quicklist * slist, int maxlevel) -{ - xml_context *xct = (xml_context *) ctx->userdata; - xmlNodePtr child, node = xmlNewNode(xct->ns_atl, BAD_CAST "spells"); - quicklist *ql; - int qi; - - for (ql = slist, qi = 0; ql; ql_advance(&ql, &qi, 1)) { - spell *sp = (spell *) ql_get(ql, qi); - - if (sp->level <= maxlevel) { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "spell")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "name", BAD_CAST sp->sname); - } - } - return node; -} -#endif - -static xmlNodePtr xml_skills(report_context * ctx, unit * u) -{ - xml_context *xct = (xml_context *) ctx->userdata; - xmlNodePtr child, node = xmlNewNode(xct->ns_atl, BAD_CAST "skills"); - skill *sv; - - for (sv = u->skills; sv != u->skills + u->skill_size; ++sv) { - if (sv->level > 0) { - skill_t sk = sv->id; - int esk = eff_skill(u, sk, u->region); - - child = - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "skill", BAD_CAST itoab(esk, - 10)); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", BAD_CAST skillnames[sk]); - } - } - - return node; -} - -static xmlNodePtr xml_unit(report_context * ctx, unit * u, int mode) -{ - xml_context *xct = (xml_context *) ctx->userdata; - xmlNodePtr node = xmlNewNode(xct->ns_atl, BAD_CAST "unit"); - static const curse_type *itemcloak_ct = 0; - static bool init = false; - xmlNodePtr child; - const char *str, *rcname, *rcillusion; - bool disclosure = (ctx->f == u->faction || omniscient(ctx->f)); - - /* TODO: hitpoints, aura, combatspells, curses */ - - xmlNewNsProp(node, xct->ns_xml, XML_XML_ID, xml_ref_unit(u)); - xmlNewNsProp(node, xct->ns_atl, BAD_CAST "key", BAD_CAST itoa36(u->no)); - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "name", (const xmlChar *)u->name); - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "number", - (const xmlChar *)itoab(u->number, 10)); - - /* optional description */ - str = u_description(u, ctx->f->locale); - if (str) { - child = - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "text", (const xmlChar *)str); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "public"); - if (str != u->display) { - xmlNewNsProp(child, xct->ns_atl, XML_XML_LANG, - BAD_CAST locale_name(ctx->f->locale)); - } - } - - /* possible info */ - if (is_guard(u, GUARD_ALL) != 0) { - xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "guard")); - } - - /* siege */ - if (fval(u, UFL_SIEGE)) { - building *b = usiege(u); - if (b) { - xmlAddChild(node, xml_link(ctx, BAD_CAST "siege", xml_ref_building(b))); - } - } - - /* TODO: temp/alias */ - - /* race information */ - report_race(u, &rcname, &rcillusion); - if (disclosure) { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "race")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "true"); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", (const xmlChar *)rcname); - if (rcillusion) { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "race")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "stealth"); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", - (const xmlChar *)rcillusion); - } - } else { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "race")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", - (const xmlChar *)(rcillusion ? rcillusion : rcname)); - } - - /* group and prefix information. we only write the prefix if we really must */ - if (fval(u, UFL_GROUP)) { - attrib *a = a_find(u->attribs, &at_group); - if (a != NULL) { - const group *g = (const group *)a->data.v; - if (disclosure) { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "group")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", xml_ref_group(g)); - } else { - const char *prefix = get_prefix(g->attribs); - if (prefix) { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "prefix")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", - xml_ref_prefix(prefix)); - } - } - } - } - - if (disclosure) { - unit *mage; - - str = uprivate(u); - if (str) { - child = - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "text", - (const xmlChar *)str); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "private"); - } - - /* familiar info */ - mage = get_familiar_mage(u); - if (mage) - xmlAddChild(node, xml_link(ctx, BAD_CAST "familiar_of", - xml_ref_unit(mage))); - - /* combat status */ - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "status")); - xmlSetNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "combat"); - xmlSetNsProp(child, xct->ns_atl, BAD_CAST "value", - BAD_CAST combatstatus[u->status]); - - if (fval(u, UFL_NOAID)) { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "status")); - xmlSetNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "aid"); - xmlSetNsProp(child, xct->ns_atl, BAD_CAST "value", BAD_CAST "false"); - } - - if (fval(u, UFL_STEALTH)) { - int i = u_geteffstealth(u); - if (i >= 0) { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "status")); - xmlSetNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "stealth"); - xmlSetNsProp(child, xct->ns_atl, BAD_CAST "value", BAD_CAST itoab(i, - 10)); - } - } - if (fval(u, UFL_HERO)) { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "status")); - xmlSetNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "hero"); - xmlSetNsProp(child, xct->ns_atl, BAD_CAST "value", BAD_CAST "true"); - } - - if (fval(u, UFL_HUNGER)) { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "status")); - xmlSetNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "hunger"); - xmlSetNsProp(child, xct->ns_atl, BAD_CAST "value", BAD_CAST "true"); - } - - /* skills */ - if (u->skill_size) { - xmlAddChild(node, xml_skills(ctx, u)); - } - -#ifdef TODO /*spellbooks */ - /* spells */ - if (is_mage(u)) { - sc_mage *mage = get_mage(u); - quicklist *slist = mage->spells; - if (slist) { - xmlAddChild(node, xml_spells(ctx, slist, effskill(u, SK_MAGIC))); - } - } -#endif - } - - /* faction information w/ visibiility */ - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "faction")); - if (disclosure) { - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "true"); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", - xml_ref_faction(u->faction)); - - if (fval(u, UFL_ANON_FACTION)) { - const faction *sf = visible_faction(NULL, u); - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "faction")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "stealth"); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", xml_ref_faction(sf)); - } - } else { - const faction *sf = visible_faction(ctx->f, u); - if (sf == ctx->f) { - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "stealth"); - } - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", xml_ref_faction(sf)); - } - - /* the inventory */ - if (u->items) { - item result[MAX_INVENTORY]; - item *show = NULL; - - if (!init) { - init = true; - itemcloak_ct = ct_find("itemcloak"); - } - - if (disclosure) { - show = u->items; - } else { - bool see_items = (mode >= see_unit); - if (see_items) { - if (itemcloak_ct && curse_active(get_curse(u->attribs, itemcloak_ct))) { - see_items = false; - } else { - see_items = effskill(u, SK_STEALTH) < 3; - } - } - if (see_items) { - int n = report_items(u->items, result, MAX_INVENTORY, u, ctx->f); - assert(n >= 0); - if (n > 0) - show = result; - else - show = NULL; - } else { - show = NULL; - } - } - - if (show) { - xmlAddChild(node, xml_inventory(ctx, show, u)); - } - } - - return node; -} - -static xmlNodePtr xml_resources(report_context * ctx, const seen_region * sr) -{ - xml_context *xct = (xml_context *) ctx->userdata; - xmlNodePtr node = NULL; - resource_report result[MAX_RAWMATERIALS]; - int n, size = report_resources(sr, result, MAX_RAWMATERIALS, ctx->f); - - if (size) { - node = xmlNewNode(xct->ns_atl, BAD_CAST "resources"); - for (n = 0; n < size; ++n) { - if (result[n].number >= 0) { - xmlNodePtr child; - - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "resource")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", - (xmlChar *) result[n].name); - if (result[n].level >= 0) { - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "level", - (xmlChar *) itoab(result[n].level, 10)); - } - xmlNodeAddContent(child, (xmlChar *) itoab(result[n].number, 10)); - } - } - } - return node; -} - -static xmlNodePtr xml_diplomacy(report_context * ctx, const struct ally *allies) -{ - xml_context *xct = (xml_context *) ctx->userdata; - xmlNodePtr child, node = xmlNewNode(xct->ns_atl, BAD_CAST "diplomacy"); - const struct ally *sf; - - for (sf = allies; sf; sf = sf->next) { - int i, status = sf->status; - for (i = 0; helpmodes[i].name; ++i) { - if (sf->faction && (status & helpmodes[i].status) == helpmodes[i].status) { - status -= helpmodes[i].status; - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "status")); - xmlNewNsProp(child, xct->ns_xml, BAD_CAST "faction", - xml_ref_faction(sf->faction)); - xmlNewNsProp(child, xct->ns_xml, BAD_CAST "status", - (xmlChar *) helpmodes[i].name); - } - } - } - return node; -} - -static xmlNodePtr xml_groups(report_context * ctx, const group * groups) -{ - xml_context *xct = (xml_context *) ctx->userdata; - xmlNodePtr child, node = xmlNewNode(xct->ns_atl, BAD_CAST "faction"); - const group *g; - - for (g = groups; g; g = g->next) { - const char *prefix = get_prefix(g->attribs); - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "group")); - xmlNewNsProp(child, xct->ns_xml, XML_XML_ID, xml_ref_group(g)); - xmlNewTextChild(child, xct->ns_atl, BAD_CAST "name", - (const xmlChar *)g->name); - - if (g->allies) - xmlAddChild(child, xml_diplomacy(ctx, g->allies)); - - if (prefix) { - child = xmlAddChild(child, xmlNewNode(xct->ns_atl, BAD_CAST "prefix")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", xml_ref_prefix(prefix)); - } - } - - return node; -} - -static xmlNodePtr xml_faction(report_context * ctx, faction * f) -{ - xml_context *xct = (xml_context *) ctx->userdata; - xmlNodePtr child, node = xmlNewNode(xct->ns_atl, BAD_CAST "faction"); - - /* TODO: alliance, locale */ - - xmlNewNsProp(node, xct->ns_xml, XML_XML_ID, xml_ref_faction(f)); - xmlNewNsProp(node, xct->ns_atl, BAD_CAST "key", BAD_CAST itoa36(f->no)); - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "name", (const xmlChar *)f->name); - if (f->email) - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "email", - (const xmlChar *)f->email); - if (f->banner) { - child = - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "text", - (const xmlChar *)f->banner); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "public"); - } - - if (ctx->f == f) { - xmlAddChild(node, xml_link(ctx, BAD_CAST "race", - BAD_CAST f->race->_name[0])); - - if (f->items) - xmlAddChild(node, xml_inventory(ctx, f->items, NULL)); - if (f->allies) - xmlAddChild(node, xml_diplomacy(ctx, f->allies)); - if (f->groups) - xmlAddChild(node, xml_groups(ctx, f->groups)); - - /* TODO: age, options, score, prefix, magic, immigrants, heroes, nmr, groups */ - } - return node; -} - -static xmlNodePtr -xml_building(report_context * ctx, seen_region * sr, const building * b, - const unit * owner) -{ - xml_context *xct = (xml_context *) ctx->userdata; - xmlNodePtr node = xmlNewNode(xct->ns_atl, BAD_CAST "building"); - xmlNodePtr child; - const char *bname, *billusion; - - xmlNewNsProp(node, xct->ns_xml, XML_XML_ID, xml_ref_building(b)); - xmlNewNsProp(node, xct->ns_atl, BAD_CAST "key", BAD_CAST itoa36(b->no)); - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "name", (const xmlChar *)b->name); - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "size", - (const xmlChar *)itoab(b->size, 10)); - if (b->display && b->display[0]) { - child = - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "text", - (const xmlChar *)b->display); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "public"); - } - if (b->besieged) { - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "siege", - (const xmlChar *)itoab(b->besieged, 10)); - } - if (owner) - xmlAddChild(node, xml_link(ctx, BAD_CAST "owner", xml_ref_unit(owner))); - - report_building(b, &bname, &billusion); - if (owner && owner->faction == ctx->f) { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "type")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "true"); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", (const xmlChar *)bname); - if (billusion) { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "type")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "illusion"); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", - (const xmlChar *)billusion); - } - } else { - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "type")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", - (const xmlChar *)(billusion ? billusion : bname)); - } - - return node; -} - -static xmlNodePtr -xml_ship(report_context * ctx, const seen_region * sr, const ship * sh, - const unit * owner) -{ - xml_context *xct = (xml_context *) ctx->userdata; - xmlNodePtr child, node = xmlNewNode(xct->ns_atl, BAD_CAST "ship"); - - xmlNewNsProp(node, xct->ns_xml, XML_XML_ID, xml_ref_ship(sh)); - xmlNewNsProp(node, xct->ns_atl, BAD_CAST "key", BAD_CAST itoa36(sh->no)); - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "name", - (const xmlChar *)sh->name); - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "size", - (const xmlChar *)itoab(sh->size, 10)); - - if (sh->damage) { - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "damage", - (const xmlChar *)itoab(sh->damage, 10)); - } - - if (fval(sr->r->terrain, SEA_REGION) && sh->coast != NODIRECTION) { - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "coast", - BAD_CAST directions[sh->coast]); - } - - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "type")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", - (const xmlChar *)sh->type->name[0]); - - if (sh->display && sh->display[0]) { - child = - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "text", - (const xmlChar *)sh->display); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "public"); - } - - if (owner) - xmlAddChild(node, xml_link(ctx, BAD_CAST "owner", xml_ref_unit(owner))); - - if ((owner && owner->faction == ctx->f) || omniscient(ctx->f)) { - int n = 0, p = 0; - getshipweight(sh, &n, &p); - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "cargo", - (const xmlChar *)itoab(n, 10)); - } - return node; -} - -static xmlNodePtr xml_region(report_context * ctx, seen_region * sr) -{ - xml_context *xct = (xml_context *) ctx->userdata; - const region *r = sr->r; - xmlNodePtr node = xmlNewNode(xct->ns_atl, BAD_CAST "region"); - xmlNodePtr child; - int stealthmod = stealth_modifier(sr->mode); - unit *u; - ship *sh = r->ships; - building *b = r->buildings; - plane *pl = rplane(r); - int nx = r->x, ny = r->y; - - pnormalize(&nx, &ny, pl); - adjust_coordinates(ctx->f, &nx, &ny, pl, r); - - /* TODO: entertain-quota, recruits, salary, prices, curses, borders, apparitions (Schemen), spells, travelthru, messages */ - xmlNewNsProp(node, xct->ns_xml, XML_XML_ID, xml_ref_region(r)); - - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "coordinate")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "x", xml_i(nx)); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "y", xml_i(ny)); - if (pl && pl->name) { - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "plane", (xmlChar *) pl->name); - } - - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "terrain")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", (xmlChar *) terrain_name(r)); - - if (r->land != NULL) { - child = - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "name", - (const xmlChar *)r->land->name); - if (r->land->items) { - xmlAddChild(node, xml_inventory(ctx, r->land->items, NULL)); - } - } - if (r->display && r->display[0]) { - child = - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "text", - (const xmlChar *)r->display); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "rel", BAD_CAST "public"); - } - child = xml_resources(ctx, sr); - if (child) - xmlAddChild(node, child); - - child = xmlNewNode(xct->ns_atl, BAD_CAST "terrain"); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", - (const xmlChar *)terrain_name(r)); - - if (sr->mode > see_neighbour) { - /* report all units. they are pre-sorted in an efficient manner */ - u = r->units; - while (b) { - while (b && (!u || u->building != b)) { - xmlAddChild(node, xml_building(ctx, sr, b, NULL)); - b = b->next; - } - if (b) { - child = xmlAddChild(node, xml_building(ctx, sr, b, u)); - while (u && u->building == b) { - xmlAddChild(child, xml_unit(ctx, u, sr->mode)); - u = u->next; - } - b = b->next; - } - } - while (u && !u->ship) { - if (stealthmod > INT_MIN) { - if (u->faction == ctx->f || cansee(ctx->f, r, u, stealthmod)) { - xmlAddChild(node, xml_unit(ctx, u, sr->mode)); - } - } - u = u->next; - } - while (sh) { - while (sh && (!u || u->ship != sh)) { - xmlAddChild(node, xml_ship(ctx, sr, sh, NULL)); - sh = sh->next; - } - if (sh) { - child = xmlAddChild(node, xml_ship(ctx, sr, sh, u)); - while (u && u->ship == sh) { - xmlAddChild(child, xml_unit(ctx, u, sr->mode)); - u = u->next; - } - sh = sh->next; - } - } - } - return node; -} - -static xmlNodePtr report_root(report_context * ctx) -{ - int qi; - quicklist *address; - region *r = ctx->first, *rend = ctx->last; - xml_context *xct = (xml_context *) ctx->userdata; - xmlNodePtr node, child, xmlReport = xmlNewNode(NULL, BAD_CAST "atlantis"); - const char *mailto = locale_string(ctx->f->locale, "mailto"); - const char *mailcmd = locale_string(ctx->f->locale, "mailcmd"); - char zText[128]; - /* TODO: locale, age, options, messages */ - - xct->ns_xml = xmlNewNs(xmlReport, XML_XML_NAMESPACE, BAD_CAST "xml"); - xct->ns_atl = xmlNewNs(xmlReport, XML_ATL_NAMESPACE, NULL); - xmlSetNs(xmlReport, xct->ns_atl); - - node = xmlAddChild(xmlReport, xmlNewNode(xct->ns_atl, BAD_CAST "server")); - if (mailto) { - _snprintf(zText, sizeof(zText), "mailto:%s?subject=%s", mailto, mailcmd); - child = xmlAddChild(node, xmlNewNode(xct->ns_atl, BAD_CAST "delivery")); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "method", BAD_CAST "mail"); - xmlNewNsProp(child, xct->ns_atl, BAD_CAST "href", BAD_CAST zText); - } - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "game", - (xmlChar *) global.gamename); - strftime(zText, sizeof(zText), "%Y-%m-%dT%H:%M:%SZ", - gmtime(&ctx->report_time)); - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "time", (xmlChar *) zText); - xmlNewTextChild(node, xct->ns_atl, BAD_CAST "turn", (xmlChar *) itoab(turn, - 10)); - - for (qi = 0, address = ctx->addresses; address; ql_advance(&address, &qi, 1)) { - faction *f = (faction *) ql_get(address, qi); - xmlAddChild(xmlReport, xml_faction(ctx, f)); - } - - for (; r != rend; r = r->next) { - seen_region *sr = find_seen(ctx->seen, r); - if (sr != NULL) - xmlAddChild(xmlReport, xml_region(ctx, sr)); - } - return xmlReport; -} - -/* main function of the xmlreport. creates the header and traverses all regions */ -static int -report_xml(const char *filename, report_context * ctx, const char *encoding) -{ - xml_context xct; - xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0"); - - xct.doc = doc; - assert(ctx->userdata == NULL); - ctx->userdata = &xct; - - xmlDocSetRootElement(doc, report_root(ctx)); - xmlKeepBlanksDefault(0); - xmlSaveFormatFileEnc(filename, doc, "utf-8", 1); - xmlFreeDoc(doc); - - ctx->userdata = NULL; - - return 0; -} - -void register_xr(void) -{ - register_reporttype("xml", &report_xml, 1 << O_XML); -#ifdef USE_ICONV - utf8 = iconv_open("UTF-8", ""); -#endif -} - -void xmlreport_cleanup(void) -{ -#ifdef USE_ICONV - iconv_close(utf8); -#endif -} diff --git a/src/xmlreport.h b/src/xmlreport.h deleted file mode 100644 index 676fbd1a2..000000000 --- a/src/xmlreport.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - +-------------------+ Christian Schlittchen - | Eressea PBEM host | Katja Zedel - | (c) 1998 - 2005 | Enno Rehling - +-------------------+ - - This program may not be used, modified or distributed - without prior permission by the authors of Eressea. -*/ -#ifndef H_GC_XMLREPORT -#define H_GC_XMLREPORT -#ifdef __cplusplus -extern "C" { -#endif - -#include - - extern void xmlreport_cleanup(void); - extern void register_xr(void); - - extern int crwritemap(const char *filename); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/storage b/storage index 18cc3bb8f..2117191d4 160000 --- a/storage +++ b/storage @@ -1 +1 @@ -Subproject commit 18cc3bb8f8906237915eb31c9899f95340318087 +Subproject commit 2117191d4ad75e1eb14809878bc71d15b20a5d86 diff --git a/tests/data/184.dat b/tests/data/184.dat index d219f92dd..a1ee8802a 100644 Binary files a/tests/data/184.dat and b/tests/data/184.dat differ diff --git a/tests/drmemory.bat b/tests/drmemory.bat index 1d07081aa..66ca98c38 100644 --- a/tests/drmemory.bat +++ b/tests/drmemory.bat @@ -2,6 +2,6 @@ cd c:\users\enno\documents\eressea\git\tests "C:\Program Files (x86)\Dr. Memory\bin64\drmemory.exe" ..\build-vs14\eressea\Debug\eressea.exe -t184 test-turn.lua -del reports -del datum htpasswd parteien parteien.full passwd score turn +del /q reports +del /q datum htpasswd parteien parteien.full passwd score turn pause diff --git a/tests/run-turn.sh b/tests/run-turn.sh index d47ac81a2..519ed8bd8 100755 --- a/tests/run-turn.sh +++ b/tests/run-turn.sh @@ -53,6 +53,9 @@ assert_grep_count reports/$CRFILE '^BURG' 1 assert_grep_count reports/$CRFILE '^EINHEIT' 2 assert_grep_count reports/$CRFILE '^GEGENSTAENDE' 2 +assert_grep_count reports/185-heg.nr 'erblickt' 6 +assert_grep_count reports/185-heg.cr '"lighthouse";visibility' 6 +assert_grep_count reports/185-heg.cr '"neighbour";visibility' 11 assert_grep_count reports/185-6rLo.cr '^EINHEIT' 2 assert_grep_count reports/185-6rLo.cr '^REGION' 13 echo "integration tests: PASS" diff --git a/tests/runtests.bat b/tests/runtests.bat index 4a0981ab2..e79d27baa 100644 --- a/tests/runtests.bat +++ b/tests/runtests.bat @@ -11,4 +11,4 @@ SET SERVER=%BUILD%\eressea.exe %SERVER% ..\scripts\run-tests-e4.lua PAUSE RMDIR /s /q reports -DEL score score.alliances +DEL score score.alliances datum turn diff --git a/tests/test-turn.lua b/tests/test-turn.lua index 03178b74d..826ffc00f 100644 --- a/tests/test-turn.lua +++ b/tests/test-turn.lua @@ -3,3 +3,4 @@ turn = get_turn() eressea.free_game() print("trying to read data from " .. turn) eressea.read_game(turn .. ".dat") +eressea.free_game() diff --git a/tolua b/tolua deleted file mode 160000 index 32cc6a3e7..000000000 --- a/tolua +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 32cc6a3e78238278bc5b1fb8566526558e5afdda