fix button usage and use the new SV_Spawn function

This commit is contained in:
Bill Currie 2003-08-21 03:53:15 +00:00
parent f5c5b2a9a2
commit 1f0d73a45e
5 changed files with 13 additions and 12 deletions

View file

@ -343,7 +343,7 @@ based b_aiflags.
if ([self canRJ]) {
[self jump];
v_angle.x = b_angle.x = 80;
ent.button0 = TRUE;
buttons |= 1;
} else
[self lost: targets[0] :FALSE];
}
@ -351,7 +351,7 @@ based b_aiflags.
if (b_aiflags & AI_SURFACE) {
if (ent.waterlevel > 2) {
keys = KEY_MOVEUP;
ent.button2 = TRUE; // swim!
buttons |= 4; // swim!
} else
b_aiflags &= ~AI_SURFACE;
}
@ -742,8 +742,7 @@ frame, the ai_time limits it's actual updating
// status bars, and the mod probably already compensated for that
if (ent.health < 1) {
ent.button0 = floor (random() * 2);
ent.button2 = 0;
buttons = (integer) (random() * 2);
keys = 0;
b_aiflags = 0;
[Waypoint clearMyRoute:self];
@ -771,8 +770,7 @@ frame, the ai_time limits it's actual updating
stagger_think = time;
// shut the bot's buttons off, various functions will turn them on by AI end
ent.button2 = 0;
ent.button0 = 0;
buttons = 0;
// target1 is like goalentity in normal Quake monster AI.
// it's the bot's most immediate target
@ -820,7 +818,7 @@ frame, the ai_time limits it's actual updating
traceline (ent.origin, ent.origin + '0 0 6800', TRUE, ent);
if (trace_inopen) {
keys = KEY_MOVEUP;
ent.button2 = TRUE; // swim!
buttons |= 4; // swim!
return; // skip ai flags for now - this is life or death
}
}

View file

@ -298,7 +298,7 @@ Pick a weapon based on range / ammo
g = angcomp (v_angle.y, b_angle.y);
if (fabs (g) > 30)
return; // not again!
ent.button0 = TRUE;
buttons |= 1;
}
/*

View file

@ -48,7 +48,7 @@ integer bot_move_linker;
- (void) jump
{
// TODO check for precision, etc.
ent.button2 = TRUE;
buttons |= 4;
}
- (integer) canRJ

View file

@ -140,6 +140,7 @@ void (entity e) SV_FreeClient = #0;
void (entity e, string str) SV_SetUserinfo = #0;
void (entity e, integer ping) SV_SetPing = #0;
void (entity cl, float sec, vector angles, vector move, integer buttons, integer impulse) SV_UserCmd = #0;
void (entity cl) SV_Spawn = #0;
//----------------------------------------------------------------------------
@ -325,16 +326,18 @@ void () BotImpulses =
local integer cl_no = ClientNumber (@self);
local entity uself;
SV_Spawn (e);
if (!(self = [super initWithEntity:e]))
return NIL;
b_clientno = cl_no + 1;
b_clientflag = 1 << cl_no;
ent.colormap = (float) (cl_no + 1);
//ent.colormap = (float) (cl_no + 1);
//ent.team = b_pants + 1;
b_entertime = time;
ent.team = b_pants + 1;
ent.netname = name.name;
b_pants = name.pants;

View file

@ -122,7 +122,7 @@ b_originator == targ
if (b_chattime > time) {
if (b_skill < 2)
keys = 0;
ent.button0 = ent.button2 = 0;
buttons = 0;
return;
} else if (b_chattime) {
switch (b_topic) {