New API for assigning unique network ids to objects
This commit is contained in:
parent
111fd48348
commit
8d0d130dc9
11 changed files with 233 additions and 1 deletions
|
|
@ -101,6 +101,7 @@
|
|||
#include "fragglescript/t_fs.h"
|
||||
#include "shadowinlines.h"
|
||||
#include "model.h"
|
||||
#include "d_net.h"
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
||||
|
|
@ -179,6 +180,23 @@ IMPLEMENT_POINTERS_START(AActor)
|
|||
IMPLEMENT_POINTER(boneComponentData)
|
||||
IMPLEMENT_POINTERS_END
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Make sure Actors can never have their networking disabled.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void AActor::EnableNetworking(const bool enable)
|
||||
{
|
||||
if (!enable)
|
||||
{
|
||||
ThrowAbortException(X_OTHER, "Cannot disable networking on Actors. Consider a Thinker instead.");
|
||||
return;
|
||||
}
|
||||
|
||||
Super::EnableNetworking(true);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// AActor :: Serialize
|
||||
|
|
@ -4830,6 +4848,7 @@ AActor *AActor::StaticSpawn(FLevelLocals *Level, PClassActor *type, const DVecto
|
|||
AActor *actor;
|
||||
|
||||
actor = static_cast<AActor *>(Level->CreateThinker(type));
|
||||
actor->EnableNetworking(true);
|
||||
|
||||
ConstructActor(actor, pos, SpawningMapThing);
|
||||
return actor;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue