Let's do our adding in a single event.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5580 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -316,17 +316,21 @@ public class PlaceManager
|
|||||||
*/
|
*/
|
||||||
public void bodyWillEnter (BodyObject body)
|
public void bodyWillEnter (BodyObject body)
|
||||||
{
|
{
|
||||||
// create a new occupant info instance
|
// create a new occupant info instance and insert it into our canonical table
|
||||||
OccupantInfo info = body.createOccupantInfo(_plobj);
|
OccupantInfo info = body.createOccupantInfo(_plobj);
|
||||||
|
|
||||||
// insert the occupant info into our canonical table
|
|
||||||
_occInfo.put(info.getBodyOid(), info);
|
_occInfo.put(info.getBodyOid(), info);
|
||||||
|
|
||||||
// clone the canonical copy and insert it into the DSet
|
_plobj.startTransaction();
|
||||||
_plobj.addToOccupantInfo((OccupantInfo)info.clone());
|
try {
|
||||||
|
// clone the canonical copy and insert it into the DSet
|
||||||
|
_plobj.addToOccupantInfo((OccupantInfo)info.clone());
|
||||||
|
|
||||||
// add the body oid to our place object's occupant list
|
// add the body oid to our place object's occupant list
|
||||||
_plobj.addToOccupants(body.getOid());
|
_plobj.addToOccupants(body.getOid());
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
_plobj.commitTransaction();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user