Skip to content

Commit c5cbc9e

Browse files
authored
Merge pull request #146 from revolucas/dev
CDestroyablePhysicsObject: Fix incorrect type passed to GameObject::e…
2 parents e9bc987 + 266f6bb commit c5cbc9e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,16 @@ void CRender::LoadBuffers (CStreamReader *base_fs)
177177
u32 count = fs->r_u32();
178178
DCL.resize (count);
179179
VB.resize (count);
180+
181+
u32 buffer_size = (MAXD3DDECLLENGTH+1)*sizeof(D3DVERTEXELEMENT9);
182+
D3DVERTEXELEMENT9 *dcl = (D3DVERTEXELEMENT9*)_alloca(buffer_size);
183+
180184
for (u32 i=0; i<count; i++)
181185
{
182186
// decl
183187

184188
// D3DVERTEXELEMENT9 *dcl = (D3DVERTEXELEMENT9*) fs->pointer();
185-
u32 buffer_size = (MAXD3DDECLLENGTH+1)*sizeof(D3DVERTEXELEMENT9);
186-
D3DVERTEXELEMENT9 *dcl = (D3DVERTEXELEMENT9*)_alloca(buffer_size);
189+
187190
fs->r (dcl,buffer_size);
188191
fs->advance (-(int)buffer_size);
189192

src/xrGame/DestroyablePhysicsObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void CDestroyablePhysicsObject::Destroy()
9999
{
100100
VERIFY(!physics_world()->Processing());
101101
const CGameObject *who_object = smart_cast<const CGameObject*>(FatalHit().initiator());
102-
callback(GameObject::eDeath)(lua_game_object(),who_object ? who_object : 0);
102+
callback(GameObject::eDeath)(lua_game_object(),who_object ? who_object->lua_game_object() : 0);
103103
CPHDestroyable::Destroy(ID(),"physic_destroyable_object");
104104
if(m_destroy_sound._handle())
105105
{

0 commit comments

Comments
 (0)