Dionizy
New Member
- Joined
- Mar 18, 2018
- Messages
- 15
- Reaction score
- 0
I'm changing distance shoot system a lot and I want accuracy to be different depending on if you're attacking a player or a monster. I checked how it's done in LUA and tried to replicate it in C++.
I always get the
error. How to access a protected class member in this context?
C++:
int AUTOID_PLAYERS = 0x10000000;
int AUTOID_MONSTERS = 0x40000000;
int AUTOID_NPCS = 0x80000000 ;
//isMonster
if((target->id >= AUTOID_MONSTERS) && (target->id < AUTOID_NPCS))
{
chance = skillmodpve;
}
//isPlayer
if((target->id >= AUTOID_PLAYERS) && (target->id < AUTOID_MONSTERS))
{
if (targetflee >= skillmodpvp)
{
chance = 1;
}
else
chance = skillmodpvp - targetflee;
}
Code:
`uint32_t Creature::id' is protected