Server Help

ASSS Questions - dropturret confusion

tcsoccerman - Sat Aug 30, 2008 11:30 am
Post subject: dropturret confusion
i'm lost on how this code block fires a bomb... could someone clarify

Code: Show/Hide
else if (TICK_GT(now, td->tofire))
      {
         Player *bp;

         td->tofire = now + td->interval;
         td->tosend = now + 15;
         td->pos.bounty = TICK_DIFF(td->endtime, now) / 100;
         td->pos.time = now;
         td->pos.weapon.type = td->weapon;
         td->pos.energy = td->pos.extra.energy =
            TICK_DIFF(td->endtime, now) / 100;

         pd->Lock();
         bp = findTurretTarget(td);
         td->pos.rotation = !bp ? 0 :
            fireControl(
                  td->p->position.x,
                  td->p->position.y,
                  bp->position.x,
                  bp->position.y,
                  bp->position.xspeed - td->p->position.xspeed,
                  bp->position.yspeed - td->p->position.yspeed,
                  cfg->GetInt(td->p->arena->cfg,
                     ship_names[(int)bp->p_ship], "BombSpeed", 10));
         pd->Unlock();

         game->FakePosition(td->p, &td->pos, sizeof(td->pos));
      }

Dr Brain - Sat Aug 30, 2008 11:07 pm
Post subject:
It sets up td->pos then sends it with game->FakePosition(...).

The bomb part of the td->pos packet is set up elsewhere, as it never changes from send to send. In fact the majority of the packet's data is reused each time.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group