Skip to content

Commit 7ab5bb7

Browse files
committed
Merge from dev [skip ci]
2 parents 8ca4e1a + 87ddcb2 commit 7ab5bb7

File tree

7 files changed

+27
-10
lines changed

7 files changed

+27
-10
lines changed

ogsr_engine/xrGame/Actor_Events.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ void CActor::OnEvent (NET_Packet& P, u16 type)
9191
{
9292
P.r_u16 (id);
9393
CObject* O = Level().Objects.net_Find (id);
94-
if (!O)
95-
{
96-
Msg("! Error: No object to reject/sell [%d]", id);
94+
95+
if (!O) {
96+
Msg("! [%s] Error: No object to reject/sell [%u]", __FUNCTION__, id);
9797
break;
9898
}
99+
99100
bool just_before_destroy = !P.r_eof() && P.r_u8();
100101
bool dont_create_shell = (type == GE_TRADE_SELL) || (type == GE_TRANSFER_REJECT) || just_before_destroy;
101102

ogsr_engine/xrGame/Car.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,6 +1729,11 @@ void CCar::OnEvent(NET_Packet& P, u16 type)
17291729
P.r_u16 (id);
17301730
CObject* O = Level().Objects.net_Find (id);
17311731

1732+
if (!O) {
1733+
Msg("! [%s] Error: No object to reject/sell [%u]", __FUNCTION__, id);
1734+
break;
1735+
}
1736+
17321737
bool just_before_destroy = !P.r_eof() && P.r_u8();
17331738
bool dont_create_shell = (type == GE_TRADE_SELL) || (type == GE_TRANSFER_REJECT) || just_before_destroy;
17341739

ogsr_engine/xrGame/GameObject.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -874,9 +874,9 @@ u32 CGameObject::ef_anomaly_type () const
874874
u32 CGameObject::ef_weapon_type () const
875875
{
876876
string16 temp; CLSID2TEXT(CLS_ID,temp);
877-
R_ASSERT3 (false,"Invalid weapon type request, virtual function is not properly overridden!",temp);
878-
return (u32(-1));
879-
// return (u32(0));
877+
//R_ASSERT3 (false,"Invalid weapon type request, virtual function is not properly overridden!",temp);
878+
Msg("!![%s] Invalid weapon type request, virtual function is not properly overridden [%s] ", __FUNCTION__, temp);
879+
return u32(-1);
880880
}
881881

882882
u32 CGameObject::ef_detector_type () const

ogsr_engine/xrGame/PHShell.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void CPHShell:: applyImpulseTrace (const Fvector& pos, const Fvector& dir, floa
298298
CBoneInstance& instance=m_pKinematics->LL_GetBoneInstance (id);
299299
if(instance.callback_type() != bctPhysics || !instance.callback_param()) return;
300300

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

ogsr_engine/xrGame/ai/monsters/basemonster/base_monster.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,11 @@ void CBaseMonster::OnEvent(NET_Packet& P, u16 type)
862862
{
863863
P.r_u16 (id);
864864
CObject* O = Level().Objects.net_Find (id);
865-
VERIFY (O);
865+
866+
if (!O) {
867+
Msg("! [%s] Error: No object to reject/sell [%u]", __FUNCTION__, id);
868+
break;
869+
}
866870

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

ogsr_engine/xrGame/ai/stalker/ai_stalker_events.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ void CAI_Stalker::OnEvent (NET_Packet& P, u16 type)
7676
P.r_u16 (id);
7777
CObject *O = Level().Objects.net_Find(id);
7878

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

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

ogsr_engine/xrGame/ai/trader/ai_trader.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ void CAI_Trader::OnEvent (NET_Packet& P, u16 type)
178178
{
179179
P.r_u16 (id);
180180
Obj = Level().Objects.net_Find (id);
181+
182+
if (!Obj) {
183+
Msg("! [%s] Error: No object to reject/sell [%u]", __FUNCTION__, id);
184+
break;
185+
}
186+
181187
bool just_before_destroy = !P.r_eof() && P.r_u8();
182188
bool dont_create_shell = (type == GE_TRADE_SELL) || (type == GE_TRANSFER_REJECT) || just_before_destroy;
183189
Obj->SetTmpPreDestroy (just_before_destroy);

0 commit comments

Comments
 (0)