CheckMeleeCapsule return args

extolloextollo Ping Blip Join Date: 2010-07-16 Member: 72457Members
<div class="IPBDescription">inconsistent use or ....</div>i'm not getting it...


<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Find all "CheckMeleeCapsule"
Weapons\Alien\Gore.lua:62:     local didHit, target, direction = CheckMeleeCapsule(self, player, 0, kAttackRange)
NS2Utility.lua:1656: function CheckMeleeCapsule(weapon, player, damage, range, optionalCoords, traceRealAttack)
NS2Utility.lua:1721:     local didHit, target, endPoint, direction, surface = CheckMeleeCapsule(weapon, player, damage, range, optionalCoords, true)
Weapons\Alien\SwipeBlink.lua:89:     local didHit, trace = CheckMeleeCapsule(self, player, SwipeBlink.kDamage, SwipeBlink.kRange)
Weapons\Marine\Welder.lua:228:     local didHit, target, endPoint, direction, surface = CheckMeleeCapsule(self, player, 0, self:GetRange(), nil, true)<!--c2--></div><!--ec2-->

Welder.lua matches what is in NS2Utility. Gore & SwipeBlink ??

Comments

  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    optionalCoords are, well optional..

    true doesn't need to be passed.

    Although it does look as if Gore is specifying a damage of 0, I guess that is overridden elsewhere in the code because of the different damage to structures and players.

    I can't see any problem :P
  • extolloextollo Ping Blip Join Date: 2010-07-16 Member: 72457Members
    I'm talking about the tuple being returned. Not the arguments. Eg. Trace object isn't returned returned by the nsutility function. But swipe link is expecting it
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    IIRC that function doesnt actually do much beyond a basic hit/miss determination anymore, most likely the worst effects of this are a missing ent specific hit effect and an unused netvar.
  • extolloextollo Ping Blip Join Date: 2010-07-16 Member: 72457Members
    edited October 2012
    agree xdragon...

    in terms of logic, looks like only swipeblink is impacted by this inconsistency - wouldnt set an effect parameter for swipes on entities that take struct damage.

    gore doesnt used the mismapped return arg 'direction'.

    would be nice if there was a way to audit that & keep the source self consistent though. minor bugs could easily go unnoticed.
Sign In or Register to comment.