Вопрос После спавна ентити краш игры.

Начинающий
Статус
Оффлайн
Регистрация
28 Окт 2020
Сообщения
26
Реакции[?]
0
Поинты[?]
0
Код:
void  RequestHit2(CEntity* g_pCEntity, EntityId projectileId, Vec3 pos, int CheckVisible) //<---
    {
        CGameFramework* m_pFramework = SSystemGlobalEnvironment::Singleton()->GetIGame()->GetCGameFramework(); if (!m_pFramework) return;
        CRenderer* pRenderer = SSystemGlobalEnvironment::Singleton()->GetIRenderer(); if (!pRenderer) return;
        CGameRules* pGameRules = m_pFramework->GetGameRulesSystem(); if (!pGameRules) return;
        CActor* mActor = m_pFramework->GetClientActor(); if (!mActor) return;
        CItem* g_pItem = mActor->GetCurrentItem(); if (!g_pItem) return;
        CWeapon* g_pWeapon = g_pItem->GetIWeapon(); if (!g_pWeapon) return;

        LPCSTR WeaponName = g_pItem->GetIWeaponEntity()->GetName();

        WEAPON_NAMES WeaponInfo;
        SClientGameHitInfo info;
        memset(&info, 0, sizeof(SClientGameHitInfo));
        info.source.itemId = g_pItem->GetItemId();
        info.source.projectileId = projectileId;
        info.source.ammoClassId = 65535;
        info.shared.shooterId = mActor->GetEntityId();
        info.shared.targetId = g_pCEntity->GetEntityId();
        //info.shared.material = GetHitMaterial(g_pCEntity);
        info.shared.material = pGameRules->GetHitMaterialId(GetHitMaterial(g_pCEntity));
        info.shared.partId = 0;
        info.shared.pos = pos;
        info.shared.typeId = 1;
        info.shared.shootPos = pRenderer->GetViewCamera();
        info.shared.dir = info.shared.pos - info.shared.shootPos;
        info.travelDistance = info.shared.dir.GetLength();
        info.shared.dir = info.shared.dir / info.travelDistance;
        info.source.normal = info.shared.dir * -1.f;

        info.bFromRemote = false;
        info.canBeReported = true;
        info.bRequest = true;

        if (CheckVisible ? true : SSystemGlobalEnvironment::Singleton()->GetIPhysicalWorld()->isVisible(info.shared.shootPos, info.shared.pos)) {
            if (strstr(WeaponName, WeaponInfo.stormtrooper_weapon1) || strstr(WeaponName, WeaponInfo.stormtrooper_weapon2) || strstr(WeaponName, WeaponInfo.sniper_weapons) || strstr(WeaponName, WeaponInfo.sed_weapon1) || strstr(WeaponName, WeaponInfo.medic_weapons) || strstr(WeaponName, WeaponInfo.engineer_weapons) || strstr(WeaponName, WeaponInfo.pistols)) {
                if (!strstr(WeaponName, "arl")) {
                    if (!strstr(WeaponName, "ft")) {
                        if (AutoShot ? 1 : g_pWeapon->GetIWeaponSpecific()->IsFiring()) {//автовыстрел
                            if (Hit)
                        
                            
                            
                                g_pWeapon->GetIWeaponSpecific()->RequestShootHit(&info); //
                            
                        }
                    }
                }
            }
        }
    };
При спавне ботов хиты крашат. Кому не сложно объясните в чём трабл .
 
Energy Reload
Забаненный
Статус
Оффлайн
Регистрация
20 Авг 2017
Сообщения
1,206
Реакции[?]
330
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
До обновы игры работало?
 
Всем Рептилойдам - Рен ТВ
Пользователь
Статус
Оффлайн
Регистрация
1 Фев 2020
Сообщения
541
Реакции[?]
92
Поинты[?]
0
g_pWeapon->GetIWeaponSpecific()->RequestShootHit(&info); //


Адрес на актуальность проверь
 
Продам прострел стен Warface 10к руб!
Забаненный
Статус
Оффлайн
Регистрация
7 Авг 2018
Сообщения
308
Реакции[?]
106
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
shooterId - нет в структуре.
ammoClassId - нет в структуре.
itemId - нет в структуре.
 
Сверху Снизу