Browse Source

don't send scenario index; it's always zero

Darren Ranalli 21 years ago
parent
commit
d0101e74ef
2 changed files with 15 additions and 1 deletions
  1. 11 0
      direct/src/level/DistributedLevel.py
  2. 4 1
      direct/src/level/DistributedLevelAI.py

+ 11 - 0
direct/src/level/DistributedLevel.py

@@ -63,6 +63,7 @@ class DistributedLevel(DistributedObject.DistributedObject,
             )
         self.zonesEnteredList = []
         self.fColorZones = 0
+        self.scenarioIndex = 0
 
     def generate(self):
         DistributedLevel.notify.debug('generate')
@@ -118,6 +119,15 @@ class DistributedLevel(DistributedObject.DistributedObject,
         DistributedLevel.notify.debug('setStartTimestamp: %s' % timestamp)
         self.startTime = globalClockDelta.networkToLocalTime(timestamp,bits=32)
 
+        # ugly hack: we treat a few DC fields as if they were required,
+        # and use 'levelAnnounceGenerate()' in place of regular old
+        # announceGenerate(). Note that we have to call
+        # gotAllRequired() in the last 'faux-required' DC update
+        # handler. If you add another field, move this to the last one.
+        self.privGotAllRequired()
+
+        """
+        # this is no longer used
     def setScenarioIndex(self, scenarioIndex):
         self.scenarioIndex = scenarioIndex
 
@@ -127,6 +137,7 @@ class DistributedLevel(DistributedObject.DistributedObject,
         # gotAllRequired() in the last 'faux-required' DC update
         # handler. If you add another field, move this to the last one.
         self.privGotAllRequired()
+        """
 
     def privGotAllRequired(self):
         self.levelAnnounceGenerate()

+ 4 - 1
direct/src/level/DistributedLevelAI.py

@@ -40,7 +40,10 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI,
 
         self.sendUpdate('setZoneIds', [self.zoneIds])
         self.sendUpdate('setStartTimestamp', [self.startTimestamp])
-        self.sendUpdate('setScenarioIndex', [self.scenarioIndex])
+        # this is no longer used
+        #self.sendUpdate('setScenarioIndex', [self.scenarioIndex])
+        if __dev__:
+            assert self.scenarioIndex == 0
 
     def getLevelZoneId(self):
         """no entities should be generated in the level's zone; it causes