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)
- Castle screen, upgraded and regular mausoleums have different alignment HOT 1
- AI heroes must be able to jump into uncovered fog while using Dimension Door HOT 2
- Battle screen, auto combat disabling dialog refers to "battle", not "combat HOT 8
- Archery skill, missing description for shooting without obstacle penalty
- Sorceress castle, Rainbow sprite enhancement HOT 1
- Sorceress town screen, fixing sky flaws HOT 3
- Combat, functioning of genie ability and damage display HOT 2
- Combat screen, the paladin troop corpse sprite is displayed over the bone dragon troop creature count indicator
- Crash when selecting Roland hero in final Roland campaign map and he has empty carry over army HOT 10
- Combat screen, phoenix troop number indicator is not updated before the phoenix troop attacks
- Innoextract needed for fheroes2-extract-resources script on macOS HOT 3
- Adventure map, the rapid change of focus on the heroes appears to be like a graphical flaw HOT 4
- Roland campaign mission 7, shipyard cant build ship HOT 1
- Improved ally behavior
- Adventure map, AI should not capture bottle objects on the ocean HOT 5
- Adventure map, AI behavior, red AI player's hero Luna zip zap on the adventure map with dimension door and town gate spells (1.0.12 8369)
- Combat, AI behavior, red AI player's hero Luna wastes spell points for nothing with the resurrect spell (1.0.12 8369)
- Meeting screen, hero's necromancy level is incorrectly displayed in the meeting screen with the Spade of Necromancy artifact HOT 1
- Kingdom Overview screen, type of creatures available for recruitment is not updated when a dwelling is built in the castle
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.