Beispiel #1
0
void SpawnShell::newDoorSpawn(const doorStruct* d)
{
#ifdef SPAWNSHELL_DIAG
   printf("SpawnShell::newDoorSpawn(doorStruct*)\n");
#endif
   Item* item = m_doors.find(d->doorId);
   if (item != NULL)
   {
     Door* door = (Door*)item;
     door->update(d);
     updateFilterFlags(door);
     item->updateLastChanged();
     emit changeItem(door, tSpawnChangedALL);
   }
   else
   {
     item = (Item*)new Door(d);
     updateFilterFlags(item);
     m_doors.insert(d->doorId, item);
     emit addItem(item);
   }

   if (item->filterFlags() & FILTER_FLAG_ALERT)
     emit handleAlert(item, tNewSpawn);
}
Beispiel #2
0
void SpawnShell::newDoorSpawn(const doorStruct& d, size_t len, uint8_t dir)
{
#ifdef SPAWNSHELL_DIAG
   seqDebug("SpawnShell::newDoorSpawn(doorStruct*)");
#endif
   Item* item = m_doors.find(d.doorId);
   if (item != NULL)
   {
     Door* door = (Door*)item;
     door->update(&d);
     if (!showeq_params->fast_machine)
        item->setDistanceToPlayer(m_player->calcDist2DInt(*item));
     else
        item->setDistanceToPlayer(m_player->calcDist(*item));
     updateFilterFlags(door);
     item->updateLastChanged();
     emit changeItem(door, tSpawnChangedALL);
   }
   else
   {
     item = (Item*)new Door(&d);
     if (!showeq_params->fast_machine)
        item->setDistanceToPlayer(m_player->calcDist2DInt(*item));
     else
        item->setDistanceToPlayer(m_player->calcDist(*item));
     updateFilterFlags(item);
     m_doors.insert(d.doorId, item);
     emit addItem(item);
   }
}
Beispiel #3
0
void SpawnShell::newDoorSpawn(const doorStruct* d, uint32_t len, uint8_t dir)
{
#ifdef SPAWNSHELL_DIAG
    printf("SpawnShell::newDoorSpawn(doorStruct*)\n");
#endif
    Item* item = m_doors.find(d->doorId);
    if (item != NULL)
    {
        Door* door = (Door*)item;
        door->update(d);
        if (!showeq_params->fast_machine)
            item->setDistanceToPlayer(m_player->calcDist2DInt(*item));
        else
            item->setDistanceToPlayer(m_player->calcDist(*item));
        updateFilterFlags(door);
        item->updateLastChanged();
        emit changeItem(door, tSpawnChangedALL);
    }
    else
    {
        item = (Item*)new Door(d);
        if (!showeq_params->fast_machine)
            item->setDistanceToPlayer(m_player->calcDist2DInt(*item));
        else
            item->setDistanceToPlayer(m_player->calcDist(*item));
        updateFilterFlags(item);
        m_doors.insert(d->doorId, item);
        emit addItem(item);
    }

    if (item->filterFlags() & FILTER_FLAG_ALERT)
        emit handleAlert(item, tNewSpawn);
}