Index: include/bzfsAPI.h =================================================================== RCS file: /cvsroot/bzflag/bzflag/include/bzfsAPI.h,v retrieving revision 1.135 diff -r1.135 bzfsAPI.h 982a983 > BZF_API int bz_fireWorldGM ( int targetPlayerID, float lifetime, float *pos, float tilt, float direction, float dt); Index: src/bzfs/WorldWeapons.cxx =================================================================== RCS file: /cvsroot/bzflag/bzflag/src/bzfs/WorldWeapons.cxx,v retrieving revision 2.32 diff -r2.32 WorldWeapons.cxx 68a69,100 > static int fireWorldGMReal ( FlagType* type, PlayerId targetPlayerID, float > lifetime, PlayerId player, float *pos, float tilt, float dir, int shotID, > float dt) > { > > void *buf, *bufStart = getDirectMessageBuffer(); > > FiringInfo firingInfo; > firingInfo.timeSent = (float)TimeKeeper::getCurrent().getSeconds(); > firingInfo.flagType = type; > firingInfo.lifetime = lifetime; > firingInfo.shot.player = player; > memmove(firingInfo.shot.pos, pos, 3 * sizeof(float)); > const float shotSpeed = BZDB.eval(StateDatabase::BZDB_SHOTSPEED); > const float tiltFactor = cosf(tilt); > firingInfo.shot.vel[0] = shotSpeed * tiltFactor * cosf(dir); > firingInfo.shot.vel[1] = shotSpeed * tiltFactor * sinf(dir); > firingInfo.shot.vel[2] = shotSpeed * sinf(tilt); > firingInfo.shot.id = shotID; > firingInfo.shot.dt = dt; > > firingInfo.shot.team = RogueTeam; > > buf = firingInfo.pack(bufStart); > > if (BZDB.isTrue(StateDatabase::BZDB_WEAPONS)) { > broadcastMessage(MsgShotBegin, (char *)buf - (char *)bufStart, > bufStart); > } > > // Target the gm. > // construct and send packet 69a102,111 > char packet[ShotUpdatePLen + PlayerIdPLen]; > buf = (void*)packet; > buf = firingInfo.shot.pack(buf); > buf = nboPackUByte(buf, targetPlayerID); > if (BZDB.isTrue(StateDatabase::BZDB_WEAPONS)) { > broadcastMessage(MsgGMUpdate, sizeof(packet), packet); > } > > return shotID; > } 259a302,308 > int fireWorldGM(FlagType* type, PlayerId targetPlayerID, float lifetime, > PlayerId player, float *pos, float tilt, float direction, int > shotID, float dt) > { > return fireWorldGMReal(type, targetPlayerID, lifetime, player, pos, tilt, > direction, shotID, dt); > } Index: src/bzfs/WorldWeapons.h =================================================================== RCS file: /cvsroot/bzflag/bzflag/src/bzfs/WorldWeapons.h,v retrieving revision 2.15 diff -r2.15 WorldWeapons.h 92a93,94 > int fireWorldGM(FlagType* type, PlayerId targetPlayerID, float lifetime, PlayerId player, float *pos, float tilt, float direction, int shotID, float dt); > Index: src/bzfs/bzfsAPI.cxx =================================================================== RCS file: /cvsroot/bzflag/bzflag/src/bzfs/bzfsAPI.cxx,v retrieving revision 2.137 diff -r2.137 bzfsAPI.cxx 1094a1095,1116 > BZF_API int bz_fireWorldGM ( int targetPlayerID, float lifetime, float *pos, float tilt, float direction, float dt) > { > const char* flagType = "GM"; > > if (!pos || !flagType) > return false; > > FlagTypeMap &flagMap = FlagType::getFlagMap(); > if (flagMap.find(std::string(flagType)) == flagMap.end()) > return false; > > FlagType *flag = flagMap.find(std::string(flagType))->second; > > PlayerId player = ServerPlayer; > > int shotID = world->getWorldWeapons().getNewWorldShotID(); > > fireWorldGM(flag,targetPlayerID, lifetime,player,pos,tilt,direction, shotID, dt); > > return shotID; > } >