|
Before you get the attack, you get the player/mob appear packet.
Use a std::map<int,whatever> - > first argument is then the id of the mob/player..
Just store the value which type it is.
you can access it like this
if(map.find(pid) != map.end()) {
map[pid].type(or whatever... if you make a std::map<int,int> map you can access it without an extra extension ..map[pid])
}
Then on the attack packet, just check for the type.
|