示例#1
0
void SpawnShell::killSpawn(const newCorpseStruct* deadspawn)
{
#ifdef SPAWNSHELL_DIAG
   printf("SpawnShell::killSpawn(id=%d, kid=%d)\n", 
	  deadspawn->spawnId, deadspawn->killerId);
#endif
   Item* item;
   Item* killer;

   item = m_spawns.find(deadspawn->spawnId);
   if (item != NULL)
   {
     Spawn* spawn = (Spawn*)item;
     killer = m_spawns.find(deadspawn->killerId);

     // ZBTEMP: This is temporary until we can find a better way
     // set the last kill info on the player (do this before changing name)
     m_player->setLastKill(spawn->name(), spawn->level());

     spawn->killSpawn();
     updateFilterFlags(item);
     updateRuntimeFilterFlags(item);
     emit killSpawn(item, killer, deadspawn->killerId);

     if (item->filterFlags() & FILTER_FLAG_ALERT)
       emit handleAlert(item, tKillSpawn);
   }
}
示例#2
0
void SpawnShell::corpseLoc(const corpseLocStruct* corpseLoc)
{
  Item* item = m_spawns.find(corpseLoc->spawnId);
  if (item != NULL)
  {
    Spawn* spawn = (Spawn*)item;

    // set the corpses location, and make sure it's not moving... 
    spawn->setPos(int16_t(corpseLoc->x), int16_t(corpseLoc->y), 
		  int16_t(corpseLoc->z),
		  showeq_params->walkpathrecord,
		  showeq_params->walkpathlength);
    spawn->killSpawn();
    spawn->updateLast();
    spawn->updateLastChanged();
    
    // signal that the spawn has changed
    emit killSpawn(item, NULL, 0);
  }
}