@@ -278,16 +278,6 @@ static int ODOOM_GetRawKeyDown(int vk_or_ascii)
278278#endif
279279}
280280
281- /* * Return true if item name is in the cached inventory (avoids main-thread API call when cache is valid). */
282- static bool ODOOM_CachedHasItem (const char * keyname) {
283- if (!keyname || !g_odoom_cached_inventory) return false ;
284- for (size_t i = 0 ; i < g_odoom_cached_inventory->count ; i++) {
285- if (strcmp (g_odoom_cached_inventory->items [i].name , keyname) == 0 )
286- return true ;
287- }
288- return false ;
289- }
290-
291281/* * Start background inventory sync if we have pending items and no sync in progress. */
292282static void ODOOM_StartInventorySyncIfNeeded (void ) {
293283 if (!g_star_initialized || star_sync_inventory_in_progress ())
@@ -310,9 +300,9 @@ static void ODOOM_StartInventorySyncIfNeeded(void) {
310300 * star_sync uses background threads for auth and (in OQuake) inventory; direct star_api_* calls run on the calling thread. */
311301static void ODOOM_STAR_PollAsyncAuth (void )
312302{
313- /* When not pending, only poll every 12th frame (~5 Hz) to reduce overhead; when pending, poll every frame. */
303+ /* When not pending, only poll every 6th frame (~10 Hz) to reduce overhead; when pending, poll every frame. */
314304 static int s_auth_poll_skip = 0 ;
315- if (!g_star_async_auth_pending && (s_auth_poll_skip++ % 12 != 0 ))
305+ if (!g_star_async_auth_pending && (s_auth_poll_skip++ % 6 != 0 ))
316306 return ;
317307 if (star_sync_auth_poll () != 1 )
318308 return ;
@@ -342,8 +332,6 @@ static void ODOOM_STAR_PollAsyncAuth(void)
342332 if (g_star_client_ready && !star_sync_inventory_in_progress ())
343333 star_sync_inventory_start (nullptr , 0 , " ODOOM" , nullptr , nullptr );
344334 Printf (PRINT_NONOTIFY, " Beam-in successful. Cross-game features enabled.\n " );
345- if (!g_star_effective_avatar_id.empty ())
346- Printf (PRINT_NONOTIFY, " STAR: avatar_id set (use same login in OQuake for shared inventory).\n " );
347335 } else {
348336 Printf (PRINT_NONOTIFY, " Beam-in failed: %s\n " , error_buf[0 ] ? error_buf : star_api_get_last_error ());
349337 }
@@ -353,15 +341,8 @@ void ODOOM_InventoryInputCaptureFrame(void)
353341{
354342 ODOOM_STAR_PollAsyncAuth ();
355343
356- /* Poll async inventory (background thread); when idle poll less often to reduce lock contention. */
357- static int s_inv_poll_skip = 0 ;
358- int inv_poll = -1 ;
359- if (g_odoom_in_flight_count > 0 || g_odoom_pending_sync_count > 0 )
360- inv_poll = star_sync_inventory_poll ();
361- else if (star_sync_inventory_in_progress ())
362- inv_poll = star_sync_inventory_poll ();
363- else if ((s_inv_poll_skip++ % 8 ) == 0 )
364- inv_poll = star_sync_inventory_poll ();
344+ /* Poll async inventory (background thread); cache result and start next batch if pending. */
345+ int inv_poll = star_sync_inventory_poll ();
365346 if (inv_poll == 1 ) {
366347 star_item_list_t * list = nullptr ;
367348 star_api_result_t res = STAR_API_ERROR_API_ERROR;
@@ -1097,10 +1078,9 @@ int UZDoom_STAR_CheckDoorAccess(struct AActor* owner, int keynum, int remote) {
10971078 return 0 ;
10981079 }
10991080
1100- /* 1) Check Doom keycard in cross-game inventory (use cache when available to avoid main-thread API call). */
1081+ /* 1) Check Doom keycard in cross-game inventory */
11011082 const char * keyname = GetKeycardName (keynum);
1102- bool has_key = keyname && (ODOOM_CachedHasItem (keyname) || star_api_has_item (keyname));
1103- if (has_key) {
1083+ if (keyname && star_api_has_item (keyname)) {
11041084 StarLogInfo (" Door access granted via shared inventory key: %s" , keyname);
11051085 bool used = star_api_use_item (keyname, " odoom_door" );
11061086 if (!used) {
0 commit comments