Comments (6)
Heureka? It seems like it was a confusion between return and break in the step function. I will open the PR in the next days (just to verify that the change is right)
from inkcpp.
Good to know, thank you for providing a test case ^^ let take a look in these mysteries.
from inkcpp.
I found a related bug. It seems that the same issue appears with functions:
Function Line
~ funcTest()
-> DONE
=== function funcTest()
Function Result
This will output:
> Function Line\nFunction Result\n
Instead of:
> Function Line\n
> Function Result\n
I have attached a modified NewLines.cpp
and LinesStory.ink
for test purposes. I also added a tunnel test just in case, although tunnels seem to be working fine.
EDIT: tests.zip
Stepping through the code, I've identified that it's not a regression from #45; it was broken even when change_type::no_change
was return false
instead of break
. However, I think the prior line as forget()
is the issue. The function pointer is a no_change
operation, but should still be restore()
'd. The reason the function causes the failure is that value_type::func_start
is a no-change operation that isn't a newline, so the code forgets the old save state, and then never even saves a new save-state in the following if-statement. Thus the next line is appended as usual, and restore()
is called after that second line.
If I remove that forget()
statement, all the tests pass, including my new ones; i.e. the save state properly restores to the correct location. Thus, the new lookahead determination code becomes:
bool runner_impl::line_step()
{
...
case change_type::no_change:
break;
...
}
@JBenda does that seem correct? If so, let me know; I can create a PR for that change. That said, I might be totally off the mark; I'm still new to the codebase!
from inkcpp.
Thanks for the digging, it seems like a miss placement of some forget/save thing, but just removing the forged leads to wrong visit count from look aheads. So more likely something else in wrong, maybe we also need a new case? (don't think so currently)
Removing the forget at no_changes looks like a good starting point.
Look at #48 for an implemented version of your new test, feel free to also start your own PR based on this. The missing counting error was located when running ink-proof
from inkcpp.
#48 seemst to work now, the forget was missplaced
no_chache should not trigger a forget (as you descripetd)
but if we encounter a second newline (through tunnels or multiple glues) we need to move the save state with us to restore to the correct location, for that detecting a new line needs to forget the old save state and create a new one
from inkcpp.
Awesome, thankye.
from inkcpp.
Related Issues (20)
- Code is not complilable HOT 5
- String Comparison Unit Test Failing on Linux HOT 5
- inkcpp_test does not compile on M1 / arm64 HOT 5
- Difficult distribution structure for non-Unreal install HOT 5
- Test fails on Debug configuration HOT 4
- Introducing C bindings HOT 1
- Crash with Tags HOT 4
- inklecate location HOT 1
- C++ exports for UE plugin HOT 1
- Fully-bracketed choices followed by a single space causes an assertion error HOT 5
- Bracketed choices which don't have content before their brackets error when a subsequently nested third-level choice is encountered HOT 1
- Windows Defender false positive on win64-cl.zip and inkcpp_cl.exe
- Variables are not re-evaluated after lookahead HOT 2
- Conditional diverts are not properly handled with whitespace HOT 4
- UE Marketplace Release HOT 1
- Heads up: no arm64 code in latest binary release/download for macos HOT 3
- crime scene example story throws "Operation for value not supported!" HOT 3
- Errorneous newline inserted in some text. HOT 6
- How to serialize entire story to a graph? HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inkcpp.