Code: Show/Hide int i;
//Do not allow player to fire ball from enemy crease for (i = 0; i < N_TEAMS; i++) if (i != p->pkt.freq) if (checkcrease(p, i)) { struct BallData newpos; //Penalize player givepenalty(p); //Give ball to the goalie if there is one Player* goalie = getgoalie(i); if (goalie) { newpos.carrier = goalie; newpos.x = goalie->position.x; newpos.y = goalie->position.y; newpos.state = BALL_CARRIED; newpos.time = current_ticks(); } else { //Leave ball there if there is no goalie newpos.carrier = NULL; newpos.x = p->position.x; newpos.y = p->position.y; newpos.state = BALL_ONMAP; newpos.time = current_ticks(); } newpos.xspeed = 0; newpos.yspeed = 0; newpos.freq = i; //Ball belongs to defending team //If future pos is in the goal, do something balls->PlaceBall(arena, bid, &newpos); snprintf(msg, sizeof(msg), "%s attempted to fire ball in team %i crease", p->name, i); chat->SendArenaMessage(arena, msg); carrier[bid] = NULL; lastcarrier[bid] = NULL; return; } carrier[bid] = p; |
Samapico wrote: |
-Is there a way to know the current location of the ball? More precisely, the location of the ball where it is picked up from, and not where the player who picked it is. i.e. player position +/- ball proximity in some direction. |
Quote: |
-Is there an easy way to phase the ball? When a player shoots the ball from the offensive crease, I wanted to disallow the throw with the adviser, that didn't work well. So I just place the ball there, and I plan to warp the player away, but I need to temporarily phase the ball. I could always tag the player and disallow his pickups for a while, don't know what would be best... |
Quote: |
-Is there any way to detect a ball phasing/lagging through people? Can this even be a concern in ASSS? I guess that's when the 'I caught the ball' packet sent from the player doesn't reach the server in time... |
Quote: |
Edit: Another non-ball related: Is there something already done to extrapolate the player's actual position, instead of using the last position packet received? If not, how can I know when the last position update was? in mervbot, the players had a 'lastpositionupdate' field, but I didn't see any here. |
Code: Show/Hide int BlockBallGoal(Arena *a, Player *p, int bid, int x, int y, struct BallData *newbd) { chat->SendArenaMessage(a, "Goal??? %i", p->pkt.freq); |
Samapico wrote: |
If you fire the ball from inside your own goal, it triggers a goal and the ball respawns... I'm guessing I could work around it by blocking the goal, but wtf? ![]() |