Jump to content

Home

Known Code Bugs and Solutions


razorace

Recommended Posts

Can I add a tip? I noticed in MP when you run forward it uses the same animation to run backward and the saber in your hand moves constantly in front of your face. Instead in SP the saber is held almost at your side. Is this possible to fix? Is it possible to simply "rename" the animation file (if it exist) to fix that without a MOD?

Link to comment
Share on other sites

Originally posted by Nemios

Can I add a tip? I noticed in MP when you run forward it uses the same animation to run backward and the saber in your hand moves constantly in front of your face. Instead in SP the saber is held almost at your side. Is this possible to fix? Is it possible to simply "rename" the animation file (if it exist) to fix that without a MOD?

 

Anything that you edit in the game source has to be made into a "mod" However, there are cfg files you can use to substitute animations I think. Check here.

 

http://www.lucasforums.com/showthread.php?s=&threadid=98001

 

 

 

Originally posted by LeeOattes

Yes, I have been working on this bug. However, though I have a few work arounds, I have not found the actual code problem yet. If you know exactly where it is broken, let me know. The symptoms are in the saberbacktoowner routine, but as yet I don't know why the checks there are failing.

 

What I did was the following:

 

Do a search for Fall_fading. You will see it in g_active.c Under the part where it says "// die" put this:

 

WP_SaberInitBladeData( ent );

 

So now it should look like this:

 

//**************Cut Text*******************

if (ent->client && ent->client->ps.fallingToDeath &&

(level.time - FALL_FADE_TIME) > ent->client->ps.fallingToDeath)

{ //die!

 

WP_SaberInitBladeData( ent ); // Invisible Saber Fix

player_die(ent, ent, ent, 100000, MOD_FALLING);

respawn(ent);

ent->client->ps.fallingToDeath = 0;

 

G_MuteSound(ent->s.number, CHAN_VOICE); //stop screaming, because you are dead!

}

 

That pretty much does it. But the root of the problem still lies within the saber shield bug. I can't seem to figure out that one. Any leads?

Link to comment
Share on other sites

Originally posted by zERoCooL2479

That pretty much does it. But the root of the problem still lies within the saber shield bug. I can't seem to figure out that one. Any leads?

 

Well, your fix will work in the case where the player dies by falling, but you can also reproduce this by dieing in other ways ;-). Jumping off a cliff is the easiest....

 

The actual problem is the following. When a saber is in flight, the server entity is visible to the client and uses a different think function than normal. When a saber is attached to a player it is not visible to the client at all and only the server "sees" it. The think function when attached to a player should be "saberupdateself". However when the bug/exploit is engaged the think function is "saberreturntoowner" -- this is the think function for a flying saber. When the bug/exploit is engaged, the damage is caused because you have a saber attached to a client that thinks it is in flight (it does not check re: holstered state).

 

Now why is this the case? Well that is interesting indeed and I don't think I can claim anything more than a guess. Here it is:

 

When the saberreturntoowner function is the "think" function for the saber it is constantly checking to see if the owner is dead. Eg. in the function you will see:

 

if (g_entities[saberent->r.ownerNum].health < 1 || !g_entities[saberent->r.ownerNum].client->ps.fd.forcePowerLevel[FP_SABERATTACK] || !g_entities[saberent->r.ownerNum].client->ps.fd.forcePowerLevel[FP_SABERTHROW])

{ //He's dead, just go back to our normal saber status

saberent->touch = SaberGotHit;

saberent->think = SaberUpdateSelf;

saberent->bolt_Head = 0;

saberent->nextthink = level.time;

 

saberOwner->client->blockedThrow=qfalse;

MakeDeadSaber(saberent);

 

saberent->r.svFlags |= (SVF_NOCLIENT);

saberent->r.contents = CONTENTS_LIGHTSABER;

VectorSet( saberent->r.mins, -SABER_BOX_SIZE, -SABER_BOX_SIZE, -SABER_BOX_SIZE );

VectorSet( saberent->r.maxs, SABER_BOX_SIZE, SABER_BOX_SIZE, SABER_BOX_SIZE );

saberent->s.loopSound = 0;

 

g_entities[saberent->r.ownerNum].client->ps.saberInFlight = qfalse;

g_entities[saberent->r.ownerNum].client->ps.saberThrowDelay = level.time + 500;

g_entities[saberent->r.ownerNum].client->ps.saberCanThrow = qfalse;

 

return;

}

 

 

This code *should* work and correctly set the saber think function (and a few other things) back to "normal" if the saber owner is dead. However, when you hold the attack key down while you die, you spawn *right* away. This code does not actually get a chance to run before you respawn and your health is no longer < 1.

 

I tried setting the think time very short (eg. zero wait) and the code still fails to run. I can only conclude that when you respawn right away, the actual path taken through the game code does not actually run the saberreturntoowner function before the spawn.

 

Here is how I fixed it:

 

- go to player_die and check the saber think function when a player dies.

- if it is saberreturntoowner, reset the saber think (and other bits).

 

In combat.c, player_die, i added the following:

 

if ( self->client->ps.saberEntityNum )

{ // player has a saber, check it out for invisible saber bug/exploit (lmo)

// not sure why the code in w_saber.c does not catch this. I can only assume

// that if you respawn really quickly, that code never see's health less than 1hp!

// So, i just check here to make absolutely sure....

saberent = &g_entities[self->client->ps.saberEntityNum];

if( saberent->think == saberBackToOwner )

{ // reset think function to normal

 

saberent->touch = SaberGotHit;

saberent->think = SaberUpdateSelf;

saberent->bolt_Head = 0;

saberent->nextthink = level.time;

 

self->client->blockedThrow=qfalse;

 

MakeDeadSaber(saberent);

 

saberent->r.svFlags |= (SVF_NOCLIENT);

saberent->r.contents = CONTENTS_LIGHTSABER;

VectorSet( saberent->r.mins, -SABER_BOX_SIZE, -SABER_BOX_SIZE, -SABER_BOX_SIZE );

VectorSet( saberent->r.maxs, SABER_BOX_SIZE, SABER_BOX_SIZE, SABER_BOX_SIZE );

saberent->s.loopSound = 0;

 

self->client->ps.saberInFlight = qfalse;

self->client->ps.saberThrowDelay = level.time + 500;

self->client->ps.saberCanThrow = qfalse;

}

}

 

 

cheers,

 

 

Lee

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...