+/*
+ * re-attatches addon_reg pointers on the remote client if we have the same
+ * world loaded.
+ */
+static void relink_remote_player_worlds( u32 client_id ){
+ struct network_player *player = &netplayers.list[client_id];
+
+ player->hub_match = 0;
+ player->client_match = 0;
+
+ addon_alias q0,q1;
+ addon_uid_to_alias( player->items[k_netmsg_playeritem_world0], &q0 );
+ addon_uid_to_alias( player->items[k_netmsg_playeritem_world1], &q1 );
+
+ /*
+ * currently in 10.23, the hub world will always be the same.
+ * this might but probably wont change in the future
+ */
+ if( world_static.addon_hub )
+ if( addon_alias_eq( &q0, &world_static.addon_hub->alias ) )
+ player->hub_match = 1;
+
+ if( world_static.addon_client )
+ if( addon_alias_eq( &q1, &world_static.addon_client->alias ) )
+ player->client_match = 1;
+}
+
+/*
+ * re-attatches addon_reg pointers on the remote client if we have the mod
+ * installed locally.
+ *
+ * Run if local worlds change
+ */
+static void relink_all_remote_player_worlds(void){
+ for( u32 i=0; i<vg_list_size(netplayers.list); i++ ){
+ struct network_player *player = &netplayers.list[i];
+ if( player->active )
+ relink_remote_player_worlds(i);
+ }
+}
+