Skip to content

Commit

Permalink
Merge pull request #146 from revolucas/dev
Browse files Browse the repository at this point in the history
CDestroyablePhysicsObject: Fix incorrect type passed to GameObject::e…
  • Loading branch information
CasualDev242 committed Sep 12, 2016
2 parents e9bc987 + 266f6bb commit c5cbc9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,16 @@ void CRender::LoadBuffers (CStreamReader *base_fs)
u32 count = fs->r_u32();
DCL.resize (count);
VB.resize (count);

u32 buffer_size = (MAXD3DDECLLENGTH+1)*sizeof(D3DVERTEXELEMENT9);
D3DVERTEXELEMENT9 *dcl = (D3DVERTEXELEMENT9*)_alloca(buffer_size);

for (u32 i=0; i<count; i++)
{
// decl

// D3DVERTEXELEMENT9 *dcl = (D3DVERTEXELEMENT9*) fs->pointer();
u32 buffer_size = (MAXD3DDECLLENGTH+1)*sizeof(D3DVERTEXELEMENT9);
D3DVERTEXELEMENT9 *dcl = (D3DVERTEXELEMENT9*)_alloca(buffer_size);

fs->r (dcl,buffer_size);
fs->advance (-(int)buffer_size);

Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/DestroyablePhysicsObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void CDestroyablePhysicsObject::Destroy()
{
VERIFY(!physics_world()->Processing());
const CGameObject *who_object = smart_cast<const CGameObject*>(FatalHit().initiator());
callback(GameObject::eDeath)(lua_game_object(),who_object ? who_object : 0);
callback(GameObject::eDeath)(lua_game_object(),who_object ? who_object->lua_game_object() : 0);
CPHDestroyable::Destroy(ID(),"physic_destroyable_object");
if(m_destroy_sound._handle())
{
Expand Down

0 comments on commit c5cbc9e

Please sign in to comment.