Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
dropturret confusion

 
Post new topic   Reply to topic Printable version
 View previous topic  How do you get the registration form i... Post :: Post Setting up a Turf zone.  View next topic  
Author Message
tcsoccerman
Server Help Squatter


Age:33
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sat Aug 30, 2008 11:30 am    Post subject: dropturret confusion Reply to topic Reply with quote

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));
      }
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Aug 30, 2008 11:07 pm    Post subject: Reply to topic Reply with quote

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.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 24 page(s) served in previous 5 minutes.

phpBB Created this page in 0.694829 seconds : 24 queries executed (97.2%): GZIP compression disabled