mspraggs / potentia

Southampton Game Jam 2015
0 stars 0 forks source link

Crash when weapon fired on intro #15

Closed DivFord closed 9 years ago

DivFord commented 9 years ago

Do we not have a gun in the intro scene? Because firing in the into crashes the game. Would it be worth adding a "None" gun that we assign at startup?

mspraggs commented 9 years ago

According to gdb this is caused by a call to std::vector::size on line 101 of Gun.cpp. This is pretty impressive in iteself as the Gun instance at this point actually seems to have a memory address of 0x0. In any case the bullets vector doesn't appear to be initialised, as it also has an invalid memory address.

EDIT But yes in reply to your comment perhaps a "unarmed" weapon would be useful here.

DivFord commented 9 years ago

Which is funny, since the robot is currently missing an arm… Maybe a sprite for the "unarmed" weapon is in order at some point.

Fyll commented 9 years ago

Graphics aside, he now doesn't try to shoot if he's not holding a gun. This should stop the crashing.