mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-09-21 06:13:13 -04:00
Added /teleporttarget GM command
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import sys
|
||||
from engine.resources.scene import Point3D
|
||||
|
||||
def setup():
|
||||
return
|
||||
|
||||
def run(core, actor, target, commandString):
|
||||
|
||||
playerObject = actor.getSlottedObject('ghost')
|
||||
|
||||
if not playerObject:
|
||||
return
|
||||
|
||||
commandArgs = commandString.split(' ')
|
||||
if len(commandArgs) > 0:
|
||||
arg1 = commandArgs[0]
|
||||
if len(commandArgs) > 1:
|
||||
arg2 = commandArgs[1]
|
||||
if len(commandArgs) > 2:
|
||||
arg3 = commandArgs[2]
|
||||
if len(commandArgs) > 3:
|
||||
arg4 = commandArgs[3]
|
||||
|
||||
if arg1 and arg2 and arg3 and arg4 target:
|
||||
position = Point3D(float(arg2), float(arg3), float(arg4))
|
||||
core.simulationService.transferToPlanet(target, core.terrainService.getPlanetByName(arg1), position, actor.getOrientation(), None)
|
||||
|
||||
|
||||
return
|
||||
@@ -167,6 +167,7 @@ public class SimulationService implements INetworkDispatch {
|
||||
core.commandService.registerCommand("requestbiography");
|
||||
core.commandService.registerCommand("eject");
|
||||
core.commandService.registerGmCommand("broadcast");
|
||||
core.commandService.registerGmCommand("teleporttarget");
|
||||
|
||||
}
|
||||
|
||||
@@ -958,7 +959,7 @@ public class SimulationService implements INetworkDispatch {
|
||||
for(Mesh3DTriangle tri : tris) {
|
||||
|
||||
if(ray.intersectsTriangle(tri, distance) != null) {
|
||||
System.out.println("Collision took: " + (System.nanoTime() - startTime) + " ns (collided)");
|
||||
//System.out.println("Collision took: " + (System.nanoTime() - startTime) + " ns (collided)");
|
||||
// System.out.println("Collided with " + object.getTemplate() + " X: " + object.getPosition().x + " Y: " + object.getPosition().y + " Z: " + object.getPosition().z);
|
||||
return false;
|
||||
}
|
||||
@@ -990,11 +991,11 @@ public class SimulationService implements INetworkDispatch {
|
||||
int height = (int) core.terrainService.getHeight(obj1.getPlanetId(), segment.x, segment.z); // round down to int
|
||||
|
||||
if(height > y) {
|
||||
System.out.println("Collision took: " + (System.nanoTime() - startTime) + " ns (terrain collision)");
|
||||
//System.out.println("Collision took: " + (System.nanoTime() - startTime) + " ns (terrain collision)");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
System.out.println("Collision took: " + (System.nanoTime() - startTime) + " ns (did not collide)");
|
||||
//System.out.println("Collision took: " + (System.nanoTime() - startTime) + " ns (did not collide)");
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user