Was missing the name attribute.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@752 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: SpotSceneWriter.java,v 1.5 2001/12/07 05:11:25 mdb Exp $
|
||||
// $Id: SpotSceneWriter.java,v 1.6 2001/12/07 05:14:57 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.tools.spot.xml;
|
||||
|
||||
@@ -65,18 +65,25 @@ public class SpotSceneWriter extends SceneWriter
|
||||
EditablePortal port = (EditablePortal)iter.next();
|
||||
AttributesImpl attrs = new AttributesImpl();
|
||||
addSharedAttrs(attrs, port);
|
||||
if (port.targetSceneName != null) {
|
||||
attrs.addAttribute("", "targetSceneName", "", "",
|
||||
port.targetSceneName);
|
||||
}
|
||||
if (port.targetPortalName != null) {
|
||||
attrs.addAttribute("", "targetPortalName", "", "",
|
||||
port.targetPortalName);
|
||||
}
|
||||
maybeAddAttr(attrs, "name", port.name);
|
||||
maybeAddAttr(attrs, "targetSceneName", port.targetSceneName);
|
||||
maybeAddAttr(attrs, "targetPortalName", port.targetPortalName);
|
||||
writer.emptyElement("", "portal", "", attrs);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the supplied attribute to the attributes object iff the value
|
||||
* is non-null.
|
||||
*/
|
||||
protected void maybeAddAttr (
|
||||
AttributesImpl attrs, String name, String value)
|
||||
{
|
||||
if (value != null) {
|
||||
attrs.addAttribute("", name, "", "", value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the attributes that are shared between location and portal
|
||||
* elements.
|
||||
|
||||
Reference in New Issue
Block a user