OK to send in a bug fix submission?

Everything about development and the OpenMW source code.
Post Reply
Allofich
Posts: 104
Joined: 28 May 2016, 12:50

OK to send in a bug fix submission?

Post by Allofich » 28 May 2016, 14:17

Hi, I've been reporting bugs on this site in the Bugs section under the name "R.D.," and I decided to try to fix a bug myself.

I've been working on Bug #3349. This bug consists of a few parts.

- AI packages don't repeat (except for AIWander).
and
- AIWander and AIFollow packages don't end when their duration is up.

I've managed to fix these on my own build. The only part of the bug report I haven't been able to fix is that AIFollow doesn't terminate when you arrive at the target destination when it's in an interior. It looks like fill() in aisequence.cpp will not send the CellID to the AIFollow constructor, but fixing this might mean (not sure yet) modifying esm/components files, which I am not comfortable doing right now, so I'm putting this part of the issue aside.

Is it OK for me to send in what I have on GitHub? I'm a very inexperienced programmer, so my work might have problems in it. I've tried to keep to the OpenMW policies and test everything. I haven't posted on the "New Developers Applications" board and I don't feel like I'm qualified to apply as a "developer," anyway.

Also, in aiwander.cpp is
// Recreate vanilla (broken?) behavior of resetting start time of AIWander:
mStartTime = MWBase::Environment::get().getWorld()->getTimeStamp();
Resetting mStartTime here causes AIWander packages to never end in OpenMW unless you use the T key to fastforward. The packages do end in the original game, so I want to remove this line as I don't see that it does anything besides mess up AIWander, but is there a reason why it should stay?

Thanks.

User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: OK to send in a bug fix submission?

Post by scrawl » 28 May 2016, 15:02

Hi, thank you for your excellent reports and your expertise on existing bugs.
Is it OK for me to send in what I have on GitHub? I'm a very inexperienced programmer, so my work might have problems in it. I've tried to keep to the OpenMW policies and test everything.
Yes please :) There's a chance it won't be perfect on the first try, but that's what pull requests are for!
I've managed to fix these on my own build. The only part of the bug report I haven't been able to fix is that AIFollow doesn't terminate when you arrive at the target destination when it's in an interior. It looks like fill() in aisequence.cpp will not send the CellID to the AIFollow constructor, but fixing this might mean (not sure yet) modifying esm/components files, which I am not comfortable doing right now, so I'm putting this part of the issue aside.
A simple mistake, it seems. aiPackage.mCellName should be passed as the 2nd parameter. I think the components/esm portion is fine, but I have not tested it.
Edit: I'm guessing the same change needs to be applied to AIEscort construction.
Resetting mStartTime here causes AIWander packages to never end in OpenMW unless you use the T key to fastforward. The packages do end in the original game, so I want to remove this line as I don't see that it does anything besides mess up AIWander, but is there a reason why it should stay?
This line was written very long ago and the person that wrote it is no longer around here. Nuke it, and if nothing breaks, great!

Allofich
Posts: 104
Joined: 28 May 2016, 12:50

Re: OK to send in a bug fix submission?

Post by Allofich » 28 May 2016, 15:24

Thanks, scrawl. It's great to know that you have liked my bug reports (actually I was worried I was being a bit of a nuisance by posting so much) and that you will welcome a submission.

I'll go set myself up on GitHub and send it in.

Allofich
Posts: 104
Joined: 28 May 2016, 12:50

Re: OK to send in a bug fix submission?

Post by Allofich » 28 May 2016, 16:54

Question for anyone who can help me out.

I've mostly stumbled my way through setting up GitHub now, and I think I have it ready to submit a pull request to the OpenMW master, but the pull request preview is showing in all of the files I want to submit (except for one), that every single line of the file is new. In other words, the old file is shown completely highlighted in red, and the new file completely in green, even though only a few lines are actually changed.

I'm on Windows and editing files through Visual Studio 2015 if it matters. Any help greatly appreciated.

Allofich
Posts: 104
Joined: 28 May 2016, 12:50

Re: OK to send in a bug fix submission?

Post by Allofich » 28 May 2016, 17:21

About the files showing all the lines as modified, it's probably a Windows line endings or something like that. Anyway, I seem to have been able to work around it.

magamo
Posts: 109
Joined: 28 May 2016, 17:28

Re: OK to send in a bug fix submission?

Post by magamo » 28 May 2016, 17:33

Allofich wrote:About the files showing all the lines as modified, it's probably a Windows line endings or something like that. Anyway, I seem to have been able to work around it.
I expect that you have figured out the root of your problem. My recommendation would be to use notepad++ to compare line endings and convert to what is in the repo before committing. I believe most development takes place on UNIX based operating systems for OpenMW.

Allofich
Posts: 104
Joined: 28 May 2016, 12:50

Re: OK to send in a bug fix submission?

Post by Allofich » 28 May 2016, 17:51

I experienced the problem when I uploaded the files through the click and drag interface on the GitHub website (for some reason one of the files didn't show the problem.)

When I "pushed" the files to my fork of OpenMW using the command line in Git Bash, I didn't have a problem. I think it may have converted the files out of Windows format. (I think I remember reading something about Windows-Unix conversions I was installing Git on my computer) That's my guess, anyway.

User avatar
AnyOldName3
Posts: 2107
Joined: 26 Nov 2015, 03:25

Re: OK to send in a bug fix submission?

Post by AnyOldName3 » 29 May 2016, 00:52

Yeah, git can be configured to use Unix line endings in the repository, and whatever your OS likes for the local clone.
AnyOldName3, Master of Shadows

Post Reply