- bool CPlayer::VisiblityList( )
- {
- std::vector<CPlayer*> newVisiblePlayers;
- std::vector<CDrop*> newVisibleDrops;
- //LMATEST
- //std::vector<CMonster*> newVisibleMonsters;
- std::vector<unsigned int> newVisibleMonsters;
- std::vector<CNPC*> newVisibleNPCs;
- // Clients
- CMap* map = GServer->MapList.Index[Position->Map];
- for(UINT i=0;i<map->PlayerList.size();i++)
- {
- CPlayer* otherclient = map->PlayerList.at(i);
- if ( this==otherclient || !otherclient->Session->inGame)
- {
- continue;
- }
- float distance = GServer->distance( this->Position->current, otherclient->Position->current );
- if ( GServer->IsVisible( this, otherclient ) )
- {
- //LMA: now invisible players are just usual users.
- //if ( distance < MAXVISUALRANGE && !otherclient->isInvisibleMode )
- if ( distance < MAXVISUALRANGE)
- {
- newVisiblePlayers.push_back( otherclient );
- }
- else
- {
- ClearObject( otherclient->clientid );
- }
- }
- else
- {
- //LMA: now invisible players are just usual users.
- //if ( distance < MINVISUALRANGE && !otherclient->isInvisibleMode )
- if ( distance < MINVISUALRANGE)
- {
- newVisiblePlayers.push_back( otherclient );
- otherclient->SpawnToPlayer(this, otherclient);
- }
- }
- }
- // Monsters
- bool monster_seen=false;
- int bon_sp_mp=0;
- int bon_sp_hp=0;
- int bon_nb_mp=0;
- int bon_nb_hp=0;
- for(UINT i=0;i<map->MonsterList.size();i++)
- {
- CMonster* thismon = map->MonsterList.at( i );
- float distance = GServer->distance ( this->Position->current, thismon->Position->current );
- monster_seen=false;
- if ( GServer->IsVisible( this, thismon ) )
- {
- if (distance < MAXVISUALRANGE )
- {
- //LMATEST
- //newVisibleMonsters.push_back( thismon );
- newVisibleMonsters.push_back( thismon->clientid );
- monster_seen=true;
- }
- else
- {
- ClearObject( thismon->clientid );
- }
- }
- else
- {
- if ( distance< MINVISUALRANGE )
- {
- //LMATEST
- //newVisibleMonsters.push_back( thismon );
- newVisibleMonsters.push_back( thismon->clientid );
- thismon->SpawnMonster(this, thismon );
- monster_seen=true;
- }
- }
- }
- //LMA: bonus from bonfires / salamender. (all done by AIP now)
- //One update so we divide if several bonuses
- //regen will be updated faster, that's all.
- nb_mp=bon_nb_mp;
- nb_hp=bon_nb_hp;
- sp_hp=bon_sp_hp;
- sp_mp=bon_sp_mp;
- //Log(MSG_INFO,"SIP %i,%i,%i,%i",nb_mp,nb_hp,sp_hp,sp_mp);
There are frequent instances that an INVISIBLE mob is attacking the players.
There are spawns that is invisible to the player, if you cast aoe in that spawn area, that spawn will attack you - (or die if its weak) - however you won't see any mobs attacking - yet you get damaged over time.
Also, I've experience it myself that if you run away from the previous mob you are attacking, and go far away to make it vanish and clear the battle - if you go back to that spot where it spawn/is spawning you won't see that mob anymore, and you'll start getting damaged if its aggressive.
This fixes in relog.
Another observation is that when a player is already attacking a mob, and you just arrived in the spot you won't see the mob even if you relog, you just see them standing there, but the real thing is that they are on battle.
Sometimes the players even disappear.