Skip to content

Commit

Permalink
Renamed variables in ScriptClass::RemoveThread for more clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
smallmodel committed Oct 26, 2023
1 parent 04a6012 commit a6e602a
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions code/script/scriptclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ ScriptThread *ScriptClass::CreateScriptInternal(const ScriptVariable& label)
AddThread
====================
*/
void ScriptClass::AddThread(ScriptVM *m_ScriptVM)
void ScriptClass::AddThread(ScriptVM *thread)
{
m_ScriptVM->next = m_Threads;
m_Threads = m_ScriptVM;
thread->next = m_Threads;
m_Threads = thread;
}

/*
Expand Down Expand Up @@ -269,23 +269,24 @@ void ScriptClass::KillThreads()
RemoveThread
====================
*/
void ScriptClass::RemoveThread(ScriptVM *m_ScriptVM)
void ScriptClass::RemoveThread(ScriptVM *thread)
{
if (m_Threads == m_ScriptVM) {
m_Threads = m_ScriptVM->next;
ScriptVM *current;
ScriptVM *next;

if (m_Threads == thread) {
m_Threads = thread->next;

if (m_Threads == NULL) {
if (!m_Threads) {
delete this;
}
} else {
ScriptVM *m_current = m_Threads;
ScriptVM *i;

for (i = m_Threads->next; i != m_ScriptVM; i = i->next) {
m_current = i;
next = m_Threads;
for (current = m_Threads->next; current != thread; current = current->next) {
next = current;
}

m_current->next = i->next;
next->next = current->next;
}
}

Expand Down

0 comments on commit a6e602a

Please sign in to comment.