diff --git a/src/items.c b/src/items.c index 78f6e3188..0f97ea675 100644 --- a/src/items.c +++ b/src/items.c @@ -178,8 +178,8 @@ struct order *ord) return 0; } -#define BAGPIPEFRACTION dice_rand("2d4+2") -#define BAGPIPEDURATION dice_rand("2d10+4") +#define BAGPIPEFRACTION (dice(2,4)+2) +#define BAGPIPEDURATION (dice(2,10)+4) static int use_bagpipeoffear(struct unit *u, const struct item_type *itype, diff --git a/src/kernel/region.c b/src/kernel/region.c index e4f33db33..48256fb60 100644 --- a/src/kernel/region.c +++ b/src/kernel/region.c @@ -1217,7 +1217,7 @@ void terraform_region(region * r, const terrain_type * terrain) if (!fval(r, RF_CHAOTIC)) { int peasants; - peasants = (region_maxworkers(r) * (20 + dice_rand("6d10"))) / 100; + peasants = (region_maxworkers(r) * (20 + dice(6, 10))) / 100; rsetpeasants(r, MAX(100, peasants)); rsetmoney(r, rpeasants(r) * ((wage(r, NULL, NULL, INT_MAX) + 1) + rng_int() % 5)); diff --git a/src/util/crmessage.c b/src/util/crmessage.c index 47bb6bf7d..dd400bf3d 100644 --- a/src/util/crmessage.c +++ b/src/util/crmessage.c @@ -81,7 +81,7 @@ static crmessage_type *crtypes[CRMAXHASH]; static crmessage_type *crt_find(const struct message_type *mtype) { - unsigned int hash = hashstring(mtype->name) % CRMAXHASH; + unsigned int hash = mtype->key % CRMAXHASH; crmessage_type *found = NULL; crmessage_type *type = crtypes[hash]; while (type) { @@ -94,7 +94,7 @@ static crmessage_type *crt_find(const struct message_type *mtype) void crt_register(const struct message_type *mtype) { - unsigned int hash = hashstring(mtype->name) % CRMAXHASH; + unsigned int hash = mtype->key % CRMAXHASH; crmessage_type *crt = crtypes[hash]; while (crt && crt->mtype != mtype) { crt = crt->next; diff --git a/src/util/nrmessage.c b/src/util/nrmessage.c index 717c4dc1f..4b7c5ea75 100644 --- a/src/util/nrmessage.c +++ b/src/util/nrmessage.c @@ -40,7 +40,7 @@ nrmessage_type *nrt_find(const struct locale * lang, const struct message_type * mtype) { nrmessage_type *found = NULL; - unsigned int hash = hashstring(mtype->name) % NRT_MAXHASH; + unsigned int hash = mtype->key % NRT_MAXHASH; nrmessage_type *type = nrtypes[hash]; while (type) { if (type->mtype == mtype) { @@ -101,7 +101,7 @@ void nrt_register(const struct message_type *mtype, const struct locale *lang, const char *string, int level, const char *section) { - unsigned int hash = hashstring(mtype->name) % NRT_MAXHASH; + unsigned int hash = mtype->key % NRT_MAXHASH; nrmessage_type *nrt = nrtypes[hash]; while (nrt && (nrt->lang != lang || nrt->mtype != mtype)) { nrt = nrt->next; diff --git a/tests/runtests.bat b/tests/runtests.bat index 7a58e5762..41b5f8056 100644 --- a/tests/runtests.bat +++ b/tests/runtests.bat @@ -3,7 +3,6 @@ IF EXIST ..\build-vs10 SET BUILD=..\build-vs10\eressea\Debug IF EXIST ..\build-vs11 SET BUILD=..\build-vs11\eressea\Debug IF EXIST ..\build-vs12 SET BUILD=..\build-vs12\eressea\Debug IF EXIST ..\build-vs14 SET BUILD=..\build-vs14\eressea\Debug -IF EXIST ..\build-vs15 SET BUILD=..\build-vs15\eressea\Debug SET SERVER=%BUILD%\eressea.exe %BUILD%\test_eressea.exe %SERVER% ..\scripts\run-tests.lua