Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
4706229
Move Events methods to namespace
ramon-bernardo May 19, 2024
b90be76
Rename classname
ramon-bernardo May 19, 2024
197d007
Fix
ramon-bernardo May 20, 2024
349cd8c
Run unit tests with vcpkg (#4695)
ranisalt May 21, 2024
98c55fa
Docker Build failing (workflow) (#4696)
EvilHero90 May 21, 2024
ea0083a
Revert "Docker Build failing (workflow) (#4696)" (#4700)
ranisalt May 21, 2024
ac4f939
Fix Dockerfile copying executable (#4699)
ranisalt May 22, 2024
dd63567
Refactor Docker image workflow with docker actions (#4701)
ranisalt May 22, 2024
bc62acb
Fix docker registry in workflow (#4702)
ranisalt May 22, 2024
52896ab
Add package write permission to docker-image job (#4703)
ranisalt May 22, 2024
ea59250
Annotations & Linter including luascript.cpp functions (#4672)
EvilHero90 May 22, 2024
a271374
Use repository name when uploading Docker image (#4704)
ranisalt May 23, 2024
4789ce0
Simplify logic to select Lua interpreter (#4576)
ranisalt May 23, 2024
33e9698
Fix bank NPC overflow protection being bypassed (#4693)
glecko May 26, 2024
187a517
Use Guild shared_ptr instead of raw pointers (#4682)
ramon-bernardo May 26, 2024
5601a62
Split game core into different files (#4705)
ramon-bernardo May 26, 2024
ce0cc0c
Remove Ubuntu build workflow (#4707)
ranisalt May 26, 2024
b85757f
Fix LuaJIT flag in CMake configuration (#4711)
ranisalt May 26, 2024
55c0462
Move static LuaScriptInterface methods to namespace (#4675)
ranisalt May 27, 2024
4f90414
actions: Add CodeQL back (#4712)
DSpeichert May 27, 2024
4407756
Add vcpkg baseline update workflow on cron schedule (#4679)
ranisalt May 28, 2024
93f375f
Event callbacks fixes (#4713)
reyaleman May 29, 2024
4a89502
[Revscriptsys] RevNpcSys version 1.0 (lua npcs / NpcType / new npc sy…
EvilHero90 May 30, 2024
60dcd1c
Templates Update (Bug, Feature, Compilation Error) (#4715)
EvilHero90 May 31, 2024
ceb2a07
Minimal HTTP login server (#4706)
ranisalt May 31, 2024
419620b
Http login missing VS Project Include files and login problem when on…
EvilHero90 Jun 1, 2024
855cd3b
Set correct minimum dependency versions (#4720)
ranisalt Jun 2, 2024
dc91b3d
Fix CodeQL to run only once per workflow (#4721)
ranisalt Jun 2, 2024
75cefe8
Fix GitHub workflow syntax error (#4723)
EvilHero90 Jun 3, 2024
262652b
[bugfix] default duration on decaying items with no min or maxvalue s…
Coldensjo Jun 3, 2024
e9b6383
[bugfix] fixes bug when player asks banker to "withdraw" "x" (#4732)
Coldensjo Jun 4, 2024
3d7c2fe
Fix use-after-free in creature conditions (#4726)
diath Jun 4, 2024
e3cae60
[bugfix] make it so that 1% resistance correctly reduces damage taken…
Coldensjo Jun 5, 2024
e80e408
Fix MySQL handle leak (#4722)
ranisalt Jun 5, 2024
553c79a
Compilation Error issue template update (#4736)
EvilHero90 Jun 5, 2024
ac84e26
[Revnpcsys] Revisioned Npc System v1.1 (#4724)
EvilHero90 Jun 5, 2024
d8e58ee
Fix default database version (#4737)
ranisalt Jun 5, 2024
0986419
The Forgotten Server 1.6 (#4718)
EvilHero90 Jun 5, 2024
28a58ec
Fix paths in release action (#4738)
ranisalt Jun 6, 2024
c677f03
The Forgotten Server 1.7 Development (#4719)
EvilHero90 Jun 6, 2024
3ba9e67
Fix some warnings and improve type annotations (#4740)
danyelvarejao Jun 6, 2024
c5426f0
[Revnpcsys] Revisioned Npc System v1.2 (#4741)
EvilHero90 Jun 7, 2024
fdd48c3
[Revscriptsys] fixing memory leak in Actions & Moveevents (#4742)
EvilHero90 Jun 8, 2024
7011488
Added missing default dependencies for using vcpkg manifest (#4735)
Codinablack Jun 9, 2024
d59a5cb
[Revscriptsys] fix crash introduced in #4742 (#4750)
EvilHero90 Jun 10, 2024
404f369
fix session table in schema (#4745)
ArturKnopik Jun 12, 2024
00f4400
Fix creature icons (#4746)
ArturKnopik Jun 13, 2024
a490b34
[Revnpcsys] Revisioned Npc System v1.3 (#4747)
EvilHero90 Jun 13, 2024
48352f6
Remove g_bans global (#4757)
ranisalt Jun 23, 2024
a2b24a4
Remove Account class and account.h file (#4730)
ranisalt Jun 28, 2024
98ff8a8
Fix NPC baseSpeed & build issue (AccountType_t) (#4763)
xmish Jul 3, 2024
d11bf08
Move Events methods to namespace
ramon-bernardo May 19, 2024
fc8d0c6
Fix
ramon-bernardo May 20, 2024
6d7a18c
Merge branch 'events-namespace' of https://github.com/ramon-bernardo/…
ramon-bernardo Jul 6, 2024
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
8 changes: 3 additions & 5 deletions src/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

extern Game g_game;
extern Weapons* g_weapons;
extern Events* g_events;

std::vector<Tile*> getList(const MatrixArea& area, const Position& targetPos, const Direction dir)
{
Expand Down Expand Up @@ -260,8 +259,7 @@ ReturnValue Combat::canDoCombat(Creature* caster, Tile* tile, bool aggressive)
if (aggressive && tile->hasFlag(TILESTATE_PROTECTIONZONE)) {
return RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE;
}

return g_events->eventCreatureOnAreaCombat(caster, tile, aggressive);
return tfs::events::creature::onAreaCombat(caster, tile, aggressive);
Copy link
Contributor Author

@ramon-bernardo ramon-bernardo May 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still unsure whether to use tfs::events or tfs::game::events. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tfs::events

}

bool Combat::isInPvpZone(const Creature* attacker, const Creature* target)
Expand Down Expand Up @@ -290,7 +288,7 @@ bool Combat::isProtected(const Player* attacker, const Player* target)
ReturnValue Combat::canDoCombat(Creature* attacker, Creature* target)
{
if (!attacker) {
return g_events->eventCreatureOnTargetCombat(attacker, target);
return tfs::events::creature::onTargetCombat(attacker, target);
}

if (const Player* targetPlayer = target->getPlayer()) {
Expand Down Expand Up @@ -369,7 +367,7 @@ ReturnValue Combat::canDoCombat(Creature* attacker, Creature* target)
}
}
}
return g_events->eventCreatureOnTargetCombat(attacker, target);
return tfs::events::creature::onTargetCombat(attacker, target);
}

void Combat::setPlayerCombatValues(formulaType_t formulaType, double mina, double minb, double maxa, double maxb)
Expand Down
6 changes: 3 additions & 3 deletions src/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ double Creature::speedC = -4795.01;

extern Game g_game;
extern CreatureEvents* g_creatureEvents;
extern Events* g_events;

Creature::Creature() { onIdleStatus(); }

Expand Down Expand Up @@ -513,7 +512,7 @@ void Creature::onCreatureMove(Creature* creature, const Tile* newTile, const Pos
}

if (newTile->getZone() != oldTile->getZone()) {
g_events->eventCreatureOnChangeZone(this, oldTile->getZone(), newTile->getZone());
tfs::events::creature::onChangeZone(this, oldTile->getZone(), newTile->getZone());
onChangeZone(getZone());
}

Expand Down Expand Up @@ -1684,7 +1683,8 @@ void Creature::setStorageValue(uint32_t key, std::optional<int32_t> value, bool
} else {
storageMap.erase(key);
}
g_events->eventCreatureOnUpdateStorage(this, key, oldValue, value, isSpawn);

tfs::events::creature::onUpdateStorage(this, key, oldValue, value, isSpawn);
}

std::optional<int32_t> Creature::getStorageValue(uint32_t key) const
Expand Down
Loading