mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
Fixed two bugs.
Putting items back to the inventory into clipped coordinates, and exiting running GPL2 programs when the game engine it to be interrupted. svn-id: r45822
This commit is contained in:
parent
6a9024b1e3
commit
9ba6e8138c
@ -222,6 +222,7 @@ void DraciEngine::handleEvents() {
|
||||
case Common::EVENT_QUIT:
|
||||
case Common::EVENT_RTL:
|
||||
_game->setQuit(true);
|
||||
_script->endCurrentProgram(true);
|
||||
break;
|
||||
case Common::EVENT_KEYDOWN:
|
||||
switch (event.kbd.keycode) {
|
||||
|
@ -24,6 +24,7 @@
|
||||
*/
|
||||
|
||||
#include "common/stream.h"
|
||||
#include "common/util.h"
|
||||
|
||||
#include "draci/draci.h"
|
||||
#include "draci/game.h"
|
||||
@ -332,12 +333,12 @@ void Game::handleInventoryLoop() {
|
||||
// Otherwise, if we are holding an item, try to place it inside the
|
||||
// inventory
|
||||
} else if (_currentItem) {
|
||||
const int column = scummvm_lround(
|
||||
const int column = CLIP(scummvm_lround(
|
||||
(_vm->_mouse->getPosX() - kInventoryX + kInventoryItemWidth / 2.) /
|
||||
kInventoryItemWidth) - 1;
|
||||
const int line = scummvm_lround(
|
||||
kInventoryItemWidth) - 1, 0L, (long) kInventoryColumns - 1);
|
||||
const int line = CLIP(scummvm_lround(
|
||||
(_vm->_mouse->getPosY() - kInventoryY + kInventoryItemHeight / 2.) /
|
||||
kInventoryItemHeight) - 1;
|
||||
kInventoryItemHeight) - 1, 0L, (long) kInventoryLines - 1);
|
||||
const int index = line * kInventoryColumns + column;
|
||||
putItem(_currentItem, index);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user