This commit is contained in:
aozhiwei 2023-02-07 14:38:34 +08:00
parent deff3d58f4
commit 8e27c5b1de
2 changed files with 16 additions and 1 deletions

View File

@ -4,10 +4,16 @@
#include "debugcmd.h"
#include "cs_proto.pb.h"
#include "player.h"
#include "app.h"
static bool EnableDebug()
{
return App::Instance()->instance_id == 6;
}
void DebugCmd::CreateSphere(Creature* c, float x, float y, float z)
{
if (c->IsPlayer()) {
if (c->IsPlayer() && EnableDebug()) {
cs::SMDebugCmd msg;
msg.set_cmd("create_sphere");
msg.add_params(x);

View File

@ -10,6 +10,7 @@
#include "car.h"
#include "trigger.h"
#include "buff.h"
#include "debugcmd.h"
#include "mt/Param.h"
#include "mt/Hero.h"
@ -236,6 +237,14 @@ static void InternalCreateBullet(BulletInfo& bullet_info)
});
}
#endif
#ifdef DEBUG
DebugCmd::CreateSphere(c,
bullet_info.bullet_born_pos.x,
bullet_info.bullet_born_pos.y,
bullet_info.bullet_born_pos.z);
#endif
c->room->frame_event.AddBullet
(bullet_uniid,
c->GetWeakPtrRef(),