Coder Social home page Coder Social logo

Comments (8)

kambala-decapitator avatar kambala-decapitator commented on May 6, 2024

seems related to monolith indeed, one more example:

Screenshot 2022-09-08 at 18 33 05
Screenshot 2022-09-08 at 18 33 20

don't have save file, unfortunately

from vcmi.

kambala-decapitator avatar kambala-decapitator commented on May 6, 2024

found an easy way to reproduce and not related to monoliths: just start RoE - Long Live the Queen campaign.

Screenshot 2022-09-16 at 21 53 24 Screenshot 2022-09-16 at 21 53 38 Screenshot 2022-09-16 at 21 53 53 Screenshot 2022-09-16 at 21 54 12 Screenshot 2022-09-16 at 21 54 27

with 2 creatures also reproducible:

Screenshot 2022-09-17 at 13 20 01 Screenshot 2022-09-17 at 13 20 14

when a single creature is left, cursor becomes correct:

Screenshot 2022-09-16 at 22 46 05

from vcmi.

kambala-decapitator avatar kambala-decapitator commented on May 6, 2024

one more way to reproduce: start AB campaign.

Screenshot 2022-09-17 at 13 43 59 Screenshot 2022-09-17 at 13 43 02 Screenshot 2022-09-17 at 13 43 14 Screenshot 2022-09-17 at 13 43 21 Screenshot 2022-09-17 at 13 43 29

from vcmi.

kambala-decapitator avatar kambala-decapitator commented on May 6, 2024

seems the bug is here:

const CGPathNode * pnode = LOCPLINT->cb->getPathsInfo(h)->getPathInfo(mapPosCopy);

pnode->action is wrong for creature tiles.

from vcmi.

kambala-decapitator avatar kambala-decapitator commented on May 6, 2024

seems I found where it got broken: 49c872e

the following simple patch fixes the issue, but I'm not sure about its consequences:

diff --git a/lib/CPathfinder.cpp b/lib/CPathfinder.cpp
index 6ae919db0..33f90bb39 100644
--- a/lib/CPathfinder.cpp
+++ b/lib/CPathfinder.cpp
@@ -862,7 +862,7 @@ void DestinationActionRule::process(
 				else
 					action = CGPathNode::BLOCKING_VISIT;
 			}
-			else if(destination.isGuardianTile)
+			else if(destination.guarded)
 				action = CGPathNode::BATTLE;
 			else if(destination.nodeObject->blockVisit && !(pathfinderConfig->options.useCastleGate && destination.nodeObject->ID == Obj::TOWN))
 				action = CGPathNode::BLOCKING_VISIT;

@nullkiller could you double-check since that's your commit?

branch with the change: https://github.com/kambala-decapitator/vcmi/tree/fix-cursor-attack

from vcmi.

kambala-decapitator avatar kambala-decapitator commented on May 6, 2024

it seems that the right fix is actually:

diff --git a/lib/CPathfinder.cpp b/lib/CPathfinder.cpp
index 6ae919db0..ceab0c5e4 100644
--- a/lib/CPathfinder.cpp
+++ b/lib/CPathfinder.cpp
@@ -392,7 +392,7 @@ void CPathfinder::calculatePaths()
 			destination.movementLeft = movement;
 			destination.cost = cost;
 			destination.updateInfo(hlp, gs);
-			destination.isGuardianTile = destination.guarded && isDestinationGuardian();
+			destination.isGuardianTile = destination.guarded || isDestinationGuardian();
 
 			for(auto rule : config->rules)
 			{

from vcmi.

kambala-decapitator avatar kambala-decapitator commented on May 6, 2024

the latter is actually wrong: such stuff becomes possible which differs from the original (although battle begins as well when you try to acquire the sawmill)
Screenshot 2022-09-21 at 11 52 08

with the former change original behavior is preserved:
Screenshot 2022-09-21 at 11 20 58

from vcmi.

kambala-decapitator avatar kambala-decapitator commented on May 6, 2024

unguarded resources can still be captured with the former change:
image

from vcmi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.