diff --git a/Changelog.txt b/Changelog.txt index aacd42407..70bd6d4bd 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -3319,7 +3319,12 @@ Fixed: Multi type items weren't calling the @Destroy triggers when removed. (Iss -Fixed-> Removed exception for poison bottles at CClientUSe.cpp so now poison potions are handled as any other potion at CCharuse.cpp Thx Drk84 for the suggestion. I dont understand why there was that exception done. Are we missing something? +29-08-2023, Luxion +- Fixed: The issue with the Heuristic function in CPathFinder has been fixed. Now, the monsters correctly follow their targets without any problems. They are now able to effectively navigate around obstacles and move in a straight path. +Additionally, the problem of zig-zag issue following in the South direction has been addressed. +- Added: OF_EnableGuildAlignNotoriety in sphere.ini, if enabled, guilds with the same align will see each other enemies or ally. + 29-08-2023, Nolok - Fixed: (hopefully) conditional expressions parsing. - Fixed: a couple of memory deallocation bugs (could cause crash on server close). -- Fixed: GCC and Apple Clang toolchain not correctly applying sanitizers (if enabled via CMake). \ No newline at end of file +- Fixed: GCC and Apple Clang toolchain not correctly applying sanitizers (if enabled via CMake). diff --git a/src/game/CPathFinder.cpp b/src/game/CPathFinder.cpp index 4c5bdefd3..83f95183a 100644 --- a/src/game/CPathFinder.cpp +++ b/src/game/CPathFinder.cpp @@ -8,11 +8,11 @@ int CPathFinder::Heuristic(const CPathFinderPoint* Pt1, const CPathFinderPoint* Pt2) noexcept // static { - // Hexagonal heuristic (thought for a hexagonal grid, but in our case, by using this, the movements are more natural and the rotation angles more wide) - return 10*(abs(Pt1->m_x - Pt2->m_x) + abs(Pt1->m_y - Pt2->m_y)); + // Hexagonal heuristic (thought for a hexagonal grid, but in our case, by using this, the movements are more natural and the rotation angles more wide) + //return 10 * (abs(Pt1->m_x - Pt2->m_x) + abs(Pt1->m_y - Pt2->m_y)); - // Diagonal heuristic, thought for a square grid which allows movement in 8 directions from a cell (our case) - //return std::max(abs(Pt1->m_x - Pt2->m_x), abs(Pt1->m_y - Pt2->m_y)); + // Diagonal heuristic, thought for a square grid which allows movement in 8 directions from a cell (our case) + return std::max(abs(Pt1->m_x - Pt2->m_x), abs(Pt1->m_y - Pt2->m_y)); } void CPathFinder::GetAdjacentCells(const CPathFinderPoint* Point, std::deque& AdjacentCellsRefList ) diff --git a/src/game/CServerConfig.h b/src/game/CServerConfig.h index 4ffb136a1..c65f708d0 100644 --- a/src/game/CServerConfig.h +++ b/src/game/CServerConfig.h @@ -81,7 +81,8 @@ enum OF_TYPE OF_GuardOutsideGuardedArea = 0x0200000, // Allow guards to walk in unguarded areas, instead of being teleported back to their home point. OF_OWNoDropCarriedItem = 0x0400000, // When overweighted, don't drop items on ground when moving them (or using BOUNCE) and checking if you can carry them. OF_AllowContainerInsideContainer = 0x0800000, //Allow containers inside other containers even if they are heavier than the container being inserted into. - OF_VendorStockLimit = 0x01000000 // Limits how much of an item a vendor can buy using the value set in the TEMPLATE. Format: BUY=ID,AMOUNT + OF_VendorStockLimit = 0x01000000, // Limits how much of an item a vendor can buy using the value set in the TEMPLATE. Format: BUY=ID,AMOUNT + OF_EnableGuildAlignNotoriety = 0x02000000 // If enabled, guilds with the same alignment will see each other as enemy or ally. }; /** diff --git a/src/game/chars/CCharNotoriety.cpp b/src/game/chars/CCharNotoriety.cpp index 8faee42a3..dc57a7f91 100644 --- a/src/game/chars/CCharNotoriety.cpp +++ b/src/game/chars/CCharNotoriety.cpp @@ -210,6 +210,20 @@ NOTO_TYPE CChar::Noto_CalcFlag(const CChar * pCharViewer, bool fAllowIncog, bool { if (pViewerGuild && pViewerGuild->IsPrivMember(pCharViewer)) { + if (IsSetOF(OF_EnableGuildAlignNotoriety)) + { + if (pViewerGuild->GetAlignType() != STONEALIGN_STANDARD) + { + if (pViewerGuild->GetAlignType() == pMyGuild->GetAlignType()) + { + return NOTO_GUILD_SAME; + } + + return NOTO_GUILD_WAR; + + } + } + if (pViewerGuild == pMyGuild) // Same guild? return NOTO_GUILD_SAME; // return green if (pMyGuild->IsAlliedWith(pViewerGuild)) diff --git a/src/sphere.ini b/src/sphere.ini index c9cc0d5d3..141fd45fa 100644 --- a/src/sphere.ini +++ b/src/sphere.ini @@ -801,6 +801,7 @@ Experimental=0 // OF_OWNoDropCarriedItem 00400000 // When overweighted, don't drop items on ground when moving them (or using BOUNCE) and checking if you can carry them. // OF_AllowContainerInsideContainer 00800000 // Allow containers inside other containers even if they are heavier than the container being inserted into. // OF_VendorStockLimit 01000000 // Limits how much of an item a vendor can buy using the value set in the TEMPLATE. Format: BUY=ID,AMOUNT +// OF_EnableGuildAlignNotoriety 02000000 // If enabled, guilds with the same alignment will see each other as enemy or ally. OptionFlags=08|080|0200 // Area flags