From: Laszlo T. <ave...@us...> - 2012-04-04 17:38:01
|
gemrb: Infinity Engine emulator The branch master has been updated via 1d39c7e1a171ea8c9ab4516d34b93a81b38e74fd (commit) Summary of changes: gemrb/plugins/GUIScript/GUIScript.cpp | 33 ++++++++++++++++++++++++--------- 1 files changed, 24 insertions(+), 9 deletions(-) from 975893215c223a1ea4ec69f38a41abefa738d574 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=1d39c7e1a171ea8c9ab4516d34b93a81b38e74fd commit 1d39c7e1a171ea8c9ab4516d34b93a81b38e74fd Author: Avenger <ave...@so...> Date: Wed Apr 4 19:37:18 2012 +0200 fixed crasher in case of missing current area diff --git a/gemrb/plugins/GUIScript/GUIScript.cpp b/gemrb/plugins/GUIScript/GUIScript.cpp index 363e952..8aff3b2 100644 --- a/gemrb/plugins/GUIScript/GUIScript.cpp +++ b/gemrb/plugins/GUIScript/GUIScript.cpp @@ -5687,6 +5687,9 @@ static PyObject* GemRB_GetContainer(PyObject * /*self*/, PyObject* args) Container *container = NULL; if (autoselect) { //autoselect works only with piles Map *map = actor->GetCurrentArea(); + if (!map) { + return RuntimeError("No current area!"); + } //GetContainer should create an empty container container = map->GetPile(actor->Pos); } else { @@ -5722,6 +5725,9 @@ static PyObject* GemRB_GetContainerItem(PyObject * /*self*/, PyObject* args) GET_ACTOR_GLOBAL(); Map *map = actor->GetCurrentArea(); + if (!map) { + return RuntimeError("No current area!"); + } container = map->TMap->GetContainer(actor->Pos, IE_CONTAINER_PILE); } else { container = core->GetCurrentContainer(); @@ -5779,14 +5785,17 @@ static PyObject* GemRB_ChangeContainerItem(PyObject * /*self*/, PyObject* args) if (globalID) { if (globalID > 1000) { - actor = game->GetActorByGlobalID( globalID ); - } else { - actor = game->FindPC( globalID ); - } - if (!actor) { - return RuntimeError( "Actor not found!\n" ); - } + actor = game->GetActorByGlobalID( globalID ); + } else { + actor = game->FindPC( globalID ); + } + if (!actor) { + return RuntimeError( "Actor not found!\n" ); + } Map *map = actor->GetCurrentArea(); + if (!map) { + return RuntimeError("No current area!"); + } container = map->TMap->GetContainer(actor->Pos, IE_CONTAINER_PILE); } else { actor = core->GetFirstSelectedPC(false); @@ -7386,9 +7395,12 @@ static PyObject* GemRB_DragItem(PyObject * /*self*/, PyObject* args) CREItem* si; if (Type) { Map *map = actor->GetCurrentArea(); + if (!map) { + return RuntimeError("No current area!"); + } Container *cc = map->GetPile(actor->Pos); if (!cc) { - return RuntimeError( "No current container" ); + return RuntimeError( "No current container!" ); } si = cc->RemoveItem(Slot, Count); } else { @@ -7460,9 +7472,12 @@ static PyObject* GemRB_DropDraggedItem(PyObject * /*self*/, PyObject* args) if (Slot==-2) { Map *map = actor->GetCurrentArea(); + if (!map) { + return RuntimeError("No current area!"); + } Container *cc = map->GetPile(actor->Pos); if (!cc) { - return RuntimeError( "No current container" ); + return RuntimeError( "No current container!" ); } CREItem *si = core->GetDraggedItem(); res = cc->AddItem(si); ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |