Bug 209310 - games/bsdgames: incorrect creation of potion names for rogue
Summary: games/bsdgames: incorrect creation of potion names for rogue
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Adam Weinberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-06 00:33 UTC by sjrbulk
Modified: 2016-05-12 23:44 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (adamw)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sjrbulk 2016-05-06 00:33:57 UTC
The routine to mix potion names doesn't do the swap correctly. Patch below:

--- rogue/inventory.c.orig	2016-05-05 20:12:11.566575000 -0400
+++ rogue/inventory.c	2016-05-05 20:15:31.862775000 -0400
@@ -417,6 +417,7 @@
 		k = get_rand(0, (POTIONS - 1));
 		memcpy(t, id_potions[j].title, MAX_ID_TITLE_LEN);
 		memcpy(id_potions[j].title, id_potions[k].title, MAX_ID_TITLE_LEN);
+		memcpy(id_potions[k].title, t, MAX_ID_TITLE_LEN);
 	}
 }
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2016-05-11 16:24:58 UTC
Has this been upstreamed?
Comment 2 sjrbulk 2016-05-12 02:04:46 UTC
I don't believe so.
Comment 3 Adam Weinberger freebsd_committer freebsd_triage 2016-05-12 02:31:26 UTC
You should consider doing so.

Can you give me a little background on what issue this fixes?
Comment 4 sjrbulk 2016-05-12 10:47:32 UTC
I didn't realize that I needed to trace the origin of source code when I reported a bug.

This routine is swapping the potion colors and because only 2/3 of the color swap code is there, many of the potions end up with the same color.
Comment 5 Adam Weinberger freebsd_committer freebsd_triage 2016-05-12 14:33:19 UTC
Asking you to describe the breakage in a bug report isn't out of line.
Comment 6 Adam Weinberger freebsd_committer freebsd_triage 2016-05-12 14:54:44 UTC
Committed, thanks. Please do report this upstream (DragonflyBSD) as well.
Comment 7 commit-hook freebsd_committer freebsd_triage 2016-05-12 14:55:21 UTC
A commit references this bug:

Author: adamw
Date: Thu May 12 14:54:20 UTC 2016
New revision: 415066
URL: https://svnweb.freebsd.org/changeset/ports/415066

Log:
  Fix potion mixing.

  From PR:
  	This routine is swapping the potion colors and because only 2/3
  	of the color swap code is there, many of the potions end up with
  	the same color.

  PORTREVISION bump.

  PR:		209310
  Submitted by:	sjrbulk at verizon dot net

Changes:
  head/games/bsdgames/Makefile
  head/games/bsdgames/files/patch-rogue_inventory.c
Comment 8 sjrbulk 2016-05-12 23:44:57 UTC
Sorry for the tone in the previous message. I don't have any interaction with DragonflyBSD (when I submitted this patch, I didn't even know this source was coming from DragonflyBSD) and would have assumed that someone else would have pushed this upstream, since I have no idea how to even file a bug report at their site.