Comments (4)
Yeah, it's very interesting bug. I'm not very familiar with the hero movement animation logic in AI::HeroesMove()
, but it seems that in this case it advances the hero's sprite_index
too much, and it causes extra movement in the Heroes::MoveStep()
method which normally shouldn't happen (because MP2::OBJ_COAST
for the hero on the water is an object that needs to be interacted with while being next to it, not on it). sprite_index
eventually becomes 17 before the last step, which causes makeStep( true )
to be ultimately called at line 279 here:
fheroes2/src/fheroes2/heroes/heroes_move.cpp
Lines 258 to 290 in cbe1879
which normally shouldn't be, because currentHeroFrameIndex
should become 0 before accessing objects that need to be interacted with while being next to them (i.e. hero should be in "standing" state near these objects) - in this case isNeedStayFrontObject()
check at line 260 should do its job and hero will interact with the coast object properly. This is how this looks like (in the step-by-step mode):
fheroes2.engine.version_.1.0.12.2024-02-29.22-28-30.mp4
Hi @ihhub since I am not very familiar with the implementation of the animation for the AI-controlled heroes, are there any tips on how to fix this in the "right" way? Can this happen to human-controlled heroes under some circumstances? Could you please take a look as soon as you have time for that?
from fheroes2.
Sure. I will take a look.
from fheroes2.
Hi @kuuff , can you try a build from #8450 ?
from fheroes2.
@ihhub, yeah, I tried, it fixes the issue, it doesn't crash. Great work!
from fheroes2.
Related Issues (20)
- Town Population screen (with the well), "Recruit Creatures" window, display in brackets the remaining quantity of resources and gold
- Combat screen, the number displayed for lightning spells damage is incorrect when the opponent has the Lightning Helm artifact HOT 9
- Combat screen, Captured Artifact window, artifact is displayed only once when opposing hero has two copies of the same artifact HOT 3
- Magic Book, spell points bookmark right-click information window, add the maximum number of spell points
- New feature: add maps downloading script into release HOT 2
- Support more controller buttons on Switch HOT 1
- Ore (and possibly all other resources) are incorrectly shown on the map. HOT 3
- The Editor doesn't check objects while placing a castle
- [Interface] Color-Coded Interface (ala Heroes III) HOT 1
- Translate all cyrilic to latin alphabet HOT 1
- Add HD-mod to roadmap HOT 3
- Map editor, crash while creating a message with space and a new line
- Share artifacts, army, exchange castle/town HOT 1
- Random type of class - Magic or Might HOT 1
- 'Replay Opponent Turn' New Button HOT 1
- Ctrl to see enemy creature range HOT 1
- [Scenario Editor] Prohibit the positioning of the ultimate artifact near an edge of the adventure map with the 9 squares rule of the original game
- Game, harmonize the positioning order of resource sprites in the game's various windows and screens
- Android mouse map movement move mouse to edges should scroll HOT 2
- [Scenario Editor] Graphics of the hero's secondary skills should be displayed in the hero's screen
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fheroes2.