azerothcore / mod-npc-talent-template

Template NPC (gear, talents)
http://azerothcore.org/
10 stars 34 forks source link

fix: there's no templates for % specialization yet, closes #39 #40

Closed Diablosstars closed 1 year ago

Diablosstars commented 2 years ago

All SQL calls were Querying the data base with the %s literals within the query. With FMT, changing to '{}' allows for the variables to be formatted into the strings for all queries.

closes #39

Helias commented 2 years ago

Thanks for your PR, please, fix this error

[ 21%] Building CXX object src/server/game/CMakeFiles/game.dir/AI/CreatureAIRegistry.cpp.o
/home/runner/work/mod-npc-talent-template/mod-npc-talent-template/modules/mod-npc-talent-template/src/TemplateNPC.cpp:936:109: fatal error: data argument not used by format string [-Wformat-extra-args]
            player->GetSession()->SendAreaTriggerMessage("There's no templates for {} specialization yet.", playerSpecStr.c_str());
                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
1 error generated.
make[2]: *** [modules/CMakeFiles/modules.dir/build.make:90: modules/CMakeFiles/modules.dir/mod-npc-talent-template/src/TemplateNPC.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1508: modules/CMakeFiles/modules.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
AnchyDev commented 2 years ago

Thanks for your PR, please, fix this error

[ 21%] Building CXX object src/server/game/CMakeFiles/game.dir/AI/CreatureAIRegistry.cpp.o
/home/runner/work/mod-npc-talent-template/mod-npc-talent-template/modules/mod-npc-talent-template/src/TemplateNPC.cpp:936:109: fatal error: data argument not used by format string [-Wformat-extra-args]
            player->GetSession()->SendAreaTriggerMessage("There's no templates for {} specialization yet.", playerSpecStr.c_str());
                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
1 error generated.
make[2]: *** [modules/CMakeFiles/modules.dir/build.make:90: modules/CMakeFiles/modules.dir/mod-npc-talent-template/src/TemplateNPC.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1508: modules/CMakeFiles/modules.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

There is the incorrect assumption that SendAreaTrigger uses fmt::format, however it uses vsnprinf. Reverting the change for those calls should fix the issue. I have created a pull request on the Diablosstars branch.

Helias commented 2 years ago

thanks for the PR!

EricksOliveira commented 1 year ago

Tested and it's ok

Helias commented 1 year ago

The build is failing here, if this issue will be fixed I can merge the PR

/home/runner/work/mod-npc-talent-template/mod-npc-talent-template/modules/mod-npc-talent-template/src/TemplateNPC.cpp:936:109: fatal error: data argument not used by format string [-Wformat-extra-args]
            player->GetSession()->SendAreaTriggerMessage("There's no templates for {} specialization yet.", playerSpecStr.c_str());
                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
1 error generated.
make[2]: *** [modules/CMakeFiles/modules.dir/build.make:90: modules/CMakeFiles/modules.dir/mod-npc-talent-template/src/TemplateNPC.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1217: modules/CMakeFiles/modules.dir/all] Error 2
AnchyDev commented 1 year ago

The build is failing here, if this issue will be fixed I can merge the PR

/home/runner/work/mod-npc-talent-template/mod-npc-talent-template/modules/mod-npc-talent-template/src/TemplateNPC.cpp:936:109: fatal error: data argument not used by format string [-Wformat-extra-args]
            player->GetSession()->SendAreaTriggerMessage("There's no templates for {} specialization yet.", playerSpecStr.c_str());
                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
1 error generated.
make[2]: *** [modules/CMakeFiles/modules.dir/build.make:90: modules/CMakeFiles/modules.dir/mod-npc-talent-template/src/TemplateNPC.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1217: modules/CMakeFiles/modules.dir/all] Error 2

Still waiting on my PR merge on his branch that fixes this issue. If anybody would like to create a new PR with his changes and then cherry pick mine go ahead.

Helias commented 1 year ago

done https://github.com/azerothcore/mod-npc-talent-template/pull/43

I am closing this PR