Skip to content
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

Allow the creation of new Tiberiums #1234

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

ZivDero
Copy link
Contributor

@ZivDero ZivDero commented Mar 29, 2024

Allows the creation of new Tiberiums.

  • Replace vanilla StorageClass with a new vector-based one
  • Allow to specify overlays for a Tiberium (credits to Otamaa)

Docs coming later.

TODO:

  • Fix minor memory leak when loading save
  • Fix crash when changing inside value of storage after loading a save

@ZivDero ZivDero force-pushed the feature/extended-tiberium branch from b572954 to 8083d45 Compare March 29, 2024 21:55
Copy link

github-actions bot commented Mar 29, 2024

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

Copy link
Member

@Metadorius Metadorius left a comment

Choose a reason for hiding this comment

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

Was gonna comment on the usage of new and delete instead of game's allocators but probably that's fine, not sure

Comment on lines 265 to 354
{
return 0;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
return 0;
}
return 0;

Comment on lines 279 to 368
{
amount = static_cast<float>(lastTotalStorage - lastStorage);
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
amount = static_cast<float>(lastTotalStorage - lastStorage);
}
amount = static_cast<float>(lastTotalStorage - lastStorage);

Comment on lines 287 to 376
{
break;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
break;
}
break;

Comment on lines 299 to 388
{
freeSpace = amount;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
freeSpace = amount;
}
freeSpace = amount;

Comment on lines 147 to 150
if (auto pOverlay = TiberiumExt::ExtMap.Find(pItem)->Overlays[0])
{
pItem->Image = pOverlay;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (auto pOverlay = TiberiumExt::ExtMap.Find(pItem)->Overlays[0])
{
pItem->Image = pOverlay;
}
if (auto pOverlay = TiberiumExt::ExtMap.Find(pItem)->Overlays[0])
pItem->Image = pOverlay;

Comment on lines 20 to 22
{
total += Tiberiums[i];
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
total += Tiberiums[i];
}
total += Tiberiums[i];

Comment on lines 62 to 64
{
storageClass->Tiberiums[i] = Tiberiums[i] + that.Tiberiums[i];
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
storageClass->Tiberiums[i] = Tiberiums[i] + that.Tiberiums[i];
}
storageClass->Tiberiums[i] = Tiberiums[i] + that.Tiberiums[i];

Comment on lines 72 to 74
{
Tiberiums[i] += that.Tiberiums[i];
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
Tiberiums[i] += that.Tiberiums[i];
}
Tiberiums[i] += that.Tiberiums[i];

Comment on lines 83 to 85
{
storageClass->Tiberiums[i] = Tiberiums[i] - that.Tiberiums[i];
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
storageClass->Tiberiums[i] = Tiberiums[i] - that.Tiberiums[i];
}
storageClass->Tiberiums[i] = Tiberiums[i] - that.Tiberiums[i];

Comment on lines 93 to 95
{
Tiberiums[i] -= that.Tiberiums[i];
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
Tiberiums[i] -= that.Tiberiums[i];
}
Tiberiums[i] -= that.Tiberiums[i];

@ZivDero ZivDero marked this pull request as draft April 23, 2024 12:37
@ZivDero ZivDero force-pushed the feature/extended-tiberium branch from 17fb1c1 to 098024b Compare September 23, 2024 20:07
@ZivDero ZivDero force-pushed the feature/extended-tiberium branch from 098024b to 5dcb105 Compare September 23, 2024 20:07
@ZivDero ZivDero force-pushed the feature/extended-tiberium branch from 5dcb105 to 1f3bb8d Compare September 23, 2024 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants