Author Topic: eXtreme 2.7: Bug-Report 8: Copy MG  (Read 230 times)

Offline {NADF}Geronimo

  • Rank: Private
  • *
  • Posts: 65
eXtreme 2.7: Bug-Report 8: Copy MG
« on: July 16, 2011, 12:03:04 pm »
Hi Pat!

There is a bug (in 2.6 too), that you can "copy"/doubled any MG.

You can reproduce in that way:
a) Unplant a MG
b) Drop the MG to the ground.
c) Die (the MG returned, but the MG on the ground stay)
d) Pickup the MG and plant it. You have now 2 MG's.

With a solution like that you can prevent, that these MG can be planted:



Code: [Select]
[....]
turretThink()
{
level endon("ex_gameover");

self.heat_rate = level.ex_turretoverheat_heatrate;
self.heat_status = 1;
self.heat_danger = 80;
self.heat_max = 114;
self.cool_rate = level.ex_turretoverheat_coolrate;
if(level.ex_turretoverheat) self thread turretOverheatDrain();

//********************************************************************************
//{NADF} Copied MG's Fix
//********************************************************************************
//Created by: {NADF}Geronimo
//Date: 16.07.2011
//Version: 1.1
//Website: http://nadfserver.org
//Clan: {NADF} - North Atlantic Defence Force
//Comment: Prevent, that "copie" mg's can be used.
//********************************************************************************
if (!isDefined(self.id))
{
self thread turretOverheat();
playfx(level.ex_effect["barrel"], self.origin);
self playsound("explo_mine"); //Let the MG "explode" (sound)
wait( [[level.ex_fpstime]](1) ); //Let the MG "overheating"
self notify("stop_overheat_drain");
self notify("stop_overheat_fx");
waittillframeend; //Make sure, notify happends
self delete();
}
//********************************************************************************
while(1)
{
       [....]

It's not a best fix, but it works  :D
Maybe you can create a better one?

Another small bug by the turrets are here:

Code: [Select]
File:
Function: turretPlant()
//turretid = undefined; //<-- spelling mistake
turret.id = undefined;
//self notify("spawn_turret"); //<-- obsolete, not needed in 2.7

Regards,
Geronimo

Offline PatmanSan

  • Administrator
  • Rank: Private
  • *****
  • Posts: 2527
Re: eXtreme 2.7: Bug-Report 8: Copy MG
« Reply #1 on: July 16, 2011, 12:53:07 pm »
It's a good fix. We either remove the untagged turret (no ID) after planting, like you did, or we prevent planting in the first place. Of course, preventing a plant will keep the doubled MG's in the map forever. I think your fix is better.

Offline PatmanSan

  • Administrator
  • Rank: Private
  • *****
  • Posts: 2527
Re: eXtreme 2.7: Bug-Report 8: Copy MG
« Reply #2 on: August 10, 2011, 09:32:13 am »
Fix 21 addresses this issue. Please test.

I didn't use your fix, because it also instantly removed turrets that were planted from regular mobile MG's (selected from the weapons menu).

The only "problem" with fix 21 is that it will restore a mobile MG (formerly turret) when forced to drop by code, for instance the "drop weapon on fall" feature. The player will not be able to pick up the weapon, because it's gone. He will have to find another weapon that's lying around somewhere.
Well... bad luck.