Monday, August 20, 2007

Find geno flag

By: Someone
This is how to find a geno flag with the top of your mousebox. Only works if phantom zone spoof is off.


Geno/other team flag finder: You know that there is a marker for your own team flag, and antidotes above the targeting square, so why not have one for geno, and other team flags?

In src/bzflag/playing.cxx, find:
---
static void prepareTheHUD()
{
// prep the HUD
if (myTank) {
const float* myPos = myTank->getPosition();
hud->setHeading(myTank->getAngle());
hud->setAltitude(myPos[2]);
if (world->allowTeamFlags()) {
const float* myTeamColor = Team::getTankColor(myTank->getTeam());
// markers for my team flag
for (int i = 0; i < numFlags; i++) {
Flag& flag = world->getFlag(i);
if ((flag.type->flagTeam == myTank->getTeam())
&& ((flag.status != FlagOnTank) ||
(flag.owner != myTank->getId()))) {
const float* flagPos = flag.position;
float heading = atan2f(flagPos[1] - myPos[1],flagPos[0] - myPos[0]);
hud->addMarker(heading, myTeamColor);
}
}
}
if (myTank->getAntidoteLocation()) {
// marker for my antidote flag
const GLfloat* antidotePos = myTank->getAntidoteLocation();
float heading = atan2f(antidotePos[1] - myPos[1],
antidotePos[0] - myPos[0]);
const float antidoteColor[] = {1.0f, 1.0f, 0.0f};
hud->addMarker(heading, antidoteColor);
}
}
return;
}
---
Replace it with:
---
static void prepareTheHUD()
{
// prep the HUD
if (myTank) {
const float* myPos = myTank->getPosition();
hud->setHeading(myTank->getAngle());
hud->setAltitude(myPos[2]);
if (world->allowTeamFlags()) {
// markers for my team flag
for (int i = 0; i < numFlags; i++) {
Flag& flag = world->getFlag(i);
if (flag.type->flagTeam != NoTeam) {
const float* flagPos = flag.position;
float heading = atan2f(flagPos[1] - myPos[1],flagPos[0] - myPos[0]);
hud->addMarker(heading, Team::getTankColor(flag.type->flagTeam));
}
}
}
if (myTank->getAntidoteLocation()) {
// marker for my antidote flag
const GLfloat* antidotePos = myTank->getAntidoteLocation();
float heading = atan2f(antidotePos[1] - myPos[1],
antidotePos[0] - myPos[0]);
const float antidoteColor[] = {1.0f, 1.0f, 0.0f};
hud->addMarker(heading, antidoteColor);
}
for (int i = 0; i < numFlags; i++) {
Flag& flag = world->getFlag(i);
if (flag.type == Flags::Genocide) {
const float* flagPos = flag.position;
float heading = atan2f(flagPos[1] - myPos[1],flagPos[0] - myPos[0]);
hud->addMarker(heading, flag.type->getColor());
}
}
}
return;
}
---

See his post on "Wings gravity fix for bloodbath"

No comments: