@@ -2317,7 +2317,9 @@ void Entity::teleportRefEntity(Entity* entity, Position3D& pos, Direction3D& dir
2317
2317
{
2318
2318
if (entity == NULL )
2319
2319
{
2320
- ERROR_MSG (" Entity::teleport: nearbyEntityRef is null!\n " );
2320
+ ERROR_MSG (boost::format (" %1%::teleport: %2%, nearbyEntityRef is null!\n " ) %
2321
+ this ->getScriptName () % getID ());
2322
+
2321
2323
onTeleportFailure ();
2322
2324
return ;
2323
2325
}
@@ -2360,11 +2362,13 @@ void Entity::teleportRefEntity(Entity* entity, Position3D& pos, Direction3D& dir
2360
2362
{
2361
2363
if (space != NULL )
2362
2364
{
2363
- ERROR_MSG (" Entity::teleport: nearbyEntityRef is spaceEntity, spaceEntity is destroyed!\n " );
2365
+ ERROR_MSG (boost::format (" %1%::teleport(): %2%, nearbyEntityRef is spaceEntity, spaceEntity is destroyed!\n " ) %
2366
+ this ->getScriptName () % getID ());
2364
2367
}
2365
2368
else
2366
2369
{
2367
- ERROR_MSG (boost::format (" Entity::teleport: not found space(%1%)!\n " ) % spaceID);
2370
+ ERROR_MSG (boost::format (" %1%::teleport(): %2%, not found space(%3%)!\n " ) %
2371
+ this ->getScriptName () % getID () % spaceID);
2368
2372
}
2369
2373
2370
2374
onTeleportFailure ();
@@ -2407,14 +2411,18 @@ void Entity::onTeleportRefMailbox(EntityMailbox* nearbyMBRef, Position3D& pos, D
2407
2411
PyObject* pyret = PyObject_GetAttrString (nearbyMBRef, const_cast <char *>(" cell" ));
2408
2412
if (pyret == NULL )
2409
2413
{
2410
- ERROR_MSG (" Entity::teleportRefMailbox: nearbyRef is error, not found cellMailbox!\n " );
2414
+ ERROR_MSG (boost::format (" %1%::teleportRefMailbox(): %2%, nearbyRef is error, not found cellMailbox!\n " ) %
2415
+ this ->getScriptName () % getID ());
2416
+
2411
2417
onTeleportFailure ();
2412
2418
return ;
2413
2419
}
2414
2420
2415
2421
if (pyret == Py_None)
2416
2422
{
2417
- ERROR_MSG (" Entity::teleportRefMailbox: nearbyRef is error, not found cellMailbox!\n " );
2423
+ ERROR_MSG (boost::format (" %1%::teleportRefMailbox(): %2%, nearbyRef is error, not found cellMailbox!\n " ) %
2424
+ this ->getScriptName () % getID ());
2425
+
2418
2426
onTeleportFailure ();
2419
2427
Py_DECREF (pyret);
2420
2428
return ;
@@ -2463,7 +2471,9 @@ void Entity::onReqTeleportOtherAck(Mercury::Channel* pChannel, ENTITY_ID nearbyM
2463
2471
// 目的space错误
2464
2472
if (destSpaceID == 0 )
2465
2473
{
2466
- ERROR_MSG (" Entity::onReqTeleportOtherAck: not found destSpace!\n " );
2474
+ ERROR_MSG (boost::format (" %1%::onReqTeleportOtherAck(): %2%, not found destSpace!\n " ) %
2475
+ this ->getScriptName () % getID ());
2476
+
2467
2477
onTeleportFailure ();
2468
2478
return ;
2469
2479
}
@@ -2570,7 +2580,9 @@ void Entity::teleport(PyObject_ptr nearbyMBRef, Position3D& pos, Direction3D& di
2570
2580
else
2571
2581
{
2572
2582
// 如果不是entity, 也不是mailbox同时也不是None? 那肯定是输入错误
2573
- ERROR_MSG (" Entity::teleport: nearbyRef is error!\n " );
2583
+ ERROR_MSG (boost::format (" %1%::teleport(): %2%, nearbyRef is error!\n " ) %
2584
+ this ->getScriptName () % getID ());
2585
+
2574
2586
onTeleportFailure ();
2575
2587
}
2576
2588
}
@@ -2589,6 +2601,9 @@ void Entity::onTeleport()
2589
2601
// -------------------------------------------------------------------------------------
2590
2602
void Entity::onTeleportFailure ()
2591
2603
{
2604
+ ERROR_MSG (boost::format (" %1%::onTeleportFailure(): entityID=%2%\n " ) %
2605
+ this ->getScriptName () % getID ());
2606
+
2592
2607
SCOPED_PROFILE (SCRIPTCALL_PROFILE);
2593
2608
2594
2609
SCRIPT_OBJECT_CALL_ARGS0 (this , const_cast <char *>(" onTeleportFailure" ));
@@ -2839,6 +2854,7 @@ void Entity::addToStream(KBEngine::MemoryStream& s)
2839
2854
2840
2855
uint32 size = witnesses_count_;
2841
2856
s << size;
2857
+
2842
2858
std::list<ENTITY_ID>::iterator iter = witnesses_.begin ();
2843
2859
for (; iter != witnesses_.end (); iter++)
2844
2860
{
@@ -2872,13 +2888,13 @@ void Entity::addToStream(KBEngine::MemoryStream& s)
2872
2888
// -------------------------------------------------------------------------------------
2873
2889
void Entity::createFromStream (KBEngine::MemoryStream& s)
2874
2890
{
2875
- ENTITY_SCRIPT_UID sid ;
2891
+ ENTITY_SCRIPT_UID scriptUType ;
2876
2892
COMPONENT_ID baseMailboxComponentID;
2877
2893
2878
- s >> sid >> spaceID_ >> isDestroyed_ >> isOnGround_ >> topSpeed_ >>
2894
+ s >> scriptUType >> spaceID_ >> isDestroyed_ >> isOnGround_ >> topSpeed_ >>
2879
2895
topSpeedY_ >> shouldAutoBackup_ >> layer_ >> baseMailboxComponentID;
2880
2896
2881
- this ->scriptModule_ = EntityDef::findScriptModule (sid );
2897
+ this ->scriptModule_ = EntityDef::findScriptModule (scriptUType );
2882
2898
2883
2899
// 设置entity的baseMailbox
2884
2900
if (baseMailboxComponentID > 0 )
0 commit comments