repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 8bcd8e2637b49238e0782964f216f6feb0c4596b:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 8bcd8e2637b49238e0782964f216f6feb0c4596b
Author: James Baicoianu 
Date:   Mon May 27 13:33:08 2024 -0700

    Improved URL hash handling logic

diff --git a/scripts/janusweb.js b/scripts/janusweb.js
index 2ce52e10f98cc4f7c5944bbcf3195a26ff0c678f..
index ..e7ff33cb2dc775634ca4dedc90b91863d164ded6 100644
--- a/scripts/janusweb.js
+++ b/scripts/janusweb.js
@@ -485,9 +485,22 @@ elation.require([
         var hashurl = hashargs['janus.url'];
         if (hashurl && hashurl != this.properties.url && !this.loading) {
           this.setActiveRoom(hashurl, this.currentroom.url, true);
-        } else if (!hashurl && this.properties.url != this.homepage && !document.location.hash) {
+        } else if (!hashurl && this.properties.url != this.homepage) { // && !document.location.hash) {
           this.setActiveRoom(this.homepage);
         }
+        if (document.location.hash && document.location.hash.substr(1) in room.objects) {
+          let jumpto = room.objects[document.location.hash.substr(1)];
+          if (typeof jumpto.activate == 'function') {
+            jumpto.activate();
+          } else if (typeof jumpto.navigate == 'function') {
+            jumpto.navigate();
+          } else {
+            player.pos = jumpto.pos;
+            player.xdir.copy(jumpto.xdir);
+            player.ydir.copy(jumpto.ydir);
+            player.zdir.copy(jumpto.zdir);
+          }
+        }
       }
     }

-----END OF PAGE-----