From 2648690af90e0d2a47d27f40a956eab3f727a7b6 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 23 Jul 2009 19:52:29 +0000 Subject: [PATCH] fix crash --- src/eressea/tolua/bind_message.c | 8 ++++---- src/res/e3a/messages.xml | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 src/res/e3a/messages.xml diff --git a/src/eressea/tolua/bind_message.c b/src/eressea/tolua/bind_message.c index 8dd37bd3e..a45a32142 100644 --- a/src/eressea/tolua/bind_message.c +++ b/src/eressea/tolua/bind_message.c @@ -90,9 +90,8 @@ msg_set_resource(lua_message * msg, const char * param, const char * resname) int msg_set_unit(lua_message * msg, const char * param, const unit * u) { - int i = mtype_get_param(msg->mtype, param); - if (msg->mtype) { + int i = mtype_get_param(msg->mtype, param); if (i==msg->mtype->nparameters) { return E_INVALID_PARAMETER_NAME; @@ -111,8 +110,8 @@ msg_set_unit(lua_message * msg, const char * param, const unit * u) int msg_set_region(lua_message * msg, const char * param, const region * r) { - int i = mtype_get_param(msg->mtype, param); if (msg->mtype) { + int i = mtype_get_param(msg->mtype, param); if (i==msg->mtype->nparameters) { return E_INVALID_PARAMETER_NAME; @@ -131,9 +130,10 @@ msg_set_region(lua_message * msg, const char * param, const region * r) int msg_set_string(lua_message * msg, const char * param, const char * value) { - int i = mtype_get_param(msg->mtype, param); if (msg->mtype) { + int i = mtype_get_param(msg->mtype, param); variant var; + if (i==msg->mtype->nparameters) { return E_INVALID_PARAMETER_NAME; } diff --git a/src/res/e3a/messages.xml b/src/res/e3a/messages.xml new file mode 100644 index 000000000..af781cfa5 --- /dev/null +++ b/src/res/e3a/messages.xml @@ -0,0 +1,10 @@ + + + + + + + "$if($isnull($mage),"Ein unentdeckter Magier",$unit($mage)) führt einen sonderbaren Tanz auf. Kurz darauf beginnt es zu regnen." + "$if($isnull($mage),"an unseen magician",$unit($mage)) dances a strange dance. Shortly after, rain begins to fall on the fields." + +