mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
BLADERUNNER: Check for recoil jitter
Check if on actor click and on item click This is the original's behavior too
This commit is contained in:
parent
2362e857a7
commit
5d5fb34aa1
@ -1865,7 +1865,7 @@ void BladeRunnerEngine::handleMouseClickItem(int itemId, bool buttonDown) {
|
||||
_isInsideScriptItem = false;
|
||||
}
|
||||
} else {
|
||||
if (!buttonDown || !_items->isTarget(itemId) /* || _mouse->isRandomized() */) {
|
||||
if (!buttonDown || !_items->isTarget(itemId) || _mouse->isRandomized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1933,7 +1933,7 @@ void BladeRunnerEngine::handleMouseClickActor(int actorId, bool mainButton, bool
|
||||
}
|
||||
} else {
|
||||
Actor *actor = _actors[actorId];
|
||||
if (!_combat->isActive() || actorId == kActorMcCoy || !actor->isTarget() || actor->isRetired() /*|| _mouse->isRandomized()*/) {
|
||||
if (!_combat->isActive() || actorId == kActorMcCoy || !actor->isTarget() || actor->isRetired() || _mouse->isRandomized()) {
|
||||
return;
|
||||
}
|
||||
_playerActor->stopWalking(false);
|
||||
|
@ -442,6 +442,11 @@ void Mouse::tick(int x, int y) {
|
||||
setCursor(cursorId);
|
||||
}
|
||||
|
||||
// This method checks if jitter (due to gun recoil) is currently ongoing
|
||||
bool Mouse::isRandomized() const {
|
||||
return _randomCountdownX > 0 || _randomCountdownY > 0;
|
||||
}
|
||||
|
||||
bool Mouse::isInactive() const {
|
||||
return _cursor == 6 || _cursor == 8 || _cursor == 10;
|
||||
}
|
||||
|
@ -68,6 +68,7 @@ public:
|
||||
void updateCursorFrame();
|
||||
|
||||
void tick(int x, int y);
|
||||
bool isRandomized() const;
|
||||
bool isInactive() const;
|
||||
|
||||
// private:
|
||||
|
Loading…
Reference in New Issue
Block a user