Thread: [Matrix] Region Spawn Objects Issue

Results 1 to 3 of 3
  1. #1 [Matrix] Region Spawn Objects Issue 
    Donator
    The Stoned's Avatar
    Join Date
    Jan 2013
    Posts
    619
    Thanks given
    56
    Thanks received
    76
    Rep Power
    58
    I can't quite figure out why I can't walk into a certain region. For an example, if I walk towards edgeville from the loadstone the player stops in his tracks and wont go past a certain line. The server spits out this error message

    here is the code and the line highlighted is causing the issue, i just don't know why.
    Code:
     public void spawnObject(WorldObject object, int plane, int localX, int localY, boolean original) {
    	if (objects == null)
    	    objects = new WorldObject[4][64][64][4];
    	int slot = OBJECT_SLOTS[object.getType()];
    	if (original) {
    	    objects[plane][localX][localY][slot] = object;
    	    clip(object, localX, localY);
    	} else {
    	    WorldObject spawned = getSpawnedObjectWithSlot(plane, localX, localY, slot);
    	    // found non original object on this slot. removing it since we
    	    // replacing with a new non original
    	    if (spawned != null) {
    		spawnedObjects.remove(spawned);
    		// unclips non orignal old object which had been cliped so can
    		// clip the new non original
    		unclip(spawned, localX, localY);
    	    }
    	    WorldObject removed = getRemovedObjectWithSlot(plane, localX, localY, slot);
    	    // there was a original object removed. lets readd it
    	    if (removed != null) {
    		object = removed;
    		removedOriginalObjects.remove(object);
    		// adding non original object to this place
    	    } else if (objects[plane][localX][localY][slot] != object) {
    		spawnedObjects.add(object);
    		// unclips orignal old object which had been cliped so can clip
    		// the new non original
    		if (objects[plane][localX][localY][slot] != null)
    		    unclip(objects[plane][localX][localY][slot], localX, localY);
    	    } else if(spawned == null) {
    		   if (Settings.DEBUG)
    			Logger.log(this, "Requested object to spawn is already spawned.(Shouldnt happen)");
    		return;
    	    }
    	    // clips spawned object(either original or non original)
    	    clip(object, localX, localY);
    	    for (Player p2 : World.getPlayers()) {
    		if (p2 == null || !p2.hasStarted() || p2.hasFinished() || !p2.getMapRegionsIds().contains(regionId))
    		    continue;
    		p2.getPackets().sendSpawnedObject(object);
    	    }
    	}
        }
    here is the World.java version.
    Code:
     public static final void spawnObject(WorldObject object) {
    	getRegion(object.getRegionId()).spawnObject(object, object.getPlane(), object.getXInRegion(), object.getYInRegion(), false);
        }
    Reply With Quote  
     

  2. #2  
    Donator
    The Stoned's Avatar
    Join Date
    Jan 2013
    Posts
    619
    Thanks given
    56
    Thanks received
    76
    Rep Power
    58
    anyone?
    Reply With Quote  
     

  3. #3  
    私はちょうど何が重要か

    Jae`'s Avatar
    Join Date
    Mar 2012
    Posts
    1,496
    Thanks given
    236
    Thanks received
    246
    Rep Power
    79
    you have a problem with the array, you're accessing an illegal index.

    [Only registered and activated users can see links. ]
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [Matrix/718] Custom object spawns
    By Linus in forum Configuration
    Replies: 17
    Last Post: 07-20-2017, 05:14 PM
  2. {request} noclip+spawn object in client
    By a r a b i c in forum Requests
    Replies: 0
    Last Post: 05-01-2009, 12:05 PM
  3. Replies: 12
    Last Post: 04-23-2009, 08:11 AM
  4. spawning objects
    By harmy in forum Help
    Replies: 4
    Last Post: 03-25-2009, 04:37 AM
  5. object issue
    By gamerx in forum Help
    Replies: 2
    Last Post: 11-25-2008, 02:30 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •