https://github.com/libsdl-org/Maelstrom/commit/71164fbecb5b650edf8760bc05b222ebba4a6be7
From 71164fbecb5b650edf8760bc05b222ebba4a6be7 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 19 Jun 2013 01:20:02 -0700
Subject: [PATCH] Fixed a 10 year old bug: you get points from steel asteroids
every time you hit them.
---
game/objects.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/game/objects.h b/game/objects.h
index 9275730e..6ee01105 100644
--- a/game/objects.h
+++ b/game/objects.h
@@ -537,6 +537,22 @@ class SteelRoid : public Object {
SteelRoid(int X, int Y, int xVel, int yVel);
~SteelRoid() { }
+ int BeenShot(Object *ship, Shot *shot) {
+ /* Every time we're hit, we grant points */
+ if ( (HitPoints - shot->damage) > 0 ) {
+ ship->IncrScore(Points);
+ }
+ return Object::BeenShot(ship, shot);
+ }
+
+ int BeenRunOver(Object *ship) {
+ /* Every time we're hit, we grant points */
+ if ( (HitPoints - 1) > 0 ) {
+ ship->IncrScore(Points);
+ }
+ return Object::BeenRunOver(ship);
+ }
+
int Explode(void) {
int newsprite;