Files
haikuports/games-simulation/singularity/patches/singularity-1.00.patchset
OscarL 2eb61121a2 singularity: avoid crash when using numpy 2.x. (#11598)
Patch follows the upstream fix. Works with both numpy 1.x and 2.x now.
2025-01-07 14:32:48 +01:00

24 lines
803 B
Plaintext

From 48799c6eccab89fc02289d7c0a79bf7fe0262328 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Tue, 7 Jan 2025 09:14:54 -0300
Subject: Fix crash with numpy 2.x
Slightly modified from an upstream fix.
diff --git a/singularity/code/buyable.py b/singularity/code/buyable.py
index 57111db..fa16136 100644
--- a/singularity/code/buyable.py
+++ b/singularity/code/buyable.py
@@ -183,7 +183,7 @@ class Buyable(object):
# And apply it.
was_complete = self.cost_paid
- cost_paid = numpy.maximum(numpy.cast[int64](numpy.round(raw_paid)),
+ cost_paid = numpy.maximum(numpy.asarray(numpy.round(raw_paid), dtype=int64),
was_complete)
spent = cost_paid - was_complete
return spent, cost_paid
--
2.45.2