Merge public master

This commit is contained in:
Eidolon 2025-09-15 20:12:35 -05:00
commit c647295ef1
3 changed files with 30 additions and 1 deletions

View file

@ -0,0 +1,19 @@
# What version of Ring Racers are you playing?
(Replace this text with the version number. You can see this on the title screen at the bottom-left corner.)
# What is the fastest way to trigger the bug?
(Bugs that can't be reproduced are extremely hard to fix. If you can't make it happen on demand, try and describe the circumstances where it triggers.)
# What is the bugged behavior?
(Describe what happens when you encounter the bug.)
# What do you expect to happen instead?
(Describe what should be happening instead of the bugged behavior.)
# Logs, videos, or screenshots that showcase the issue
(For crash bugs, look for an .RPT file, or your `latest-log.txt`. You can drag it directly into this window.)

View file

@ -14,6 +14,7 @@
#include "../cxxutil.hpp"
#include "../z_zone.h"
#include "../lua_script.h"
using namespace srb2;
@ -117,6 +118,9 @@ void* PoolAllocator::allocate()
void PoolAllocator::deallocate(void* p)
{
// Required in case this block is reused
LUA_InvalidateUserdata(p);
FreeBlock* block = reinterpret_cast<FreeBlock*>(p);
block->next = head_;
head_ = block;
@ -127,6 +131,12 @@ void PoolAllocator::release()
ChunkFooter* next = nullptr;
for (ChunkFooter* i = first_chunk_; i != nullptr; i = next)
{
uint8_t *chunk = (uint8_t*)i->start;
for (size_t j = 0; j < blocks_; j++)
{
// Invalidate all blocks that possibly weren't passed to deallocate
LUA_InvalidateUserdata(chunk + (j * block_size_));
}
next = i->next;
Z_Free(i->start);
}

View file

@ -68,7 +68,7 @@ struct Particle : Mobj
skins[pskinn]->sprites[states[spr2state].frame].numframes > 0)
{
x->skin = (void*)(&skins[pskinn]);
x->skin = (void*)(skins[pskinn]);
x->state(spr2state);
//frame will be set by state()
}