diff options
| -rw-r--r-- | scumm/actor.cpp | 13 | ||||
| -rw-r--r-- | scumm/actor.h | 2 | ||||
| -rw-r--r-- | scumm/script_v2.cpp | 8 | 
3 files changed, 20 insertions, 3 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 2daa42f3c1..92bbabcf0d 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -631,7 +631,7 @@ AdjustBoxResult Actor::adjustXYToBeInBox(int dstX, int dstY) {  			flags = _vm->getBoxFlags(box);  			// Skip over invisible boxes -			if (flags & kBoxInvisible && !(flags & kBoxPlayerOnly && !isInClass(kObjectClassPlayer))) +			if (flags & kBoxInvisible && !(flags & kBoxPlayerOnly && !isPlayer()))  				continue;  			// For increased performance, we perform a quick test if @@ -1392,7 +1392,7 @@ void Actor::walkActorOld() {  		// FIXME: not sure if this is needed in non-Zak games, but I think it shouldn't  		// hurt there either.  		int flags = _vm->getBoxFlags(next_box); -		if (flags & kBoxLocked && !(flags & kBoxPlayerOnly && !isInClass(kObjectClassPlayer))) { +		if (flags & kBoxLocked && !(flags & kBoxPlayerOnly && !isPlayer())) {  			moving |= MF_LAST_LEG;  			return;  		} @@ -1526,3 +1526,12 @@ void Actor::classChanged(int cls, bool value) {  bool Actor::isInClass(int cls) {  	return _vm->getClass(number, cls);  } + +bool Actor::isPlayer() { +	if (_vm->_features & GF_AFTER_V2) +		return _vm->VAR(42) <= number && number <= _vm->VAR(43); +	else +		return isInClass(kObjectClassPlayer); +} + + diff --git a/scumm/actor.h b/scumm/actor.h index 87a7e48110..7cf3d80af8 100644 --- a/scumm/actor.h +++ b/scumm/actor.h @@ -193,6 +193,8 @@ public:  protected:  	bool isInClass(int cls); +	 +	bool isPlayer();  };  #endif diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index af3a6f318f..3fec9ace99 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -1006,7 +1006,7 @@ void Scumm_v2::o2_walkActorToObject() {  	a = derefActorSafe(getVarOrDirectByte(0x80), "o2_walkActorToObject");  	assert(a); -	obj = getVarOrDirectByte(0x40); +	obj = getVarOrDirectWord(0x40);  	if (whereIsObject(obj) != WIO_NOT_FOUND) {  		int x, y, dir;  		getObjectXYPos(obj, x, y, dir); @@ -1191,6 +1191,9 @@ void Scumm_v2::o2_cutscene() {  	VAR(VAR_CURSORSTATE) = 200;  	// TODO: some cursor command stuff (hide mouse etc maybe?) +	freezeScripts(0); +	_userPut = 0; +	_cursor.state = 0;  	_sentenceNum = 0;  	stopScript(SENTENCE_SCRIPT); @@ -1211,6 +1214,9 @@ void Scumm_v2::o2_endCutscene() {  	VAR(VAR_CURSORSTATE) = vm.cutSceneData[1];  	// TODO: some cursor command stuff (probably to reset it to the pre-cutscene state) +	unfreezeScripts(); +	_userPut = 1; +	_cursor.state = 1;  	if (_gameId == GID_MANIAC) {  		camera._mode = (byte) vm.cutSceneData[3];  | 
