View Full Version : [SOLVED] Compile Error

08-07-2014, 06:12 PM

I was working on some fix and I got compile errors:

6>C:\Users\Desktop\TrinityCore\src\server\game\Entit ies\Unit\StatSystem.cpp(1157): error C3861: 'GetPet': identifier not found
6>C:\Users\Desktop\TrinityCore\src\server\game\Entit ies\Unit\StatSystem.cpp(1162): error C2065: 'dmg_multiplier' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Entit ies\Unit\StatSystem.cpp(1164): error C2181: illegal else without matching if
6>C:\Users\Desktop\TrinityCore\src\server\game\Entit ies\Unit\StatSystem.cpp(1167): error C2065: 'dmg_multiplier' : undeclared identifier

I insert code inside StatSystem.cpp
Here is Code:

+ Pet* pet = GetPet();
+ if (IsPet())
+ {
+ if (pet->HasAura(2132322))
+ value *= 1.2f; // +20% HP
+ dmg_multiplier = 0.15f; // +15% attack power
+ else if (pet->HasAura(2312122))
+ {
+ value *= 1.2f; // +20% = 40% HP
+ dmg_multiplier = 0.15f; // +15% = 30% attack power
+ }
+ }

This is custom spell id, however I got that compile errors and I dont know how to fix it.

08-07-2014, 07:55 PM
Core tells you there is no such things as GetPet and dmg_multiplier and you failed the condition prolly because of your codestyle, if you still don't understand i'll give you the solution but take the time to understand before replying again thanks

08-07-2014, 09:10 PM
IDK realy I saw that code inside my StatSystem.cpp it's already used idk why it shows errors on this code :/

08-07-2014, 09:29 PM
I insert code inside StatSystem.cpp

I mentioned before that this isn't recommended at all and for the reasons (issues) you're having. 'GetPet()' has nothing on the left like a player pointer. Is a "player" variable anywhere? If so, it would go like "player->GetPet();". I don't know about the other stuff since there's not much to go by. As I said, applying patches like those can pretty much mess up your source.