mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-20 03:54:47 +00:00
prevent a crash when entering '(0,0)' in Archimedean
This commit is contained in:
parent
8489550aed
commit
36c71eb583
@ -1439,6 +1439,10 @@ EX void show() {
|
||||
void archimedean_tiling::get_nom_denom(int& anom, int& adenom) {
|
||||
int nom = 2 - N, denom = 2;
|
||||
for(int f: faces) {
|
||||
if(f == 0) {
|
||||
/* prevent a crash */
|
||||
anom = 1; adenom = 1; return;
|
||||
}
|
||||
int g = gcd(denom, f);
|
||||
nom = (nom * f + denom) / g;
|
||||
denom = denom / g * f;
|
||||
|
Loading…
Reference in New Issue
Block a user