• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

One Indexing Variables, Two Periodics

Status
Not open for further replies.
Level 13
Joined
Mar 29, 2012
Messages
530
So I wrote 2 indexing functions and 2 periodic functions.
Inside those functions, I only use one Next, Prev, etc variables.

Problem is, when those functions are running together I think there's a conflict between those 2 periodics.

JASS:
    if udg_STool_Recyclable == 0 then
        set udg_STool_MaxIndex = udg_STool_MaxIndex + 1
        set index = udg_STool_MaxIndex
    else
        set udg_STool_Recyclable = udg_STool_Recyclable - 1
        set index = udg_STool_Recycle[udg_STool_Recyclable]
    endif
    set udg_STool_Next[index] = 0
    set udg_STool_Next[udg_STool_Prev[0]] = index
    set udg_STool_Prev[index] = udg_STool_Prev[0]
    set udg_STool_Prev[0] = index

JASS:
    local integer index = 0
    loop
        set index = udg_STool_Next[index]
        exitwhen index == 0
        // actions
    endloop
 
Status
Not open for further replies.
Top