Situation where Chance-To-Hit is bugged!

Issue #98 new
JAsmine-ja2 NA created an issue

In this savegame, there is an enemy, who can not be hit! This is what happened: Thor fired a 40mm grenade into the darkness, where I suspected some enemies. Thor really hit someone and the explosion lit him up for Ira and Shadow. Unfortunally, they can't hit him. The bullets hit his tile and impact where his body is laying, but the game pretends, they're hitting the ground (can be seen in the screenie)http://img.xrmb2.net/images/165362.jpeg

Situations where CTH is not really working are not too common in JA2 Vanilla. At least, when the game is patched. These situations do occur, but the whole system is much more stable compared to... say... v1.13?!?!

EDIT: This guy (Prof. Cheat) seems to be fully bugged. He can not be hit at all. Even spamming grenades (cheat - strg+k) doesn't even tip his toe. He can be killed with alt+o...

Comments (2)

  1. Rinne

    The Problem is that the

    WhoIsThere2() 
    

    Function in Worldman.cc return NULL when asked for a Target in this Tile. I don't understand why. It does not enter the following loop:

    for (STRUCTURE const* structure = gpWorldLevelData[gridno].pStructureHead; structure; structure = structure->pNext)
    

    Which it does for other targets (i.e. try shooting at one of your teammates)

    If trying to enter the code in Debug mode, make sure to set the breakpoint at line 2200 in Weapons.cc, since the Function is called in many other places.:

    // best to use team knowledge as well, in case of spotting for someone else
        const SOLDIERTYPE* const tgt = WhoIsThere2(sGridNo, pSoldier->bTargetLevel);
        if (tgt != NULL && (pSoldier->bOppList[tgt->ubID] == SEEN_CURRENTLY || gbPublicOpplist[pSoldier->bTeam][tgt->ubID] == SEEN_CURRENTLY))
        {
            iSightRange = SoldierToBodyPartLineOfSightTest( pSoldier, sGridNo, pSoldier->bTargetLevel, pSoldier->bAimShotLocation, (UINT8) (MaxDistanceVisible() * 2), TRUE );
        }
    
  2. Log in to comment