Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bug fix.

  • Loading branch information...
commit 74ff4ba709e2740afd599366e8c2c9b76bebb1b7 1 parent 482d21a
@bluemarvin bluemarvin authored
Showing with 19 additions and 19 deletions.
  1. +19 −19 scripts/mcp.js
View
38 scripts/mcp.js
@@ -70,8 +70,21 @@ createStartPoints = function () {
assignPointsToCycles = function () {
var count = 0
, cycle
+ , setPoint
;
+ setPoint = function (cycle, count) {
+ cycle.point = StartPoints[count];
+ dmz.object.link(
+ dmz.consts.StartLinkHandle,
+ cycle.point.handle,
+ cycle.handle);
+ // Adding to the objs counter will cause the network rules to
+ // send the packet immediately instead of waiting for the one second
+ // heartbeat as specified in the net rules for this obj type.
+ dmz.object.addToCounter(cycle.point.handle, dmz.consts.StartLinkHandle);
+ }
+
PlayerCount = 0;
Object.keys(CycleList).forEach(function (key) {
cycle = CycleList[key];
@@ -85,15 +98,7 @@ assignPointsToCycles = function () {
cycle = CycleList[key];
if (count < MaxCycles) {
if (!cycle.drone) {
- cycle.point = StartPoints[count];
- dmz.object.link(
- dmz.consts.StartLinkHandle,
- cycle.point.handle,
- parseInt(key));
- // Adding to the objs counter will cause the network rules to
- // send the packet immediately instead of waiting for the one second
- // heartbeat as specified in the net rules for this obj type.
- dmz.object.addToCounter(cycle.point.handle, dmz.consts.StartLinkHandle);
+ setPoint (cycle, count);
PlayerCount += 1;
count += 1;
}
@@ -104,15 +109,7 @@ assignPointsToCycles = function () {
cycle = CycleList[key];
if (count < MaxCycles) {
if (cycle.drone) {
- cycle.point = StartPoints[count];
- dmz.object.link(
- dmz.consts.StartLinkHandle,
- cycle.point.handle,
- parseInt(key));
- // Adding to the objs counter will cause the network rules to
- // send the packet immediately instead of waiting for the one second
- // heartbeat as specified in the net rules for this obj type.
- dmz.object.addToCounter(cycle.point.handle, dmz.consts.StartLinkHandle);
+ setPoint (cycle, count);
PlayerCount += 1;
count += 1;
}
@@ -239,7 +236,10 @@ updateTimeSlice = function (time) {
dmz.object.create.observe(self, function (obj, Type) {
if (Type.isOfType(dmz.consts.CycleType)) {
- CycleList[obj] = { drone: dmz.object.flag(obj, dmz.consts.DroneHandle) };
+ CycleList[obj] =
+ { handle: obj
+ , drone: dmz.object.flag(obj, dmz.consts.DroneHandle)
+ };
CycleCount += 1;
AssignPoints = true;
}
Please sign in to comment.
Something went wrong with that request. Please try again.