Ejemplo n.º 1
0
// same-name slots, connecting to Packet signals
void SpawnShell::newGroundItem(const makeDropStruct *d, uint32_t, uint8_t dir)
{
#ifdef SPAWNSHELL_DIAG
    printf("SpawnShell::newGroundItem(makeDropStruct *)\n");
#endif
    // if zoning, then don't do anything
    if (m_zoneMgr->isZoning())
        return;

    if (dir != DIR_SERVER)
        return;

    if (!d)
        return;

    // attempt to get the item name
    QString name;
    if (m_itemDB != NULL)
        name = m_itemDB->GetItemLoreName(d->itemNr);

    Drop* item = (Drop*)m_drops.find(d->dropId);
    if (item != NULL)
    {
        item->update(d, name);
        if (!showeq_params->fast_machine)
            item->setDistanceToPlayer(m_player->calcDist2DInt(*item));
        else
            item->setDistanceToPlayer(m_player->calcDist(*item));
        updateFilterFlags(item);
        item->updateLastChanged();
        emit changeItem(item, tSpawnChangedALL);
    }
    else
    {
        item = new Drop(d, name);
        if (!showeq_params->fast_machine)
            item->setDistanceToPlayer(m_player->calcDist2DInt(*item));
        else
            item->setDistanceToPlayer(m_player->calcDist(*item));
        updateFilterFlags(item);
        m_drops.insert(d->dropId, item);
        emit addItem(item);
    }

    if (item->filterFlags() & FILTER_FLAG_ALERT)
        emit handleAlert(item, tNewSpawn);
}
Ejemplo n.º 2
0
// same-name slots, connecting to Packet signals
void SpawnShell::newGroundItem(const makeDropStruct *d)
{
#ifdef SPAWNSHELL_DIAG
   printf("SpawnShell::newGroundItem(makeDropStruct *)\n");
#endif
  // if zoning, then don't do anything
  if (m_zoneMgr->isZoning())
    return;

  if (!d)
    return;
  
  // attempt to get the item name
  QString name;
  if (m_itemDB != NULL)
    name = m_itemDB->GetItemLoreName(d->itemNr);
  
  Drop* item = (Drop*)m_drops.find(d->dropId);
  if (item != NULL)
  {
    item->update(d, name);
    updateFilterFlags(item);
    item->updateLastChanged();
    emit changeItem(item, tSpawnChangedALL);
  }
  else
  {
    item = new Drop(d, name);
    updateFilterFlags(item);
    m_drops.insert(d->dropId, item);
    emit addItem(item);
  }

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