Показать сообщение отдельно
Старый 28-01-2022, 21:39   #3244
CubanFoxtrot
Aircraftsman
 
Регистрация: Nov 2016
Сообщений: 12
Цитата:
Сообщение от CrazyIvan Посмотреть сообщение
Fast Fix for Naval Sim Engine.
Thanks for this quick solution.
But please don't give up with your original intention!

Код:
void Commander::ProcessSolutionType_20017470(SolutionType* solutionType)
{
    if (this->AIPlayer_70)
    {
        bool b{ true };

        if (solutionType->tgtEntity_158 != nullptr)
        {
            if ((solutionType->tgtEntity_158->flags_c8 & 1 /* detected??? */) != 0
            || (solutionType->flags_c8 & 4 /* contact dropped */) != 0
            || (solutionType->tgtEntity_158->alliance_c4 == this->alliance_98))
            {
                return;
            }

            b = (solutionType->tgtEntity_158->dbObjectInfo_1e8->simType_c8 != 3 /* kSTCM */);
        }

        if (b)
        {
            this->list_a4.insert(solutionType);
            solutionType->notify_00.register(this, false);
        }

        if (solutionType->tgtEntity_158 != nullptr && !IsFriendlySideAlliance(this->alliance_98, solutionType->tgtEntity_158->alliance_c4))
        {
            if (solutionType->tgtEntity_158->dbObjectInfo_1e8->simType_c8 == 0 /* kSTSub */ && solutionType->confidence_FC < 40
            || (solutionType->tgtEntity_158->unkEntity_1F0 != nullptr && solutionType->tgtEntity_158->unkEntity_1F0->dbObjectInfo_1e8->simType_c8 == 0 /* kSTSub */)
            && (solutionType->tgtEntity_158->dbObjectInfo_1e8->simType_c8 == 2 /* kSTTorp */
                || solutionType->tgtEntity_158->dbObjectInfo_1e8->simType_c8 == 10 /* kSTMissile */
                || solutionType->tgtEntity_158->dbObjectInfo_1e8->simType_c8 == 3 /* kSTCM */
                && solutionType->tgtEntity_158->dbObjectInfo_1e8->objectType_C4 == 8 /* kOTWeap */))
            {
                this->sub_200026CB(solutionType);
            }

            if (solutionType->tgtEntity_158->dbObjectInfo_1e8->simType_c8 == 2 /* kSTTorp */)
            {
                solutionType->vfnGetUnkData_0C(&dataBufOfSize20Bytes); // e.g. +0x10=alt
                for (auto n = this->unk_1C0; n != nullptr; n = n->next_04) // iterate over a linked list of Commander's entities...
                {
                    if (n->value_00.entity_00 != solutionType->srcEntity_154)
                    {
                        if ((n->value_00.entity_00->unk_CC & 0b100 /* CPU */) != 0
                        && (n->value_00.entity_00->unk_CC & 0b1 /* bit set only if entity->dbObjectInfo_1e8->objectType_C4 <= kOTStat */) != 0)
                        {
                            if (sub_200016EA(n->value_00.entity_00, &dataBufOfSize20Bytes) < 18520.f) // seems a geometrical calculation...
                            {
                                n->value_00.entity_00->sub_20001956(solutionType); // might create waypoint type inside...
                            }
                        }
                    }
                }
            }
        }
    }
}

You may probably just need to add your depth check within that Commander's 1c0 entities list loop? Who knows.
CubanFoxtrot вне форума   Ответить с цитированием