Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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).
- Fixed: GCC and Apple Clang toolchain not correctly applying sanitizers (if enabled via CMake).
8 changes: 4 additions & 4 deletions src/game/CPathFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<CPathFinderPoint*>& AdjacentCellsRefList )
Expand Down
3 changes: 2 additions & 1 deletion src/game/CServerConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
};

/**
Expand Down
14 changes: 14 additions & 0 deletions src/game/chars/CCharNotoriety.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions src/sphere.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down