diff --git a/src/dobjgc.h b/src/dobjgc.h index a7b804b80e..79316da0d1 100644 --- a/src/dobjgc.h +++ b/src/dobjgc.h @@ -201,7 +201,12 @@ public: o = nullptr; return *this; } - + + T Get() throw() + { + return GC::ReadBarrier(pp); + } + operator T() throw() { return GC::ReadBarrier(pp); diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 54ecfa7071..ab64fcb897 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -9096,7 +9096,7 @@ scriptwait: break; case PCD_CLEARINVENTORY: - ScriptUtil::Exec(NAME_ClearInventory, ScriptUtil::Pointer, activator, ScriptUtil::End); + ScriptUtil::Exec(NAME_ClearInventory, ScriptUtil::Pointer, activator.Get(), ScriptUtil::End); break; case PCD_CLEARACTORINVENTORY: @@ -9119,7 +9119,7 @@ scriptwait: case PCD_GIVEINVENTORY: { int typeindex = FName(Level->Behaviors.LookupString(STACK(2))).GetIndex(); - ScriptUtil::Exec(NAME_GiveInventory, ScriptUtil::Pointer, activator, ScriptUtil::Int, typeindex, ScriptUtil::Int, STACK(1), ScriptUtil::End); + ScriptUtil::Exec(NAME_GiveInventory, ScriptUtil::Pointer, activator.Get(), ScriptUtil::Int, typeindex, ScriptUtil::Int, STACK(1), ScriptUtil::End); sp -= 2; break; } @@ -9148,7 +9148,7 @@ scriptwait: case PCD_GIVEINVENTORYDIRECT: { int typeindex = FName(Level->Behaviors.LookupString(TAGSTR(uallong(pc[0])))).GetIndex(); - ScriptUtil::Exec(NAME_GiveInventory, ScriptUtil::Pointer, activator, ScriptUtil::Int, typeindex, ScriptUtil::Int, uallong(pc[1]), ScriptUtil::End); + ScriptUtil::Exec(NAME_GiveInventory, ScriptUtil::Pointer, activator.Get(), ScriptUtil::Int, typeindex, ScriptUtil::Int, uallong(pc[1]), ScriptUtil::End); pc += 2; break; } @@ -9156,7 +9156,7 @@ scriptwait: case PCD_TAKEINVENTORY: { int typeindex = FName(Level->Behaviors.LookupString(STACK(2))).GetIndex(); - ScriptUtil::Exec(NAME_TakeInventory, ScriptUtil::Pointer, activator, ScriptUtil::Int, typeindex, ScriptUtil::Int, STACK(1), ScriptUtil::End); + ScriptUtil::Exec(NAME_TakeInventory, ScriptUtil::Pointer, activator.Get(), ScriptUtil::Int, typeindex, ScriptUtil::Int, STACK(1), ScriptUtil::End); sp -= 2; break; } @@ -9185,7 +9185,7 @@ scriptwait: case PCD_TAKEINVENTORYDIRECT: { int typeindex = FName(Level->Behaviors.LookupString(TAGSTR(uallong(pc[0])))).GetIndex(); - ScriptUtil::Exec(NAME_TakeInventory, ScriptUtil::Pointer, activator, ScriptUtil::Int, typeindex, ScriptUtil::Int, uallong(pc[1]), ScriptUtil::End); + ScriptUtil::Exec(NAME_TakeInventory, ScriptUtil::Pointer, activator.Get(), ScriptUtil::Int, typeindex, ScriptUtil::Int, uallong(pc[1]), ScriptUtil::End); pc += 2; break; } @@ -9617,16 +9617,16 @@ scriptwait: break; case PCD_SETWEAPON: - STACK(1) = ScriptUtil::Exec(NAME_SetWeapon, ScriptUtil::Pointer, activator, ScriptUtil::Class, GetClassForIndex(STACK(1)), ScriptUtil::End); + STACK(1) = ScriptUtil::Exec(NAME_SetWeapon, ScriptUtil::Pointer, activator.Get(), ScriptUtil::Class, GetClassForIndex(STACK(1)), ScriptUtil::End); break; case PCD_SETMARINEWEAPON: - ScriptUtil::Exec(NAME_SetMarineWeapon, ScriptUtil::Pointer, Level, ScriptUtil::Pointer, activator, ScriptUtil::Int, STACK(2), ScriptUtil::Int, STACK(1), ScriptUtil::End); + ScriptUtil::Exec(NAME_SetMarineWeapon, ScriptUtil::Pointer, Level, ScriptUtil::Pointer, activator.Get(), ScriptUtil::Int, STACK(2), ScriptUtil::Int, STACK(1), ScriptUtil::End); sp -= 2; break; case PCD_SETMARINESPRITE: - ScriptUtil::Exec(NAME_SetMarineSprite, ScriptUtil::Pointer, Level, ScriptUtil::Pointer, activator, ScriptUtil::Int, STACK(2), ScriptUtil::Class, GetClassForIndex(STACK(1)), ScriptUtil::End); + ScriptUtil::Exec(NAME_SetMarineSprite, ScriptUtil::Pointer, Level, ScriptUtil::Pointer, activator.Get(), ScriptUtil::Int, STACK(2), ScriptUtil::Class, GetClassForIndex(STACK(1)), ScriptUtil::End); sp -= 2; break;