src/hcode/btech/hudinfo.c File Reference

#include <string.h>
#include <math.h>
#include "config.h"
#include "externs.h"
#include "interface.h"
#include "muxevent.h"
#include "mech.h"
#include "map.h"
#include "map.los.h"
#include "p.mech.utils.h"
#include "p.mech.contacts.h"
#include "failures.h"
#include "p.mech.build.h"
#include "p.mech.notify.h"
#include "p.mech.update.h"
#include "p.mech.move.h"
#include "p.mech.los.h"
#include "p.mech.status.h"

Include dependency graph for hudinfo.c:

Go to the source code of this file.

Functions

void auto_reply (MECH *mech, char *buf)


Function Documentation

void auto_reply ( MECH mech,
char *  buf 
)

Definition at line 1196 of file autopilot_radio.c.

References auto_reply_event(), EVENT_AUTO_REPLY, FindObjectsData(), MECH::freq, Good_obj, Location, MechAuto, MECHEVENT, MECH::mynum, Number, and SendAI.

01197 {
01198 
01199         char *reply;
01200 
01201         /* No zero freq messages */
01202         if(!mech->freq[0])
01203                 return;
01204 
01205         /* Make sure there is an autopilot */
01206         if(MechAuto(mech) <= 0)
01207                 return;
01208 
01209         /* Make sure valid objects */
01210         if(!(FindObjectsData(MechAuto(mech))) ||
01211            !Good_obj(MechAuto(mech)) || Location(MechAuto(mech)) != mech->mynum) {
01212                 MechAuto(mech) = -1;
01213                 return;
01214         }
01215 
01216         /* Copy the buffer */
01217         reply = strdup(buf);
01218 
01219         if(reply) {
01220                 MECHEVENT(mech, EVENT_AUTO_REPLY, auto_reply_event, Number(1, 2),
01221                                   reply);
01222         } else {
01223                 SendAI
01224                         ("Interal AI Error: Attempting to radio reply but unable to copy string");
01225         }
01226 
01227 }


Generated on Mon May 28 04:25:34 2007 for BattletechMUX by  doxygen 1.4.7