mirror of https://github.com/dirtbags/tanks.git
Merge in changes from fuzzie
This commit is contained in:
commit
933d4746ab
7
ctanks.c
7
ctanks.c
|
@ -116,13 +116,14 @@ tanks_fire_cannon(struct tanks_game *game,
|
||||||
float theta = this->angle + this->turret.current;
|
float theta = this->angle + this->turret.current;
|
||||||
float rpos[2];
|
float rpos[2];
|
||||||
|
|
||||||
/* If someone's a crater, this is easy */
|
/* If someone's a crater, this is easy (unless we were just killed by the other one, in which case
|
||||||
if (this->killer || that->killer) {
|
we have to check the other direction) */
|
||||||
|
if ((this->killer && this->killer != that) || that->killer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Did they collide? */
|
/* Did they collide? */
|
||||||
if (dist2 < TANK_COLLISION_ADJ2) {
|
if ((!this->killer) && dist2 < TANK_COLLISION_ADJ2) {
|
||||||
this->killer = that;
|
this->killer = that;
|
||||||
this->cause_death = "collision";
|
this->cause_death = "collision";
|
||||||
|
|
||||||
|
|
5
forf.c
5
forf.c
|
@ -30,6 +30,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#include "forf.h"
|
#include "forf.h"
|
||||||
#include "dump.h"
|
#include "dump.h"
|
||||||
|
@ -348,7 +349,7 @@ forf_proc_div(struct forf_env *env)
|
||||||
long a = forf_pop_num(env);
|
long a = forf_pop_num(env);
|
||||||
long b = forf_pop_num(env);
|
long b = forf_pop_num(env);
|
||||||
|
|
||||||
if (0 == a) {
|
if (0 == a || (a == -1 && b == LONG_MIN)) {
|
||||||
env->error = forf_error_divzero;
|
env->error = forf_error_divzero;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -361,7 +362,7 @@ forf_proc_mod(struct forf_env *env)
|
||||||
long a = forf_pop_num(env);
|
long a = forf_pop_num(env);
|
||||||
long b = forf_pop_num(env);
|
long b = forf_pop_num(env);
|
||||||
|
|
||||||
if (0 == a) {
|
if (0 == a || (a == -1 && b == LONG_MIN)) {
|
||||||
env->error = forf_error_divzero;
|
env->error = forf_error_divzero;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue