Comments (6)
This seems to be related to the amount of update steps that are done between drawing a frame. I played around with the steps
variable in void ScreenManager::loop_iter()
. If hardcoded set to 1, I was not able to reproduce the crash. Another test with step = 16;
it crashed on the first try.
from supertux.
Potentially having get_sector() return a pointer to a sector instead of a reference could fix this issue but then we'd have to add null checks to every function calling that.
Does anyone have a better idea?
from supertux.
I think we should just make sure a sector is always available, since initialization. It's not supposed to not have a current sector set.
from supertux.
Maybe I found a solution. The worldmap camera is a member of WorldMapSector, so it belongs to a specific worldmap sector. When WorldMapSector::update()
invokes m_camera->update()
, Camera::update()
calls Camera::get_camera_pos_for_tux()
which uses WorldMapSector::current()
that refers to the newly created WorldMap with m_sector
being nullptr. Instead we could pass the WorldMapSector as argument to Camera's constructor, store it as member (reference) and replace the calls to WorldMapSector::current()
with the member.
A first quick and dirty test seems to work.
But in general I agree to @Vankata453 , that having always a valid current sector would be preferrable.
from supertux.
@Brockengespenst Thanks for checking this out! Would you like to create a PR for this?
from supertux.
Sure, no problem. Please check #2921.
from supertux.
Related Issues (20)
- Have option to make lightning flash way less intense HOT 5
- Some fonts are unused HOT 5
- Flying snowballs turn invincible, invisible, and infnititley tall whenever the game is unpaused and paused HOT 2
- Tux Collision Error HOT 4
- Strange interactions with Unisolid Tiles and Frozen Enemies HOT 1
- Autotiling resets after saving level via Ctrl+S HOT 2
- Set worldmap music through script not preserved after exiting level HOT 1
- Large crushers don't activate bonus blocks HOT 4
- Remove/change "Hold Ctrl" Shortcut for Autotiling HOT 7
- Supertux does not compile due to missing header HOT 7
- [Bug]: Bouncing Snowballs bouncing to each other
- [Bug]: Tarantula doesn't work in flipped sectors
- Generate release builds as `RelWithDebInfo`
- Objects with missing sprite do not load at all.
- [Bug]: cmake cannot find sdl2 HOT 1
- Add these enemies again. HOT 2
- Change and add these enemies HOT 1
- [Bug]: Level.spawn() function doesn't work after using a door
- [Bug]: Tux dies in "Find the bigger fish!" jumping into the secret after using a door HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supertux.