Skip to content

Commit

Permalink
Merge from dev [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
xrSimpodin committed Sep 22, 2021
2 parents 8ca4e1a + 87ddcb2 commit 7ab5bb7
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 10 deletions.
7 changes: 4 additions & 3 deletions ogsr_engine/xrGame/Actor_Events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ void CActor::OnEvent (NET_Packet& P, u16 type)
{
P.r_u16 (id);
CObject* O = Level().Objects.net_Find (id);
if (!O)
{
Msg("! Error: No object to reject/sell [%d]", id);

if (!O) {
Msg("! [%s] Error: No object to reject/sell [%u]", __FUNCTION__, id);
break;
}

bool just_before_destroy = !P.r_eof() && P.r_u8();
bool dont_create_shell = (type == GE_TRADE_SELL) || (type == GE_TRANSFER_REJECT) || just_before_destroy;

Expand Down
5 changes: 5 additions & 0 deletions ogsr_engine/xrGame/Car.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1729,6 +1729,11 @@ void CCar::OnEvent(NET_Packet& P, u16 type)
P.r_u16 (id);
CObject* O = Level().Objects.net_Find (id);

if (!O) {
Msg("! [%s] Error: No object to reject/sell [%u]", __FUNCTION__, id);
break;
}

bool just_before_destroy = !P.r_eof() && P.r_u8();
bool dont_create_shell = (type == GE_TRADE_SELL) || (type == GE_TRANSFER_REJECT) || just_before_destroy;

Expand Down
6 changes: 3 additions & 3 deletions ogsr_engine/xrGame/GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,9 +874,9 @@ u32 CGameObject::ef_anomaly_type () const
u32 CGameObject::ef_weapon_type () const
{
string16 temp; CLSID2TEXT(CLS_ID,temp);
R_ASSERT3 (false,"Invalid weapon type request, virtual function is not properly overridden!",temp);
return (u32(-1));
// return (u32(0));
//R_ASSERT3 (false,"Invalid weapon type request, virtual function is not properly overridden!",temp);
Msg("!![%s] Invalid weapon type request, virtual function is not properly overridden [%s] ", __FUNCTION__, temp);
return u32(-1);
}

u32 CGameObject::ef_detector_type () const
Expand Down
2 changes: 1 addition & 1 deletion ogsr_engine/xrGame/PHShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void CPHShell:: applyImpulseTrace (const Fvector& pos, const Fvector& dir, floa
CBoneInstance& instance=m_pKinematics->LL_GetBoneInstance (id);
if(instance.callback_type() != bctPhysics || !instance.callback_param()) return;

((CPhysicsElement*)instance.callback_param())->applyImpulseTrace ( pos, dir, val, id);
static_cast<CPhysicsElement*>(instance.callback_param())->applyImpulseTrace( pos, dir, val, id);
EnableObject(0);
}

Expand Down
6 changes: 5 additions & 1 deletion ogsr_engine/xrGame/ai/monsters/basemonster/base_monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,11 @@ void CBaseMonster::OnEvent(NET_Packet& P, u16 type)
{
P.r_u16 (id);
CObject* O = Level().Objects.net_Find (id);
VERIFY (O);

if (!O) {
Msg("! [%s] Error: No object to reject/sell [%u]", __FUNCTION__, id);
break;
}

bool just_before_destroy = !P.r_eof() && P.r_u8();
bool dont_create_shell = (type == GE_TRADE_SELL) || (type == GE_TRANSFER_REJECT) || just_before_destroy;
Expand Down
5 changes: 3 additions & 2 deletions ogsr_engine/xrGame/ai/stalker/ai_stalker_events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ void CAI_Stalker::OnEvent (NET_Packet& P, u16 type)
P.r_u16 (id);
CObject *O = Level().Objects.net_Find(id);

#pragma todo("Dima to Oles : how can this happen?")
if (!O)
if (!O) {
Msg("! [%s] Error: No object to reject/sell [%u]", __FUNCTION__, id);
break;
}

bool just_before_destroy = !P.r_eof() && P.r_u8();
bool dont_create_shell = (type == GE_TRADE_SELL) || (type == GE_TRANSFER_REJECT) || just_before_destroy;
Expand Down
6 changes: 6 additions & 0 deletions ogsr_engine/xrGame/ai/trader/ai_trader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ void CAI_Trader::OnEvent (NET_Packet& P, u16 type)
{
P.r_u16 (id);
Obj = Level().Objects.net_Find (id);

if (!Obj) {
Msg("! [%s] Error: No object to reject/sell [%u]", __FUNCTION__, id);
break;
}

bool just_before_destroy = !P.r_eof() && P.r_u8();
bool dont_create_shell = (type == GE_TRADE_SELL) || (type == GE_TRANSFER_REJECT) || just_before_destroy;
Obj->SetTmpPreDestroy (just_before_destroy);
Expand Down

0 comments on commit 7ab5bb7

Please sign in to comment.