Skip to content

[ZH] Fix Supply drops instantly triggering when built while disabled #423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,15 @@ OCLUpdate::~OCLUpdate( void )
//-------------------------------------------------------------------------------------------------
UpdateSleepTime OCLUpdate::update( void )
{
if( getObject()->isDisabled() )
if(m_nextCreationFrame == 0 )
{
setNextCreationFrame();
return UPDATE_SLEEP_NONE;
}

if( getObject()->isDisabled() || getObject()->getStatusBits().test( OBJECT_STATUS_UNDER_CONSTRUCTION ) )
{
// if( getObject()->getStatusBits().test( OBJECT_STATUS_UNDER_CONSTRUCTION ) ) return UPDATE_SLEEP_NONE;// not built yet
Comment on lines +126 to +134
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be reduced down to the following

UpdateSleepTime OCLUpdate::update( void )
{
	if( getObject()->isDisabled() )
	{
#if RETAIL_COMPATIBLE_CRC
		m_nextCreationFrame++;
#else
		if(m_timerStartedFrame > 0)
			m_nextCreationFrame++;
#endif

		return UPDATE_SLEEP_NONE;
	}

	const OCLUpdateModuleData *data = getOCLUpdateModuleData();
	```

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs replicating in generals.

m_nextCreationFrame++;
return UPDATE_SLEEP_NONE;
}
Expand Down