Some more safety checks and the first room's background can be seen

svn-id: r28204
This commit is contained in:
Sven Hesse 2007-07-25 21:02:30 +00:00
parent 99a707d89e
commit e151167dd8
4 changed files with 11 additions and 1 deletions

View File

@ -1698,6 +1698,9 @@ void Goblin::playSounds(Mult::Mult_Object *obj) {
int16 sndSlot;
int16 frame;
if (!obj->goblinStates)
return;
animData = obj->pAnimData;
for (int i = 1; i <= obj->goblinStates[animData->state][0].dataCount; i++) {

View File

@ -115,6 +115,9 @@ void Goblin_v3::placeObject(Gob_Object *objDesc, char animated,
Mult::Mult_Object &obj = _vm->_mult->_objects[index];
Mult::Mult_AnimData &objAnim = *(obj.pAnimData);
if (!obj.goblinStates)
return;
if ((state != -1) && (obj.goblinStates[state] != 0)) {
if (state == 8)
objAnim.curLookDir = 0;

View File

@ -1705,6 +1705,10 @@ bool Inter_v1::o1_capturePush(OpFuncParams &params) {
top = _vm->_parse->parseValExpr();
width = _vm->_parse->parseValExpr();
height = _vm->_parse->parseValExpr();
if ((width < 0) || (height < 0))
return false;
_vm->_game->capturePush(left, top, width, height);
(*_vm->_scenery->_pCaptureCounter)++;
return false;

View File

@ -320,7 +320,7 @@ void Scenery::updateStatic(int16 orderFrom, byte index, byte layer) {
int16 top;
int16 bottom;
if (layer >= _statics[index].layersCount)
if ((index >= 10) || layer >= _statics[index].layersCount)
return;
layerPtr = &_statics[index].layers[layer];